{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/157098240","pull_request_review_id":83687392,"id":157098240,"diff_hunk":"@@ -12,26 +12,47 @@ import { flow } from 'lodash';\n  * Internal dependencies\n  */\n import { openPostRevisionsDialog } from 'state/posts/revisions/actions';\n+import { withAnalytics, recordTracksEvent } from 'state/analytics/actions';\n+import EditorRevisionsDialog from 'post-editor/editor-revisions/dialog';\n \n-const HistoryButton = ( { openDialog, translate } ) => (\n-\t<div className=\"editor-ground-control__history\">\n-\t\t<button className=\"editor-ground-control__history-button button is-link\" onClick={ openDialog }>\n-\t\t\t{ translate( 'History' ) }\n-\t\t</button>\n-\t</div>\n-);\n+class HistoryButton extends Component {\n+\trender() {\n+\t\tconst { loadRevision, postId, siteId, translate } = this.props;\n+\t\treturn (\n+\t\t\t<div className=\"editor-ground-control__history\">\n+\t\t\t\t<button\n+\t\t\t\t\tclassName=\"editor-ground-control__history-button button is-link\"\n+\t\t\t\t\tonClick={ this.props.selectHistory }\n+\t\t\t\t>\n+\t\t\t\t\t{ translate( 'History' ) }\n+\t\t\t\t</button>\n+\t\t\t\t<EditorRevisionsDialog loadRevision={ loadRevision } postId={ postId } siteId={ siteId } />\n+\t\t\t</div>\n+\t\t);\n+\t}\n+}\n \n HistoryButton.propTypes = {\n \t// connected to dispatch\n-\topenDialog: PropTypes.func.isRequired,\n+\topenPostRevisionsDialog: PropTypes.func.isRequired,\n+\trecordTracksEvent: PropTypes.func.isRequired,\n \n \t// localize\n \ttranslate: PropTypes.func,\n };\n \n+const selectHistory = () => dispatch => {\n+\tdispatch(\n+\t\twithAnalytics(\n+\t\t\trecordTracksEvent( 'calypso_editor_history_button_click' ),\n+\t\t\topenPostRevisionsDialog()","path":"client/post-editor/editor-ground-control/history-button.jsx","position":54,"original_position":54,"commit_id":"8ebca8996b95c918e05ac6c6aa22073be279472e","original_commit_id":"8ebca8996b95c918e05ac6c6aa22073be279472e","user":{"login":"aaronyan","id":4505888,"avatar_url":"https://avatars2.githubusercontent.com/u/4505888?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronyan","html_url":"https://github.com/aaronyan","followers_url":"https://api.github.com/users/aaronyan/followers","following_url":"https://api.github.com/users/aaronyan/following{/other_user}","gists_url":"https://api.github.com/users/aaronyan/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronyan/subscriptions","organizations_url":"https://api.github.com/users/aaronyan/orgs","repos_url":"https://api.github.com/users/aaronyan/repos","events_url":"https://api.github.com/users/aaronyan/events{/privacy}","received_events_url":"https://api.github.com/users/aaronyan/received_events","type":"User","site_admin":false},"body":"testing it out without the `()` and it doesn't seem to work anymore.","created_at":"2017-12-15T00:25:08Z","updated_at":"2017-12-15T00:25:08Z","html_url":"https://github.com/Automattic/wp-calypso/pull/20797#discussion_r157098240","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/157098240"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/20797#discussion_r157098240"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797"}},"in_reply_to_id":157097587},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797","id":158192279,"html_url":"https://github.com/Automattic/wp-calypso/pull/20797","diff_url":"https://github.com/Automattic/wp-calypso/pull/20797.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/20797.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/20797","number":20797,"state":"open","locked":false,"title":"Ground Control: Add tracks events to all clickable buttons","user":{"login":"aaronyan","id":4505888,"avatar_url":"https://avatars2.githubusercontent.com/u/4505888?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronyan","html_url":"https://github.com/aaronyan","followers_url":"https://api.github.com/users/aaronyan/followers","following_url":"https://api.github.com/users/aaronyan/following{/other_user}","gists_url":"https://api.github.com/users/aaronyan/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronyan/subscriptions","organizations_url":"https://api.github.com/users/aaronyan/orgs","repos_url":"https://api.github.com/users/aaronyan/repos","events_url":"https://api.github.com/users/aaronyan/events{/privacy}","received_events_url":"https://api.github.com/users/aaronyan/received_events","type":"User","site_admin":false},"body":"Adds Tracks events to all buttons that are clickable in the editor's Ground Control.","created_at":"2017-12-13T20:10:59Z","updated_at":"2017-12-15T00:25:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b755e87b2fe5667328b4771adeffbea460815b9c","assignee":{"login":"aaronyan","id":4505888,"avatar_url":"https://avatars2.githubusercontent.com/u/4505888?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronyan","html_url":"https://github.com/aaronyan","followers_url":"https://api.github.com/users/aaronyan/followers","following_url":"https://api.github.com/users/aaronyan/following{/other_user}","gists_url":"https://api.github.com/users/aaronyan/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronyan/subscriptions","organizations_url":"https://api.github.com/users/aaronyan/orgs","repos_url":"https://api.github.com/users/aaronyan/repos","events_url":"https://api.github.com/users/aaronyan/events{/privacy}","received_events_url":"https://api.github.com/users/aaronyan/received_events","type":"User","site_admin":false},"assignees":[{"login":"aaronyan","id":4505888,"avatar_url":"https://avatars2.githubusercontent.com/u/4505888?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronyan","html_url":"https://github.com/aaronyan","followers_url":"https://api.github.com/users/aaronyan/followers","following_url":"https://api.github.com/users/aaronyan/following{/other_user}","gists_url":"https://api.github.com/users/aaronyan/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronyan/subscriptions","organizations_url":"https://api.github.com/users/aaronyan/orgs","repos_url":"https://api.github.com/users/aaronyan/repos","events_url":"https://api.github.com/users/aaronyan/events{/privacy}","received_events_url":"https://api.github.com/users/aaronyan/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797/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/20797/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/8ebca8996b95c918e05ac6c6aa22073be279472e","head":{"label":"Automattic:add/editor/ground-control-tracks","ref":"add/editor/ground-control-tracks","sha":"8ebca8996b95c918e05ac6c6aa22073be279472e","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 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-12-14T21:03:45Z","pushed_at":"2017-12-15T00:02:27Z","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":72923,"stargazers_count":9524,"watchers_count":9524,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1318,"mirror_url":null,"archived":false,"open_issues_count":2271,"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":1318,"open_issues":2271,"watchers":9524,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"e74f0a6c8686fed1bfaebc20901756927e2a1417","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 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-12-14T21:03:45Z","pushed_at":"2017-12-15T00:02:27Z","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":72923,"stargazers_count":9524,"watchers_count":9524,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1318,"mirror_url":null,"archived":false,"open_issues_count":2271,"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":1318,"open_issues":2271,"watchers":9524,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/20797"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/20797"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/20797/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/20797/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/20797/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/8ebca8996b95c918e05ac6c6aa22073be279472e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aaronyan"}}