{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/184042529","pull_request_review_id":115156083,"id":184042529,"diff_hunk":"@@ -125,10 +125,35 @@ class GoogleMyBusinessStatsChart extends Component {\n \t\t\tevent.target.value\n \t\t);\n \n-\trender() {\n-\t\tconst { chartTitle, chartType, description, interval, title } = this.props;\n+\trenderChart() {\n+\t\tconst { chartTitle, chartType } = this.props;\n \t\tconst { transformedData } = this.state;\n \n+\t\tif ( ! transformedData ) {\n+\t\t\treturn null;\n+\t\t}\n+\n+\t\tif ( chartType === 'pie' ) {\n+\t\t\treturn (\n+\t\t\t\t<div>","path":"client/my-sites/google-my-business/stats/chart.js","position":16,"original_position":16,"commit_id":"efc3f8e0cc6fa9ab959e60dbe39e2b9faa54afd5","original_commit_id":"efc3f8e0cc6fa9ab959e60dbe39e2b9faa54afd5","user":{"login":"yurynix","id":326402,"avatar_url":"https://avatars2.githubusercontent.com/u/326402?v=4","gravatar_id":"","url":"https://api.github.com/users/yurynix","html_url":"https://github.com/yurynix","followers_url":"https://api.github.com/users/yurynix/followers","following_url":"https://api.github.com/users/yurynix/following{/other_user}","gists_url":"https://api.github.com/users/yurynix/gists{/gist_id}","starred_url":"https://api.github.com/users/yurynix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurynix/subscriptions","organizations_url":"https://api.github.com/users/yurynix/orgs","repos_url":"https://api.github.com/users/yurynix/repos","events_url":"https://api.github.com/users/yurynix/events{/privacy}","received_events_url":"https://api.github.com/users/yurynix/received_events","type":"User","site_admin":false},"body":"Can return fragment here =)\r\nhttps://github.com/Automattic/wp-calypso/pull/24236/commits/d7b533e2c9420bbe644b1e8d5d9790a8633ad90c","created_at":"2018-04-25T12:39:46Z","updated_at":"2018-04-25T12:39:46Z","html_url":"https://github.com/Automattic/wp-calypso/pull/23741#discussion_r184042529","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/184042529"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23741#discussion_r184042529"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741","id":178103157,"html_url":"https://github.com/Automattic/wp-calypso/pull/23741","diff_url":"https://github.com/Automattic/wp-calypso/pull/23741.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/23741.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23741","number":23741,"state":"open","locked":false,"title":"Connect to Google My Business on Select Business Type page","user":{"login":"Tug","id":230230,"avatar_url":"https://avatars0.githubusercontent.com/u/230230?v=4","gravatar_id":"","url":"https://api.github.com/users/Tug","html_url":"https://github.com/Tug","followers_url":"https://api.github.com/users/Tug/followers","following_url":"https://api.github.com/users/Tug/following{/other_user}","gists_url":"https://api.github.com/users/Tug/gists{/gist_id}","starred_url":"https://api.github.com/users/Tug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tug/subscriptions","organizations_url":"https://api.github.com/users/Tug/orgs","repos_url":"https://api.github.com/users/Tug/repos","events_url":"https://api.github.com/users/Tug/events{/privacy}","received_events_url":"https://api.github.com/users/Tug/received_events","type":"User","site_admin":false},"body":"This PR:\r\n- updates the \"Select Business Type\" page to connect to the Google My Business service and redirect to \"Select Location\" or \"Create Listing\" depending if the list of locations is empty or not.\r\n- updates the \"Select Location\" page to use real GMB locations data\r\n- updates the \"Stats\" page to use real GMB locations data\r\n- updates various GMB related component to make use of this data\r\n- refactors the GMB selectors to make the difference between `availableExternalAccounts` and `siteUserConnections` more obvious (the former is the list of accounts we can connect to, and has a specific format (see [`getAvailableExternalAccounts`](https://github.com/Automattic/wp-calypso/blob/master/client/state/sharing/selectors.js#L25)), the latter is a list of valid connections a site is already connected to, which has all the required keyring connection properties).\r\n- Adds a new component called `KeyringConnectButton` that simply connects the user to any available keyring service, it doesn't do any processing with the keyring connection once available.\r\n\r\n### Testing Instructions\r\nApply code-D12183\r\n\r\n- Apply this patch and go to Stats for a site eligible for GMB\r\n- Click on the `Start Now` button in the nudge\r\n- Depending on your current state you should be redirected to the appropriate page:\r\n    - If you are already connected to google my business it should redirect you to the Select Location page if you have available locations otherwise the the Create Location page\r\n    - If you are already connected to google my business AND have already picked a location it should redirect you to the Stats page\r\n    - If you are not connected to google my business it should redirect you to the Select Business Type page\r\n- Try different flows the user could take\r\n- Try loading each page directly from the url:\r\n    - `/google-my-business`, `/google-my-business/new`, `/google-my-business/select-location` and `/google-my-business/stats` should display the site picker before redirecting to the requested page.\r\n    - `/google-my-business/:site` should have the same behavior as clicking on `Start Now` on the nudge.\r\n    - `/google-my-business/select-business-type/:site` \r\n    - `/google-my-business/new/:site`\r\n    - `/google-my-business/select-location/:site`\r\n`    - /google-my-business/stats/:site`\r\n- Return to `/google-my-business/select-business-type/:site` once connected and check that the `Create My Listing` button is still there and that clicking on it just redirects you to Stats without opening the Oauth2 popup.\r\n- Check that Select Location and Stats display the right data from GMB.\r\n- Test that nothing is broken when the `google-my-business` feature flag is disabled\r\n\r\n### Reviews\r\n- [ ] Code\r\n- [ ] Product","created_at":"2018-03-28T17:02:47Z","updated_at":"2018-04-25T12:39:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f7f9d96b2c3747bd45b1651225df2979577c79f","assignee":{"login":"Tug","id":230230,"avatar_url":"https://avatars0.githubusercontent.com/u/230230?v=4","gravatar_id":"","url":"https://api.github.com/users/Tug","html_url":"https://github.com/Tug","followers_url":"https://api.github.com/users/Tug/followers","following_url":"https://api.github.com/users/Tug/following{/other_user}","gists_url":"https://api.github.com/users/Tug/gists{/gist_id}","starred_url":"https://api.github.com/users/Tug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tug/subscriptions","organizations_url":"https://api.github.com/users/Tug/orgs","repos_url":"https://api.github.com/users/Tug/repos","events_url":"https://api.github.com/users/Tug/events{/privacy}","received_events_url":"https://api.github.com/users/Tug/received_events","type":"User","site_admin":false},"assignees":[{"login":"Tug","id":230230,"avatar_url":"https://avatars0.githubusercontent.com/u/230230?v=4","gravatar_id":"","url":"https://api.github.com/users/Tug","html_url":"https://github.com/Tug","followers_url":"https://api.github.com/users/Tug/followers","following_url":"https://api.github.com/users/Tug/following{/other_user}","gists_url":"https://api.github.com/users/Tug/gists{/gist_id}","starred_url":"https://api.github.com/users/Tug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tug/subscriptions","organizations_url":"https://api.github.com/users/Tug/orgs","repos_url":"https://api.github.com/users/Tug/repos","events_url":"https://api.github.com/users/Tug/events{/privacy}","received_events_url":"https://api.github.com/users/Tug/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":828838139,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Google%20My%20Business","name":"Google My Business","color":"1d76db","default":false},{"id":285010019,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Author%20Reply","name":"[Status] Needs Author Reply","color":"eb6420","default":false}],"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/236","html_url":"https://github.com/Automattic/wp-calypso/milestone/236","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/236/labels","id":3193179,"number":236,"title":"Google My Business: M2","description":"","creator":{"login":"stephanethomas","id":594356,"avatar_url":"https://avatars0.githubusercontent.com/u/594356?v=4","gravatar_id":"","url":"https://api.github.com/users/stephanethomas","html_url":"https://github.com/stephanethomas","followers_url":"https://api.github.com/users/stephanethomas/followers","following_url":"https://api.github.com/users/stephanethomas/following{/other_user}","gists_url":"https://api.github.com/users/stephanethomas/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanethomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanethomas/subscriptions","organizations_url":"https://api.github.com/users/stephanethomas/orgs","repos_url":"https://api.github.com/users/stephanethomas/repos","events_url":"https://api.github.com/users/stephanethomas/events{/privacy}","received_events_url":"https://api.github.com/users/stephanethomas/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":17,"state":"open","created_at":"2018-03-16T12:35:43Z","updated_at":"2018-04-24T18:26:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741/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/23741/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/efc3f8e0cc6fa9ab959e60dbe39e2b9faa54afd5","head":{"label":"Automattic:add/gmb-connect-3","ref":"add/gmb-connect-3","sha":"efc3f8e0cc6fa9ab959e60dbe39e2b9faa54afd5","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","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://avatars1.githubusercontent.com/u/887802?v=4","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 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":"2018-04-25T12:32:37Z","pushed_at":"2018-04-25T12:35:05Z","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":87625,"stargazers_count":9904,"watchers_count":9904,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1397,"mirror_url":null,"archived":false,"open_issues_count":1518,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1397,"open_issues":1518,"watchers":9904,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"2641351e6f3a51b08f32e816eec6b4923efb3223","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","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://avatars1.githubusercontent.com/u/887802?v=4","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 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":"2018-04-25T12:32:37Z","pushed_at":"2018-04-25T12:35:05Z","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":87625,"stargazers_count":9904,"watchers_count":9904,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1397,"mirror_url":null,"archived":false,"open_issues_count":1518,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1397,"open_issues":1518,"watchers":9904,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23741"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23741"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23741/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23741/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/23741/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/efc3f8e0cc6fa9ab959e60dbe39e2b9faa54afd5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yurynix"}}