{"action":"closed","number":23036,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23036","id":173155848,"html_url":"https://github.com/Automattic/wp-calypso/pull/23036","diff_url":"https://github.com/Automattic/wp-calypso/pull/23036.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/23036.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23036","number":23036,"state":"closed","locked":false,"title":"Jetpack Settings: Replace Analytics activation notice with a module toggle","user":{"login":"tyxla","id":8436925,"avatar_url":"https://avatars2.githubusercontent.com/u/8436925?v=4","gravatar_id":"","url":"https://api.github.com/users/tyxla","html_url":"https://github.com/tyxla","followers_url":"https://api.github.com/users/tyxla/followers","following_url":"https://api.github.com/users/tyxla/following{/other_user}","gists_url":"https://api.github.com/users/tyxla/gists{/gist_id}","starred_url":"https://api.github.com/users/tyxla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyxla/subscriptions","organizations_url":"https://api.github.com/users/tyxla/orgs","repos_url":"https://api.github.com/users/tyxla/repos","events_url":"https://api.github.com/users/tyxla/events{/privacy}","received_events_url":"https://api.github.com/users/tyxla/received_events","type":"User","site_admin":false},"body":"Currently, when the Google Analytics module is disabled for a Jetpack site, we display the following notice:\r\n\r\n![](https://cldup.com/08H8q4UNcU.png)\r\n\r\nThis is inconsistent with the rest of the settings, where we display a Jetpack module toggle. This PR removes the notice and introduces a toggle that allows the user to activate and deactivate the Google Analytics module:\r\n\r\n![](https://cldup.com/-lAVrrfk4L.png)\r\n\r\nAnd when the module is active, form fields become enabled:\r\n\r\n![](https://cldup.com/MkND1EEUA8.png)\r\n\r\nFixes #22214.\r\n\r\nTo test:\r\n* Checkout this branch.\r\n* Select a Jetpack site that has either Premium or Professional plan.\r\n* Disable Google Analytics for your Jetpack site - you can do it by calling the following CLI command on your console: `wp jetpack module deactivate google-analytics`\r\n* Go to `http://calypso.localhost:3000/settings/traffic/:site`, where `:site` is your Jetpack site.\r\n* Scroll down to the \"Google Analytics\" card.\r\n* Verify you can see the new module toggle.\r\n* Click the toggle, verify it activates the module properly (you can check the module status by calling the following CLI command on your console: `wp jetpack module list | grep \"google-analytics\"`.\r\n* Click the toggle again, verify it deactivates the module properly.\r\n* Verify that every activation and deactivation respectively enables and disables the form fields of the \"Google Analytics\" card.\r\n* Verify the module toggle doesn't appear for a .com site with a Premium or a Business plan.","created_at":"2018-03-06T13:20:57Z","updated_at":"2018-03-12T11:22:16Z","closed_at":"2018-03-12T11:22:16Z","merged_at":"2018-03-12T11:22:16Z","merge_commit_sha":"12446c04eff9e1df3992055b71af676ef23552dd","assignee":{"login":"tyxla","id":8436925,"avatar_url":"https://avatars2.githubusercontent.com/u/8436925?v=4","gravatar_id":"","url":"https://api.github.com/users/tyxla","html_url":"https://github.com/tyxla","followers_url":"https://api.github.com/users/tyxla/followers","following_url":"https://api.github.com/users/tyxla/following{/other_user}","gists_url":"https://api.github.com/users/tyxla/gists{/gist_id}","starred_url":"https://api.github.com/users/tyxla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyxla/subscriptions","organizations_url":"https://api.github.com/users/tyxla/orgs","repos_url":"https://api.github.com/users/tyxla/repos","events_url":"https://api.github.com/users/tyxla/events{/privacy}","received_events_url":"https://api.github.com/users/tyxla/received_events","type":"User","site_admin":false},"assignees":[{"login":"tyxla","id":8436925,"avatar_url":"https://avatars2.githubusercontent.com/u/8436925?v=4","gravatar_id":"","url":"https://api.github.com/users/tyxla","html_url":"https://github.com/tyxla","followers_url":"https://api.github.com/users/tyxla/followers","following_url":"https://api.github.com/users/tyxla/following{/other_user}","gists_url":"https://api.github.com/users/tyxla/gists{/gist_id}","starred_url":"https://api.github.com/users/tyxla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyxla/subscriptions","organizations_url":"https://api.github.com/users/tyxla/orgs","repos_url":"https://api.github.com/users/tyxla/repos","events_url":"https://api.github.com/users/tyxla/events{/privacy}","received_events_url":"https://api.github.com/users/tyxla/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[{"name":"Luna","id":2318557,"slug":"luna","description":"Integrating and improving Jetpack & .Org Premium and related products.","privacy":"closed","url":"https://api.github.com/teams/2318557","members_url":"https://api.github.com/teams/2318557/members{/member}","repositories_url":"https://api.github.com/teams/2318557/repos","permission":"pull"},{"name":"Jetpack Design","id":2653833,"slug":"jetpack-design","description":"","privacy":"closed","url":"https://api.github.com/teams/2653833","members_url":"https://api.github.com/teams/2653833/members{/member}","repositories_url":"https://api.github.com/teams/2653833/repos","permission":"pull"}],"labels":[{"id":824137020,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/FixTheFlows","name":"FixTheFlows","color":"00be28","default":false},{"id":285009991,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Jetpack","name":"Jetpack","color":"006b75","default":false},{"id":285009981,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Site%20Settings","name":"Site Settings","color":"006b75","default":false},{"id":285010030,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Ready%20to%20Merge","name":"[Status] Ready to Merge","color":"d4fb79","default":false},{"id":285009976,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c7def8","default":false}],"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/188","html_url":"https://github.com/Automattic/wp-calypso/milestone/188","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/188/labels","id":2565399,"number":188,"title":"Jetpack Settings v2","description":"Once we reach a state of parity with the Jetpack plugin's wp-admin settings interface we can then do a pass to improve the experience including settings for the new rewind feature, improvements to ads, and moving the sharing section into settings.","creator":{"login":"rickybanister","id":437258,"avatar_url":"https://avatars2.githubusercontent.com/u/437258?v=4","gravatar_id":"","url":"https://api.github.com/users/rickybanister","html_url":"https://github.com/rickybanister","followers_url":"https://api.github.com/users/rickybanister/followers","following_url":"https://api.github.com/users/rickybanister/following{/other_user}","gists_url":"https://api.github.com/users/rickybanister/gists{/gist_id}","starred_url":"https://api.github.com/users/rickybanister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickybanister/subscriptions","organizations_url":"https://api.github.com/users/rickybanister/orgs","repos_url":"https://api.github.com/users/rickybanister/repos","events_url":"https://api.github.com/users/rickybanister/events{/privacy}","received_events_url":"https://api.github.com/users/rickybanister/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":6,"state":"open","created_at":"2017-06-06T15:46:43Z","updated_at":"2018-03-12T11:22:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23036/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23036/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/23036/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e724699197a84c2817433fcd741068baffe48e7a","head":{"label":"Automattic:update/settings-analytics-notice-to-module-toggle","ref":"update/settings-analytics-notice-to-module-toggle","sha":"e724699197a84c2817433fcd741068baffe48e7a","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-03-12T05:52:12Z","pushed_at":"2018-03-12T11:22:15Z","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":80002,"stargazers_count":9794,"watchers_count":9794,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1369,"mirror_url":null,"archived":false,"open_issues_count":1507,"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":1369,"open_issues":1507,"watchers":9794,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"e1b387ff4c675382c94a46e1f185e2f3f393da55","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-03-12T05:52:12Z","pushed_at":"2018-03-12T11:22:15Z","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":80002,"stargazers_count":9794,"watchers_count":9794,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1369,"mirror_url":null,"archived":false,"open_issues_count":1507,"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":1369,"open_issues":1507,"watchers":9794,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23036"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23036"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23036"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23036/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23036/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/23036/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e724699197a84c2817433fcd741068baffe48e7a"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"tyxla","id":8436925,"avatar_url":"https://avatars2.githubusercontent.com/u/8436925?v=4","gravatar_id":"","url":"https://api.github.com/users/tyxla","html_url":"https://github.com/tyxla","followers_url":"https://api.github.com/users/tyxla/followers","following_url":"https://api.github.com/users/tyxla/following{/other_user}","gists_url":"https://api.github.com/users/tyxla/gists{/gist_id}","starred_url":"https://api.github.com/users/tyxla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyxla/subscriptions","organizations_url":"https://api.github.com/users/tyxla/orgs","repos_url":"https://api.github.com/users/tyxla/repos","events_url":"https://api.github.com/users/tyxla/events{/privacy}","received_events_url":"https://api.github.com/users/tyxla/received_events","type":"User","site_admin":false},"comments":5,"review_comments":2,"maintainer_can_modify":false,"commits":3,"additions":15,"deletions":27,"changed_files":1}}
{"actor":{"display_login":"tyxla"}}