{"action":"created","comment":{"url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/comments/239591572","pull_request_review_id":182418920,"id":239591572,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTU5MTU3Mg==","diff_hunk":"@@ -47,23 +72,33 @@ class Product extends Component {\n     }\n \n     get options() {\n-        const { classes, item } = this.props;\n-\n-        return item.options && item.options.length > 0 ? (\n-            <dl className={this.props.classes.options}>\n-                {item.options.map(({ name, value }) => (\n-                    <Fragment key={name}>\n-                        <dt className={classes.optionName}>{name}</dt>\n-                        <dd className={classes.optionValue}>{value}</dd>\n-                    </Fragment>\n-                ))}\n-            </dl>\n-        ) : null;\n+        const { classes, item, totalsItems } = this.props;\n+        const { item_id } = item;\n+        const regex = /[\\[\\]']+/g; // regex to to remove [] , use it to check if options are really empty\n+        return totalsItems\n+            .filter(totalsItem => totalsItem.item_id === item_id)\n+            .map(totalsItem => {\n+                const { options } = totalsItem;\n+                return options && options.replace(regex, '').length > 0 ? (\n+                    <dl className={this.props.classes.options} key={item_id}>\n+                        {JSON.parse(options).map(option => (\n+                            <Fragment key={`${item_id}_${option.label}`}>\n+                                <dt className={classes.optionLabel}>\n+                                    {option.label}:&nbsp;\n+                                </dt>\n+                                <dd className={classes.optionValue}>\n+                                    {option.value}\n+                                </dd>\n+                            </Fragment>\n+                        ))}\n+                    </dl>\n+                ) : null;\n+            });\n     }\n \n     styleImage(image) {\n         return {\n-            height: imageHeight,\n+            minHeight: imageHeight, // min-height instead of height so image will always align with grid bottom","path":"packages/venia-concept/src/components/MiniCart/product.js","position":84,"original_position":93,"commit_id":"4e6aecee76132abc10258d11b6cf7f173e7dcfd1","original_commit_id":"8a8ad9eef83efa7a6de33aa9b11feb67a69d0885","user":{"login":"supernova-at","id":13182778,"node_id":"MDQ6VXNlcjEzMTgyNzc4","avatar_url":"https://avatars2.githubusercontent.com/u/13182778?v=4","gravatar_id":"","url":"https://api.github.com/users/supernova-at","html_url":"https://github.com/supernova-at","followers_url":"https://api.github.com/users/supernova-at/followers","following_url":"https://api.github.com/users/supernova-at/following{/other_user}","gists_url":"https://api.github.com/users/supernova-at/gists{/gist_id}","starred_url":"https://api.github.com/users/supernova-at/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supernova-at/subscriptions","organizations_url":"https://api.github.com/users/supernova-at/orgs","repos_url":"https://api.github.com/users/supernova-at/repos","events_url":"https://api.github.com/users/supernova-at/events{/privacy}","received_events_url":"https://api.github.com/users/supernova-at/received_events","type":"User","site_admin":false},"body":"Thanks for the explanation 👍 ","created_at":"2018-12-06T19:52:49Z","updated_at":"2018-12-06T19:52:50Z","html_url":"https://github.com/magento-research/pwa-studio/pull/582#discussion_r239591572","pull_request_url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/comments/239591572"},"html":{"href":"https://github.com/magento-research/pwa-studio/pull/582#discussion_r239591572"},"pull_request":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582"}},"in_reply_to_id":238863032},"pull_request":{"url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582","id":235366147,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MzY2MTQ3","html_url":"https://github.com/magento-research/pwa-studio/pull/582","diff_url":"https://github.com/magento-research/pwa-studio/pull/582.diff","patch_url":"https://github.com/magento-research/pwa-studio/pull/582.patch","issue_url":"https://api.github.com/repos/magento-research/pwa-studio/issues/582","number":582,"state":"open","locked":false,"title":"Feature/553 add variant to minicart item","user":{"login":"ennostuurman","id":1906257,"node_id":"MDQ6VXNlcjE5MDYyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1906257?v=4","gravatar_id":"","url":"https://api.github.com/users/ennostuurman","html_url":"https://github.com/ennostuurman","followers_url":"https://api.github.com/users/ennostuurman/followers","following_url":"https://api.github.com/users/ennostuurman/following{/other_user}","gists_url":"https://api.github.com/users/ennostuurman/gists{/gist_id}","starred_url":"https://api.github.com/users/ennostuurman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ennostuurman/subscriptions","organizations_url":"https://api.github.com/users/ennostuurman/orgs","repos_url":"https://api.github.com/users/ennostuurman/repos","events_url":"https://api.github.com/users/ennostuurman/events{/privacy}","received_events_url":"https://api.github.com/users/ennostuurman/received_events","type":"User","site_admin":false},"body":"<!-- (REQUIRED) What is the nature of this PR? -->\r\n\r\n## This PR is a:\r\n\r\n[x] New feature\r\n[ ] Enhancement/Optimization\r\n[ ] Refactor\r\n[ ] Bugfix\r\n[ ] Test for existing code\r\n[ ] Documentation\r\n\r\n<!-- (REQUIRED) What does this PR change? -->\r\n\r\n## Summary\r\n\r\nWhen this pull request is merged, it will add product variants to the minicart item details dynamically , see issue #553 . \r\n\r\n## Additional information\r\n\r\n- this is a first setup, there's some overlap between the added totals items and the item details prop (i.e. item_id, price and product name) , so maybe code can be more optimized, on the other hand options are only available from the totals response object and items details contains images reference etc.. \r\n- removed mockdata\r\n- did some additional styling as per mockup as well. See screenprint.\r\n- if first setup is okay then next step is to add tests.\r\n\r\n![magento-pwa-studio-issue-553-minicart-items-variants-revised](https://user-images.githubusercontent.com/1906257/49363217-57728e80-f6e1-11e8-8063-0ef511ce77ba.png)\r\n\r\n\r\n","created_at":"2018-12-03T08:45:46Z","updated_at":"2018-12-06T19:52:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fd75d2629440e6099f5febca260c65a3721a086","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582/commits","review_comments_url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582/comments","review_comment_url":"https://api.github.com/repos/magento-research/pwa-studio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magento-research/pwa-studio/issues/582/comments","statuses_url":"https://api.github.com/repos/magento-research/pwa-studio/statuses/4e6aecee76132abc10258d11b6cf7f173e7dcfd1","head":{"label":"ennostuurman:feature/553_add-variant-to-minicart-item","ref":"feature/553_add-variant-to-minicart-item","sha":"4e6aecee76132abc10258d11b6cf7f173e7dcfd1","user":{"login":"ennostuurman","id":1906257,"node_id":"MDQ6VXNlcjE5MDYyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1906257?v=4","gravatar_id":"","url":"https://api.github.com/users/ennostuurman","html_url":"https://github.com/ennostuurman","followers_url":"https://api.github.com/users/ennostuurman/followers","following_url":"https://api.github.com/users/ennostuurman/following{/other_user}","gists_url":"https://api.github.com/users/ennostuurman/gists{/gist_id}","starred_url":"https://api.github.com/users/ennostuurman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ennostuurman/subscriptions","organizations_url":"https://api.github.com/users/ennostuurman/orgs","repos_url":"https://api.github.com/users/ennostuurman/repos","events_url":"https://api.github.com/users/ennostuurman/events{/privacy}","received_events_url":"https://api.github.com/users/ennostuurman/received_events","type":"User","site_admin":false},"repo":{"id":158216950,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgyMTY5NTA=","name":"pwa-studio","full_name":"ennostuurman/pwa-studio","private":false,"owner":{"login":"ennostuurman","id":1906257,"node_id":"MDQ6VXNlcjE5MDYyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1906257?v=4","gravatar_id":"","url":"https://api.github.com/users/ennostuurman","html_url":"https://github.com/ennostuurman","followers_url":"https://api.github.com/users/ennostuurman/followers","following_url":"https://api.github.com/users/ennostuurman/following{/other_user}","gists_url":"https://api.github.com/users/ennostuurman/gists{/gist_id}","starred_url":"https://api.github.com/users/ennostuurman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ennostuurman/subscriptions","organizations_url":"https://api.github.com/users/ennostuurman/orgs","repos_url":"https://api.github.com/users/ennostuurman/repos","events_url":"https://api.github.com/users/ennostuurman/events{/privacy}","received_events_url":"https://api.github.com/users/ennostuurman/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ennostuurman/pwa-studio","description":"🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.","fork":true,"url":"https://api.github.com/repos/ennostuurman/pwa-studio","forks_url":"https://api.github.com/repos/ennostuurman/pwa-studio/forks","keys_url":"https://api.github.com/repos/ennostuurman/pwa-studio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ennostuurman/pwa-studio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ennostuurman/pwa-studio/teams","hooks_url":"https://api.github.com/repos/ennostuurman/pwa-studio/hooks","issue_events_url":"https://api.github.com/repos/ennostuurman/pwa-studio/issues/events{/number}","events_url":"https://api.github.com/repos/ennostuurman/pwa-studio/events","assignees_url":"https://api.github.com/repos/ennostuurman/pwa-studio/assignees{/user}","branches_url":"https://api.github.com/repos/ennostuurman/pwa-studio/branches{/branch}","tags_url":"https://api.github.com/repos/ennostuurman/pwa-studio/tags","blobs_url":"https://api.github.com/repos/ennostuurman/pwa-studio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ennostuurman/pwa-studio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ennostuurman/pwa-studio/git/refs{/sha}","trees_url":"https://api.github.com/repos/ennostuurman/pwa-studio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ennostuurman/pwa-studio/statuses/{sha}","languages_url":"https://api.github.com/repos/ennostuurman/pwa-studio/languages","stargazers_url":"https://api.github.com/repos/ennostuurman/pwa-studio/stargazers","contributors_url":"https://api.github.com/repos/ennostuurman/pwa-studio/contributors","subscribers_url":"https://api.github.com/repos/ennostuurman/pwa-studio/subscribers","subscription_url":"https://api.github.com/repos/ennostuurman/pwa-studio/subscription","commits_url":"https://api.github.com/repos/ennostuurman/pwa-studio/commits{/sha}","git_commits_url":"https://api.github.com/repos/ennostuurman/pwa-studio/git/commits{/sha}","comments_url":"https://api.github.com/repos/ennostuurman/pwa-studio/comments{/number}","issue_comment_url":"https://api.github.com/repos/ennostuurman/pwa-studio/issues/comments{/number}","contents_url":"https://api.github.com/repos/ennostuurman/pwa-studio/contents/{+path}","compare_url":"https://api.github.com/repos/ennostuurman/pwa-studio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ennostuurman/pwa-studio/merges","archive_url":"https://api.github.com/repos/ennostuurman/pwa-studio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ennostuurman/pwa-studio/downloads","issues_url":"https://api.github.com/repos/ennostuurman/pwa-studio/issues{/number}","pulls_url":"https://api.github.com/repos/ennostuurman/pwa-studio/pulls{/number}","milestones_url":"https://api.github.com/repos/ennostuurman/pwa-studio/milestones{/number}","notifications_url":"https://api.github.com/repos/ennostuurman/pwa-studio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ennostuurman/pwa-studio/labels{/name}","releases_url":"https://api.github.com/repos/ennostuurman/pwa-studio/releases{/id}","deployments_url":"https://api.github.com/repos/ennostuurman/pwa-studio/deployments","created_at":"2018-11-19T12:14:13Z","updated_at":"2018-12-03T09:19:12Z","pushed_at":"2018-12-05T16:56:38Z","git_url":"git://github.com/ennostuurman/pwa-studio.git","ssh_url":"git@github.com:ennostuurman/pwa-studio.git","clone_url":"https://github.com/ennostuurman/pwa-studio.git","svn_url":"https://github.com/ennostuurman/pwa-studio","homepage":"http://pwastudio.io","size":11196,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"release/2.0"}},"base":{"label":"magento-research:release/2.0","ref":"release/2.0","sha":"fa9c94e9fb11351a52f38688c19ddb06cf36f69e","user":{"login":"magento-research","id":26729824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2NzI5ODI0","avatar_url":"https://avatars0.githubusercontent.com/u/26729824?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-research","html_url":"https://github.com/magento-research","followers_url":"https://api.github.com/users/magento-research/followers","following_url":"https://api.github.com/users/magento-research/following{/other_user}","gists_url":"https://api.github.com/users/magento-research/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-research/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-research/subscriptions","organizations_url":"https://api.github.com/users/magento-research/orgs","repos_url":"https://api.github.com/users/magento-research/repos","events_url":"https://api.github.com/users/magento-research/events{/privacy}","received_events_url":"https://api.github.com/users/magento-research/received_events","type":"Organization","site_admin":false},"repo":{"id":137249745,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNDk3NDU=","name":"pwa-studio","full_name":"magento-research/pwa-studio","private":false,"owner":{"login":"magento-research","id":26729824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2NzI5ODI0","avatar_url":"https://avatars0.githubusercontent.com/u/26729824?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-research","html_url":"https://github.com/magento-research","followers_url":"https://api.github.com/users/magento-research/followers","following_url":"https://api.github.com/users/magento-research/following{/other_user}","gists_url":"https://api.github.com/users/magento-research/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-research/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-research/subscriptions","organizations_url":"https://api.github.com/users/magento-research/orgs","repos_url":"https://api.github.com/users/magento-research/repos","events_url":"https://api.github.com/users/magento-research/events{/privacy}","received_events_url":"https://api.github.com/users/magento-research/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/magento-research/pwa-studio","description":"🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.","fork":false,"url":"https://api.github.com/repos/magento-research/pwa-studio","forks_url":"https://api.github.com/repos/magento-research/pwa-studio/forks","keys_url":"https://api.github.com/repos/magento-research/pwa-studio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magento-research/pwa-studio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magento-research/pwa-studio/teams","hooks_url":"https://api.github.com/repos/magento-research/pwa-studio/hooks","issue_events_url":"https://api.github.com/repos/magento-research/pwa-studio/issues/events{/number}","events_url":"https://api.github.com/repos/magento-research/pwa-studio/events","assignees_url":"https://api.github.com/repos/magento-research/pwa-studio/assignees{/user}","branches_url":"https://api.github.com/repos/magento-research/pwa-studio/branches{/branch}","tags_url":"https://api.github.com/repos/magento-research/pwa-studio/tags","blobs_url":"https://api.github.com/repos/magento-research/pwa-studio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magento-research/pwa-studio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magento-research/pwa-studio/git/refs{/sha}","trees_url":"https://api.github.com/repos/magento-research/pwa-studio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magento-research/pwa-studio/statuses/{sha}","languages_url":"https://api.github.com/repos/magento-research/pwa-studio/languages","stargazers_url":"https://api.github.com/repos/magento-research/pwa-studio/stargazers","contributors_url":"https://api.github.com/repos/magento-research/pwa-studio/contributors","subscribers_url":"https://api.github.com/repos/magento-research/pwa-studio/subscribers","subscription_url":"https://api.github.com/repos/magento-research/pwa-studio/subscription","commits_url":"https://api.github.com/repos/magento-research/pwa-studio/commits{/sha}","git_commits_url":"https://api.github.com/repos/magento-research/pwa-studio/git/commits{/sha}","comments_url":"https://api.github.com/repos/magento-research/pwa-studio/comments{/number}","issue_comment_url":"https://api.github.com/repos/magento-research/pwa-studio/issues/comments{/number}","contents_url":"https://api.github.com/repos/magento-research/pwa-studio/contents/{+path}","compare_url":"https://api.github.com/repos/magento-research/pwa-studio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magento-research/pwa-studio/merges","archive_url":"https://api.github.com/repos/magento-research/pwa-studio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magento-research/pwa-studio/downloads","issues_url":"https://api.github.com/repos/magento-research/pwa-studio/issues{/number}","pulls_url":"https://api.github.com/repos/magento-research/pwa-studio/pulls{/number}","milestones_url":"https://api.github.com/repos/magento-research/pwa-studio/milestones{/number}","notifications_url":"https://api.github.com/repos/magento-research/pwa-studio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magento-research/pwa-studio/labels{/name}","releases_url":"https://api.github.com/repos/magento-research/pwa-studio/releases{/id}","deployments_url":"https://api.github.com/repos/magento-research/pwa-studio/deployments","created_at":"2018-06-13T17:35:05Z","updated_at":"2018-12-06T11:18:20Z","pushed_at":"2018-12-06T16:32:04Z","git_url":"git://github.com/magento-research/pwa-studio.git","ssh_url":"git@github.com:magento-research/pwa-studio.git","clone_url":"https://github.com/magento-research/pwa-studio.git","svn_url":"https://github.com/magento-research/pwa-studio","homepage":"http://pwastudio.io","size":11949,"stargazers_count":188,"watchers_count":188,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"archived":false,"open_issues_count":209,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":85,"open_issues":209,"watchers":188,"default_branch":"release/2.0"}},"_links":{"self":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582"},"html":{"href":"https://github.com/magento-research/pwa-studio/pull/582"},"issue":{"href":"https://api.github.com/repos/magento-research/pwa-studio/issues/582"},"comments":{"href":"https://api.github.com/repos/magento-research/pwa-studio/issues/582/comments"},"review_comments":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582/comments"},"review_comment":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magento-research/pwa-studio/pulls/582/commits"},"statuses":{"href":"https://api.github.com/repos/magento-research/pwa-studio/statuses/4e6aecee76132abc10258d11b6cf7f173e7dcfd1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"supernova-at"}}