{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/74403141","id":74403141,"diff_hunk":"@@ -0,0 +1,82 @@\n+/**\n+ * External dependencies\n+ */\n+import React, { Component, PropTypes } from 'react';\n+import { localize } from 'i18n-calypso';\n+import page from 'page';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import Accordion from 'components/accordion';\n+import AccordionSection from 'components/accordion/section';\n+import Button from 'components/button';\n+import Gridicon from 'components/gridicon';\n+import PostSelector from 'my-sites/post-selector';\n+\n+class EditorDrawerCopyPost extends Component {\n+\n+\tstatic propTypes = {\n+\t\tsite: PropTypes.object.isRequired,\n+\t\tpost: PropTypes.object.isRequired,\n+\t\ttranslate: PropTypes.func,\n+\t};\n+\n+\tconstructor() {\n+\t\tsuper( ...arguments );\n+\t\tthis.state = {\n+\t\t\tselectedPostID: '',\n+\t\t};\n+\t}\n+\n+\tsetPostToCopy = post => {\n+\t\tthis.setState( {\n+\t\t\tselectedPostID: post.ID,\n+\t\t} );\n+\t}\n+\n+\tgoToNewDraft = () => {\n+\t\tif ( '' !== this.state.selectedPostID ) {\n+\t\t\tpage.redirect( `/post/${ this.props.site.slug }/${ this.state.selectedPostID }?copy=true` );","path":"client/post-editor/editor-drawer/copy-post.jsx","position":40,"original_position":40,"commit_id":"1becdef2a8a2d7cf83061e71149616d165119adc","original_commit_id":"1becdef2a8a2d7cf83061e71149616d165119adc","user":{"login":"Copons","id":2070010,"avatar_url":"https://avatars.githubusercontent.com/u/2070010?v=3","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},"body":"Oh, great! I didn't notice `page.replace()` in page.js docs. I should have checked the actual code instead.\r\n\r\nAs for the variable name: my bad, uppercase ID is the convention we use at work, and it totally slipped here.","created_at":"2016-08-11T11:04:17Z","updated_at":"2016-08-11T11:04:17Z","html_url":"https://github.com/Automattic/wp-calypso/pull/7320#discussion_r74403141","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/74403141"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/7320#discussion_r74403141"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320","id":80434398,"html_url":"https://github.com/Automattic/wp-calypso/pull/7320","diff_url":"https://github.com/Automattic/wp-calypso/pull/7320.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/7320.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7320","number":7320,"state":"open","locked":false,"title":"Post Editor: add new Copy Post functionality","user":{"login":"Copons","id":2070010,"avatar_url":"https://avatars.githubusercontent.com/u/2070010?v=3","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},"body":"The Copy Post functionality will allow users to choose an existing post and use it as a template for a new one.\r\nTitle, content, taxonomies, custom fields and everything else will be copied into the draft, ready to be modified as needed.\r\n\r\nMy initial approach is to add a new accordion in the editor drawer, containing a searcheable list of all posts. Through it, users can find an existing post, select it and use it as a template for the current draft.\n\nTest live: https://calypso.live/?branch=add/copy-post","created_at":"2016-08-08T11:20:27Z","updated_at":"2016-08-11T11:04:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c4d6027761d04fc8e149e76ec69a3e6e301a3f4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320/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/7320/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/1becdef2a8a2d7cf83061e71149616d165119adc","head":{"label":"Automattic:add/copy-post","ref":"add/copy-post","sha":"1becdef2a8a2d7cf83061e71149616d165119adc","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.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://avatars.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":"2016-08-11T09:24:25Z","pushed_at":"2016-08-11T09:51:07Z","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":84301,"stargazers_count":7685,"watchers_count":7685,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":968,"mirror_url":null,"open_issues_count":1435,"forks":968,"open_issues":1435,"watchers":7685,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"1f9961ece95409f5606185b918d52078fcb3acd6","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.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://avatars.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":"2016-08-11T09:24:25Z","pushed_at":"2016-08-11T09:51:07Z","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":84301,"stargazers_count":7685,"watchers_count":7685,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":968,"mirror_url":null,"open_issues_count":1435,"forks":968,"open_issues":1435,"watchers":7685,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/7320"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/7320"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/7320/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7320/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/7320/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/1becdef2a8a2d7cf83061e71149616d165119adc"}}}}
{"actor":{"display_login":"Copons"}}