{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/58741632","id":58741632,"diff_hunk":"@@ -0,0 +1,66 @@\n+/**\n+ * External dependencies\n+ */\n+import React, { PropTypes } from 'react';\n+import { connect } from 'react-redux';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import localize from 'lib/mixins/i18n/localize';\n+import { getPostType } from 'state/post-types/selectors';\n+import { getSelectedSiteId } from 'state/ui/selectors';\n+import { getEditorPath } from 'state/ui/editor/selectors';\n+import QueryPostTypes from 'components/data/query-post-types';\n+import EmptyContent from 'components/empty-content/empty-content';\n+\n+function PostTypeListEmptyContent( { siteId, translate, status, typeObject, editPath } ) {\n+\tlet title, action;\n+\n+\tif ( 'draft' === status ) {\n+\t\ttitle = translate( 'You don\\'t have any drafts.' );\n+\t} else if ( typeObject ) {\n+\t\ttitle = translate( 'You don\\'t have any %s.', {\n+\t\t\targs: [ typeObject.label.toLocaleLowerCase() ]\n+\t\t} );\n+\t}\n+\n+\tif ( typeObject ) {\n+\t\taction = translate( 'Start a %s', {\n+\t\t\targs: [ typeObject.labels.singular_name ]\n+\t\t} );\n+\t}\n+\n+\treturn (\n+\t\t<div>\n+\t\t\t{ siteId && (\n+\t\t\t\t<QueryPostTypes siteId={ siteId } />\n+\t\t\t) }\n+\t\t\t<EmptyContent\n+\t\t\t\ttitle={ title }\n+\t\t\t\tline={ translate( 'Would you like to create one?' ) }\n+\t\t\t\taction={ action }\n+\t\t\t\tactionURL={ editPath }\n+\t\t\t\tillustration=\"/calypso/images/pages/illustration-pages.svg\"\n+\t\t\t\tillustrationWidth={ 150 } />\n+\t\t</div>\n+\t);\n+}\n+\n+PostTypeListEmptyContent.propTypes = {\n+\ttranslate: PropTypes.func,\n+\ttype: PropTypes.string,\n+\tstatus: PropTypes.string,\n+\ttypeObject: PropTypes.object,\n+\teditPath: PropTypes.string","path":"client/my-sites/post-type-list/empty-content.jsx","position":55,"original_position":55,"commit_id":"c3043c3ae398b0920daf7437e4c7b8c4af752982","original_commit_id":"c3043c3ae398b0920daf7437e4c7b8c4af752982","user":{"login":"timmyc","id":22080,"avatar_url":"https://avatars.githubusercontent.com/u/22080?v=3","gravatar_id":"","url":"https://api.github.com/users/timmyc","html_url":"https://github.com/timmyc","followers_url":"https://api.github.com/users/timmyc/followers","following_url":"https://api.github.com/users/timmyc/following{/other_user}","gists_url":"https://api.github.com/users/timmyc/gists{/gist_id}","starred_url":"https://api.github.com/users/timmyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmyc/subscriptions","organizations_url":"https://api.github.com/users/timmyc/orgs","repos_url":"https://api.github.com/users/timmyc/repos","events_url":"https://api.github.com/users/timmyc/events{/privacy}","received_events_url":"https://api.github.com/users/timmyc/received_events","type":"User","site_admin":false},"body":"missing `siteId` propType here.","created_at":"2016-04-06T16:54:49Z","updated_at":"2016-04-06T16:54:49Z","html_url":"https://github.com/Automattic/wp-calypso/pull/4534#discussion_r58741632","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/58741632"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/4534#discussion_r58741632"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534","id":65355432,"html_url":"https://github.com/Automattic/wp-calypso/pull/4534","diff_url":"https://github.com/Automattic/wp-calypso/pull/4534.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/4534.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4534","number":4534,"state":"open","locked":false,"title":"CPT: Show empty content display when no posts exist","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"This pull request seeks to display an `<EmptyContent />` component on the custom post type list page when no posts are found. Further, it changes the behavior of the filter bar to always display Published and Drafts statuses, mirroring the behavior of posts listing screen.\r\n\r\nBefore|After\r\n---|---\r\n![Before](https://cloud.githubusercontent.com/assets/1779930/14294212/dc396a0a-fb3d-11e5-814b-7b549fd4691b.png)|![After](https://cloud.githubusercontent.com/assets/1779930/14294107/71177f28-fb3d-11e5-9bc1-00ec38e45e3e.png)\r\n\r\n__Testing instructions:__\r\n\r\nVerify that an `<EmptyContent />` component is displayed for a site or status where no custom post types exist.\r\n\r\n1. Navigate to [My Sites](http://calypso.localhost:3000/sites)\r\n2. Select a site where a custom post type is supported\r\n3. Navigate to the custom post type from its sidebar navigation item\r\n4. Note that...\r\n - While posts are requested, a temporary placeholder is shown\r\n - If posts exist, they are shown after request completes (or if posts have been persisted previously)\r\n - If no posts exist, an `<EmptyContent />` component is shown","created_at":"2016-04-05T18:52:07Z","updated_at":"2016-04-06T16:54:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67847fea42a87ed6f03accb202fbe231267c348b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534/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/4534/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/c3043c3ae398b0920daf7437e4c7b8c4af752982","head":{"label":"Automattic:update/cpt-empty-content","ref":"update/cpt-empty-content","sha":"c3043c3ae398b0920daf7437e4c7b8c4af752982","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-04-06T16:04:54Z","pushed_at":"2016-04-06T15:11:54Z","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":73196,"stargazers_count":7116,"watchers_count":7116,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":856,"mirror_url":null,"open_issues_count":1285,"forks":856,"open_issues":1285,"watchers":7116,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"c54fc4c1137139cd10dc263da8417801b41b82d3","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-04-06T16:04:54Z","pushed_at":"2016-04-06T15:11:54Z","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":73196,"stargazers_count":7116,"watchers_count":7116,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":856,"mirror_url":null,"open_issues_count":1285,"forks":856,"open_issues":1285,"watchers":7116,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/4534"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/4534"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/4534/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4534/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/4534/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/c3043c3ae398b0920daf7437e4c7b8c4af752982"}}}}