{"action":"created","comment":{"url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/comments/37515629","id":37515629,"diff_hunk":"@@ -0,0 +1,157 @@\n+import { Component, PropTypes } from 'react';\n+import { getMatchedGood, getUpdatedValues } from './utils/utils';\n+import PropertyList from './PropertyList';\n+import ProductAddToCartButton from './ProductAddToCartButton';\n+\n+// const defaultProps = {\n+//   properties: [{\n+//     id: 123,\n+//     type: 'colors',\n+//     title: 'Цвет',\n+//     items: [{\n+//       title: 'Розовый',\n+//       color: '#333333',\n+//       value: 123\n+//     }, {\n+//       title: 'Синий в горошек',\n+//       color: '#123212', \n+//       image_url: '../images/15927_src.jpg',\n+//       value: 456\n+//     }, {\n+//       title: 'Синий в горошек22',\n+//       color: '#123212', \n+//       value: 789\n+//     }]\n+//   }, {\n+//     id: 345,\n+//     type: 'items',\n+//     title: 'Размер',\n+//     items: [{\n+//       title: 'Неизвестный',\n+//       value: null\n+//     }, {\n+//       title: 'Размер 17',\n+//       value: 12\n+//     }, {\n+//       title: 'Размер 18',\n+//       value: 13\n+//     }, {\n+//       title: 'Размер 20',\n+//       value: 20\n+//     }]\n+//   }, {\n+//     id: 348,\n+//     type: 'items',\n+//     title: 'Вес',\n+//     items: [{\n+//       title: 'Шестой',\n+//       value: 12\n+//     }, {\n+//       title: 'Седьмой',\n+//       value: 13\n+//     }, {\n+//       title: 'Восьмой',\n+//       value: 1\n+//     }]\n+//   }],\n+//   goods: [{\n+//     article: 'Артикул 12', \n+//     global_id: 'qweqwewqeq',\n+//     image_url: 'htttp://...product.png', \n+//     quantity: 12,\n+//     attributes: {\n+//       345: 1,\n+//       123: 456\n+//     }\n+//   }, {\n+//     article: 'Артикул 13', \n+//     global_id: 'qweqwewqeq123', \n+//     quantity: 1, \n+//     attributes: {\n+//       345: 13,\n+//       123: 123,\n+//       348: 12\n+//     }\n+//   }, {\n+//     article: 'Артикул 19', \n+//     global_id: 'qweddqwewqeq123', \n+//     quantity: 5, \n+//     attributes: {\n+//       345: null,\n+//       123: 789\n+//     }\n+//   }, {\n+//     article: 'Артикул 19', \n+//     global_id: 'qweddqwewqeq123', \n+//     quantity: 5, \n+//     attributes: {\n+//       345: 12,\n+//       123: 123,\n+//       348: 13\n+//     }\n+//   }]\n+// };\n+\n+export default class ProductProperties extends Component {\n+  static propTypes = {\n+    goods: PropTypes.array.isRequired,\n+    properties: PropTypes.array.isRequired,\n+    formAction: PropTypes.string.isRequired,\n+  }\n+  static defaultProps = {\n+    goods: [],\n+    properties: []\n+  }\n+  state = {\n+    good: null,\n+    values: {},\n+  }\n+  render() {\n+    return (\n+      <form\n+        action={this.props.formAction}\n+        method=\"POST\"\n+        className=\"b-product-properties\"\n+      >\n+        <PropertyList\n+          {...this.props}\n+          values={this.state.values}\n+          onChange={this.updateValues.bind(this)}\n+        />\n+        {this.renderGlobalGoodID(this.state.good)}\n+        {this.renderAddToCart(this.props.properties)}\n+      </form>\n+    );\n+  }\n+  renderGlobalGoodID(good) {\n+    if (good) {\n+      return <input type=\"hidden\" name=\"global_good_id\" value={good.global_id} />;\n+    }\n+  }\n+  renderAddToCart(properties) {\n+    if (properties.length) {\n+      return (\n+        <div className=\"b-item-full__form__row b-item-full__form__submit\">\n+          <ProductAddToCartButton\n+            hasGood={!!this.state.good}","path":"app/scripts/react/components/ProductProperties/index.jsx","position":136,"original_position":136,"commit_id":"2d9da79a9c26dc1f38c4197e2bbf628aad88fdc3","original_commit_id":"2d9da79a9c26dc1f38c4197e2bbf628aad88fdc3","user":{"login":"sergeylaptev","id":5740795,"avatar_url":"https://avatars.githubusercontent.com/u/5740795?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeylaptev","html_url":"https://github.com/sergeylaptev","followers_url":"https://api.github.com/users/sergeylaptev/followers","following_url":"https://api.github.com/users/sergeylaptev/following{/other_user}","gists_url":"https://api.github.com/users/sergeylaptev/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeylaptev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeylaptev/subscriptions","organizations_url":"https://api.github.com/users/sergeylaptev/orgs","repos_url":"https://api.github.com/users/sergeylaptev/repos","events_url":"https://api.github.com/users/sergeylaptev/events{/privacy}","received_events_url":"https://api.github.com/users/sergeylaptev/received_events","type":"User","site_admin":false},"body":"Нет, только в кнопке\r\n","created_at":"2015-08-20T10:33:43Z","updated_at":"2015-08-20T10:33:43Z","html_url":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118#discussion_r37515629","pull_request_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/comments/37515629"},"html":{"href":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118#discussion_r37515629"},"pull_request":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118","id":42808208,"html_url":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118","diff_url":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118.diff","patch_url":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118.patch","issue_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/118","number":118,"state":"open","locked":false,"title":"Product properties","user":{"login":"sergeylaptev","id":5740795,"avatar_url":"https://avatars.githubusercontent.com/u/5740795?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeylaptev","html_url":"https://github.com/sergeylaptev","followers_url":"https://api.github.com/users/sergeylaptev/followers","following_url":"https://api.github.com/users/sergeylaptev/following{/other_user}","gists_url":"https://api.github.com/users/sergeylaptev/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeylaptev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeylaptev/subscriptions","organizations_url":"https://api.github.com/users/sergeylaptev/orgs","repos_url":"https://api.github.com/users/sergeylaptev/repos","events_url":"https://api.github.com/users/sergeylaptev/events{/privacy}","received_events_url":"https://api.github.com/users/sergeylaptev/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-19T12:27:58Z","updated_at":"2015-08-20T10:33:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a2eed1aefc3be0977ec1536f45a343d0db10942","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118/commits","review_comments_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118/comments","review_comment_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/118/comments","statuses_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/statuses/2d9da79a9c26dc1f38c4197e2bbf628aad88fdc3","head":{"label":"BrandyMint:sergey/product-properties","ref":"sergey/product-properties","sha":"2d9da79a9c26dc1f38c4197e2bbf628aad88fdc3","user":{"login":"BrandyMint","id":1872661,"avatar_url":"https://avatars.githubusercontent.com/u/1872661?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandyMint","html_url":"https://github.com/BrandyMint","followers_url":"https://api.github.com/users/BrandyMint/followers","following_url":"https://api.github.com/users/BrandyMint/following{/other_user}","gists_url":"https://api.github.com/users/BrandyMint/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandyMint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandyMint/subscriptions","organizations_url":"https://api.github.com/users/BrandyMint/orgs","repos_url":"https://api.github.com/users/BrandyMint/repos","events_url":"https://api.github.com/users/BrandyMint/events{/privacy}","received_events_url":"https://api.github.com/users/BrandyMint/received_events","type":"Organization","site_admin":false},"repo":{"id":29183527,"name":"kiosk-public-static-v2","full_name":"BrandyMint/kiosk-public-static-v2","owner":{"login":"BrandyMint","id":1872661,"avatar_url":"https://avatars.githubusercontent.com/u/1872661?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandyMint","html_url":"https://github.com/BrandyMint","followers_url":"https://api.github.com/users/BrandyMint/followers","following_url":"https://api.github.com/users/BrandyMint/following{/other_user}","gists_url":"https://api.github.com/users/BrandyMint/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandyMint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandyMint/subscriptions","organizations_url":"https://api.github.com/users/BrandyMint/orgs","repos_url":"https://api.github.com/users/BrandyMint/repos","events_url":"https://api.github.com/users/BrandyMint/events{/privacy}","received_events_url":"https://api.github.com/users/BrandyMint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrandyMint/kiosk-public-static-v2","description":"Публичная часть верстки kiiiosk.ru - версия 2","fork":true,"url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2","forks_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/forks","keys_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/teams","hooks_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/hooks","issue_events_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/events{/number}","events_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/events","assignees_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/assignees{/user}","branches_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/branches{/branch}","tags_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/tags","blobs_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/statuses/{sha}","languages_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/languages","stargazers_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/stargazers","contributors_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/contributors","subscribers_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/subscribers","subscription_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/subscription","commits_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/contents/{+path}","compare_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/merges","archive_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/downloads","issues_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues{/number}","pulls_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls{/number}","milestones_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/milestones{/number}","notifications_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/labels{/name}","releases_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/releases{/id}","created_at":"2015-01-13T09:52:25Z","updated_at":"2015-07-16T10:04:03Z","pushed_at":"2015-08-20T10:25:27Z","git_url":"git://github.com/BrandyMint/kiosk-public-static-v2.git","ssh_url":"git@github.com:BrandyMint/kiosk-public-static-v2.git","clone_url":"https://github.com/BrandyMint/kiosk-public-static-v2.git","svn_url":"https://github.com/BrandyMint/kiosk-public-static-v2","homepage":"http://brandymint.github.io/kiosk-public-static-v2","size":10357,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"BrandyMint:master","ref":"master","sha":"e6c2ad80c781c3c57f5d8b2339851feaac646496","user":{"login":"BrandyMint","id":1872661,"avatar_url":"https://avatars.githubusercontent.com/u/1872661?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandyMint","html_url":"https://github.com/BrandyMint","followers_url":"https://api.github.com/users/BrandyMint/followers","following_url":"https://api.github.com/users/BrandyMint/following{/other_user}","gists_url":"https://api.github.com/users/BrandyMint/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandyMint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandyMint/subscriptions","organizations_url":"https://api.github.com/users/BrandyMint/orgs","repos_url":"https://api.github.com/users/BrandyMint/repos","events_url":"https://api.github.com/users/BrandyMint/events{/privacy}","received_events_url":"https://api.github.com/users/BrandyMint/received_events","type":"Organization","site_admin":false},"repo":{"id":29183527,"name":"kiosk-public-static-v2","full_name":"BrandyMint/kiosk-public-static-v2","owner":{"login":"BrandyMint","id":1872661,"avatar_url":"https://avatars.githubusercontent.com/u/1872661?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandyMint","html_url":"https://github.com/BrandyMint","followers_url":"https://api.github.com/users/BrandyMint/followers","following_url":"https://api.github.com/users/BrandyMint/following{/other_user}","gists_url":"https://api.github.com/users/BrandyMint/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandyMint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandyMint/subscriptions","organizations_url":"https://api.github.com/users/BrandyMint/orgs","repos_url":"https://api.github.com/users/BrandyMint/repos","events_url":"https://api.github.com/users/BrandyMint/events{/privacy}","received_events_url":"https://api.github.com/users/BrandyMint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrandyMint/kiosk-public-static-v2","description":"Публичная часть верстки kiiiosk.ru - версия 2","fork":true,"url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2","forks_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/forks","keys_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/teams","hooks_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/hooks","issue_events_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/events{/number}","events_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/events","assignees_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/assignees{/user}","branches_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/branches{/branch}","tags_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/tags","blobs_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/statuses/{sha}","languages_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/languages","stargazers_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/stargazers","contributors_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/contributors","subscribers_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/subscribers","subscription_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/subscription","commits_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/contents/{+path}","compare_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/merges","archive_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/downloads","issues_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues{/number}","pulls_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls{/number}","milestones_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/milestones{/number}","notifications_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/labels{/name}","releases_url":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/releases{/id}","created_at":"2015-01-13T09:52:25Z","updated_at":"2015-07-16T10:04:03Z","pushed_at":"2015-08-20T10:25:27Z","git_url":"git://github.com/BrandyMint/kiosk-public-static-v2.git","ssh_url":"git@github.com:BrandyMint/kiosk-public-static-v2.git","clone_url":"https://github.com/BrandyMint/kiosk-public-static-v2.git","svn_url":"https://github.com/BrandyMint/kiosk-public-static-v2","homepage":"http://brandymint.github.io/kiosk-public-static-v2","size":10357,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118"},"html":{"href":"https://github.com/BrandyMint/kiosk-public-static-v2/pull/118"},"issue":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/118"},"comments":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/BrandyMint/kiosk-public-static-v2/statuses/2d9da79a9c26dc1f38c4197e2bbf628aad88fdc3"}}}}