{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/28413","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/28413/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/28413/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/28413/events","html_url":"https://github.com/Automattic/wp-calypso/pull/28413","id":379020581,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NTg2NTI0","number":28413,"title":"Gutenberg: Add Switch to Classic Editor button in Help popover","user":{"login":"danielwrobert","id":481776,"node_id":"MDQ6VXNlcjQ4MTc3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/481776?v=4","gravatar_id":"","url":"https://api.github.com/users/danielwrobert","html_url":"https://github.com/danielwrobert","followers_url":"https://api.github.com/users/danielwrobert/followers","following_url":"https://api.github.com/users/danielwrobert/following{/other_user}","gists_url":"https://api.github.com/users/danielwrobert/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwrobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwrobert/subscriptions","organizations_url":"https://api.github.com/users/danielwrobert/orgs","repos_url":"https://api.github.com/users/danielwrobert/repos","events_url":"https://api.github.com/users/danielwrobert/events{/privacy}","received_events_url":"https://api.github.com/users/danielwrobert/received_events","type":"User","site_admin":false},"labels":[{"id":967391996,"node_id":"MDU6TGFiZWw5NjczOTE5OTY=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Goal]%20Gutenberg","name":"[Goal] Gutenberg","color":"97f4d2","default":false},{"id":285010017,"node_id":"MDU6TGFiZWwyODUwMTAwMTc=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20In%20Progress","name":"[Status] In Progress","color":"207de5","default":false}],"state":"open","locked":false,"assignee":{"login":"danielwrobert","id":481776,"node_id":"MDQ6VXNlcjQ4MTc3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/481776?v=4","gravatar_id":"","url":"https://api.github.com/users/danielwrobert","html_url":"https://github.com/danielwrobert","followers_url":"https://api.github.com/users/danielwrobert/followers","following_url":"https://api.github.com/users/danielwrobert/following{/other_user}","gists_url":"https://api.github.com/users/danielwrobert/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwrobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwrobert/subscriptions","organizations_url":"https://api.github.com/users/danielwrobert/orgs","repos_url":"https://api.github.com/users/danielwrobert/repos","events_url":"https://api.github.com/users/danielwrobert/events{/privacy}","received_events_url":"https://api.github.com/users/danielwrobert/received_events","type":"User","site_admin":false},"assignees":[{"login":"danielwrobert","id":481776,"node_id":"MDQ6VXNlcjQ4MTc3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/481776?v=4","gravatar_id":"","url":"https://api.github.com/users/danielwrobert","html_url":"https://github.com/danielwrobert","followers_url":"https://api.github.com/users/danielwrobert/followers","following_url":"https://api.github.com/users/danielwrobert/following{/other_user}","gists_url":"https://api.github.com/users/danielwrobert/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwrobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwrobert/subscriptions","organizations_url":"https://api.github.com/users/danielwrobert/orgs","repos_url":"https://api.github.com/users/danielwrobert/repos","events_url":"https://api.github.com/users/danielwrobert/events{/privacy}","received_events_url":"https://api.github.com/users/danielwrobert/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-11-09T04:39:54Z","updated_at":"2018-11-21T15:13:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/28413","html_url":"https://github.com/Automattic/wp-calypso/pull/28413","diff_url":"https://github.com/Automattic/wp-calypso/pull/28413.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/28413.patch"},"body":"#### Changes proposed in this Pull Request\r\n\r\n* Uses `getSelectedEditor` selector to check for current editor type\r\n* If Gutenberg is current editor type, sets editor type to Classic, by dispatching `setSelectedEditor`\r\n* Redirects to non-Gutenberg editor route\r\n* Adds relevant`PropTypes` and `mapDispatchToProps`\r\n\r\n#### Testing instructions\r\n\r\n<!--\r\nAdd as many details as possible to help others reproduce the issue and test the fix.\r\n\"Before / After\" screenshots can also be very helpful when the change is visual.\r\n-->\r\n\r\n* Visit the editor (`/post/{ site }`) for a site that has not previously opted-in to Gutenberg.\r\n* Click on Help popover and note that no \"Switch to Classic Editor\" button is displayed and the prompts to try Gutenberg are rendered.\r\n* Opt-in to Gutenberg by:\r\n  * Opening a Calypso Classic editor, click on the \"Try our new editor and level-up your layout.\" message in the sidebar, and \"Try the new editor\".\r\n  * Or... dispatch( { type: 'EDITOR_TYPE_SET', siteId: 12345678, editor: 'gutenberg' } ).\r\n* Visit the Gutenberg editor for that post in Calypso (_not_ Calypsoify) - `/gutenberg/post/{ site }`\r\n* Open Help popover again and note that the \"Switch to Classic Editor\" button is now visible\r\n* Click on the \"Switch to Classic Editor\" button.\r\n* You should be redirected to the non-Gutenberg post editor view - `/post/{ site }`.\r\n* The next time you visit that editor route (`/post/{ site }`), you should not be redirected to Calypsoify and the prompts to try Gutenberg will be visible, once again.\r\n\r\nFixes #26595\r\n\r\n#### Additional Notes:\r\n\r\n- Because we are currently redirecting to Calypsoify for opted-in sites, the Help popover in Calypso is not available so this change will not be visible in a typical UX flow. You will need to explicitly go to the `/gutenberg/` route in Calypso.\r\n- I suspect the route name may change in the future to something other than `/gutenberg/`, in which case we would need to adjust where I sliced out `gutenberg` from the current route string, accordingly.\r\n- Prettier seems to have made additional formatting adjustments to the stylesheet. Only relevant change from this PR is `client/blocks/inline-help/style.scss`, lines 42-45 ([#](https://github.com/Automattic/wp-calypso/compare/add/classic-editor-toggle-button?expand=1#diff-18ffa1ccda505bf5e5860f19f4bbf091R42))."},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/440699626","html_url":"https://github.com/Automattic/wp-calypso/pull/28413#issuecomment-440699626","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/28413","id":440699626,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDY5OTYyNg==","user":{"login":"Copons","id":2070010,"node_id":"MDQ6VXNlcjIwNzAwMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2070010?v=4","gravatar_id":"","url":"https://api.github.com/users/Copons","html_url":"https://github.com/Copons","followers_url":"https://api.github.com/users/Copons/followers","following_url":"https://api.github.com/users/Copons/following{/other_user}","gists_url":"https://api.github.com/users/Copons/gists{/gist_id}","starred_url":"https://api.github.com/users/Copons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copons/subscriptions","organizations_url":"https://api.github.com/users/Copons/orgs","repos_url":"https://api.github.com/users/Copons/repos","events_url":"https://api.github.com/users/Copons/events{/privacy}","received_events_url":"https://api.github.com/users/Copons/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T15:13:14Z","updated_at":"2018-11-21T15:13:14Z","author_association":"CONTRIBUTOR","body":"Code LGTM; test LGTM!\r\n\r\nBefore giving you the green light, I'd like to loop in @kwight, who worked on it recently, for a last look at the analytics part, because I'm totally lost there."}}
{"actor":{"display_login":"Copons"}}