{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/115306409","pull_request_review_id":36834798,"id":115306409,"diff_hunk":"@@ -0,0 +1,12 @@\n+/**\n+ * Returns a formatted variation name for display based on attributes.\n+ *\n+ * @param {Object} variation Variation object.\n+ * @param {String} fallbackName Fallback name to use if no attributes are passed.\n+ * @return {String} Formatted variation name.\n+ */\n+export default function formattedVariationName( { attributes }, fallbackName = '' ) {\n+\treturn attributes && attributes.map( function( attribute ) {","path":"client/extensions/woocommerce/lib/formatted-variation-name/index.js","position":9,"original_position":9,"commit_id":"58c1dc712e1fedca4edb480d61a8f8cd41c92237","original_commit_id":"58c1dc712e1fedca4edb480d61a8f8cd41c92237","user":{"login":"allendav","id":1595739,"avatar_url":"https://avatars2.githubusercontent.com/u/1595739?v=3","gravatar_id":"","url":"https://api.github.com/users/allendav","html_url":"https://github.com/allendav","followers_url":"https://api.github.com/users/allendav/followers","following_url":"https://api.github.com/users/allendav/following{/other_user}","gists_url":"https://api.github.com/users/allendav/gists{/gist_id}","starred_url":"https://api.github.com/users/allendav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allendav/subscriptions","organizations_url":"https://api.github.com/users/allendav/orgs","repos_url":"https://api.github.com/users/allendav/repos","events_url":"https://api.github.com/users/allendav/events{/privacy}","received_events_url":"https://api.github.com/users/allendav/received_events","type":"User","site_admin":false},"body":"Maybe add an isArray check on attributes just as a precaution?","created_at":"2017-05-08T17:34:28Z","updated_at":"2017-05-08T17:34:28Z","html_url":"https://github.com/Automattic/wp-calypso/pull/13763#discussion_r115306409","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/115306409"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/13763#discussion_r115306409"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763","id":119487687,"html_url":"https://github.com/Automattic/wp-calypso/pull/13763","diff_url":"https://github.com/Automattic/wp-calypso/pull/13763.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/13763.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/13763","number":13763,"state":"open","locked":false,"title":"WooCommerce: Add method for generating a formatted variation name","user":{"login":"justinshreve","id":689165,"avatar_url":"https://avatars1.githubusercontent.com/u/689165?v=3","gravatar_id":"","url":"https://api.github.com/users/justinshreve","html_url":"https://github.com/justinshreve","followers_url":"https://api.github.com/users/justinshreve/followers","following_url":"https://api.github.com/users/justinshreve/following{/other_user}","gists_url":"https://api.github.com/users/justinshreve/gists{/gist_id}","starred_url":"https://api.github.com/users/justinshreve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinshreve/subscriptions","organizations_url":"https://api.github.com/users/justinshreve/orgs","repos_url":"https://api.github.com/users/justinshreve/repos","events_url":"https://api.github.com/users/justinshreve/events{/privacy}","received_events_url":"https://api.github.com/users/justinshreve/received_events","type":"User","site_admin":false},"body":"This PR adds a method/helper lib for generating a display ready formatted name for variations.\r\n\r\nVariations do not contain a proper name field. In other interfaces, these are built using the attribute options, just like in this PR. We need a method for this to reuse in various parts of our interface.\r\n\r\nTo Test:\r\n* Run `make test` and make sure all tests pass.","created_at":"2017-05-08T16:42:53Z","updated_at":"2017-05-08T17:34:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4459a39aa3234a78e81d984cacceb9b8ca792e9c","assignee":{"login":"justinshreve","id":689165,"avatar_url":"https://avatars1.githubusercontent.com/u/689165?v=3","gravatar_id":"","url":"https://api.github.com/users/justinshreve","html_url":"https://github.com/justinshreve","followers_url":"https://api.github.com/users/justinshreve/followers","following_url":"https://api.github.com/users/justinshreve/following{/other_user}","gists_url":"https://api.github.com/users/justinshreve/gists{/gist_id}","starred_url":"https://api.github.com/users/justinshreve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinshreve/subscriptions","organizations_url":"https://api.github.com/users/justinshreve/orgs","repos_url":"https://api.github.com/users/justinshreve/repos","events_url":"https://api.github.com/users/justinshreve/events{/privacy}","received_events_url":"https://api.github.com/users/justinshreve/received_events","type":"User","site_admin":false},"assignees":[{"login":"justinshreve","id":689165,"avatar_url":"https://avatars1.githubusercontent.com/u/689165?v=3","gravatar_id":"","url":"https://api.github.com/users/justinshreve","html_url":"https://github.com/justinshreve","followers_url":"https://api.github.com/users/justinshreve/followers","following_url":"https://api.github.com/users/justinshreve/following{/other_user}","gists_url":"https://api.github.com/users/justinshreve/gists{/gist_id}","starred_url":"https://api.github.com/users/justinshreve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinshreve/subscriptions","organizations_url":"https://api.github.com/users/justinshreve/orgs","repos_url":"https://api.github.com/users/justinshreve/repos","events_url":"https://api.github.com/users/justinshreve/events{/privacy}","received_events_url":"https://api.github.com/users/justinshreve/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/178","html_url":"https://github.com/Automattic/wp-calypso/milestone/178","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/178/labels","id":2503639,"number":178,"title":"WooCommerce: Sprint 8","description":"","creator":{"login":"coderkevin","id":945228,"avatar_url":"https://avatars1.githubusercontent.com/u/945228?v=3","gravatar_id":"","url":"https://api.github.com/users/coderkevin","html_url":"https://github.com/coderkevin","followers_url":"https://api.github.com/users/coderkevin/followers","following_url":"https://api.github.com/users/coderkevin/following{/other_user}","gists_url":"https://api.github.com/users/coderkevin/gists{/gist_id}","starred_url":"https://api.github.com/users/coderkevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderkevin/subscriptions","organizations_url":"https://api.github.com/users/coderkevin/orgs","repos_url":"https://api.github.com/users/coderkevin/repos","events_url":"https://api.github.com/users/coderkevin/events{/privacy}","received_events_url":"https://api.github.com/users/coderkevin/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2017-05-05T23:51:51Z","updated_at":"2017-05-08T16:42:53Z","due_on":"2017-05-12T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/13763/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/58c1dc712e1fedca4edb480d61a8f8cd41c92237","head":{"label":"Automattic:add/woocommerce-formatted-variation-name-lib","ref":"add/woocommerce-formatted-variation-name-lib","sha":"58c1dc712e1fedca4edb480d61a8f8cd41c92237","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-05-08T16:15:44Z","pushed_at":"2017-05-08T17:31:45Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":62615,"stargazers_count":8721,"watchers_count":8721,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1126,"mirror_url":null,"open_issues_count":1976,"forks":1126,"open_issues":1976,"watchers":8721,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"75be4cce0151e96ed50835d1ddc4022b7291c5f6","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-05-08T16:15:44Z","pushed_at":"2017-05-08T17:31:45Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":62615,"stargazers_count":8721,"watchers_count":8721,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1126,"mirror_url":null,"open_issues_count":1976,"forks":1126,"open_issues":1976,"watchers":8721,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/13763"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/13763"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/13763/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13763/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/58c1dc712e1fedca4edb480d61a8f8cd41c92237"}}}}
{"actor":{"display_login":"allendav"}}