{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/62670840","id":62670840,"diff_hunk":"@@ -0,0 +1,59 @@\n+/**\n+ * External dependencies\n+ */\n+import React, { PropTypes } from 'react';\n+import { connect } from 'react-redux';\n+import map from 'lodash/map';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import QueryTaxonomies from 'components/data/query-taxonomies';\n+import { getSelectedSiteId } from 'state/ui/selectors';\n+import { getEditorPostId } from 'state/ui/editor/selectors';\n+import { getEditedPostValue } from 'state/posts/selectors';\n+import { getPostTypeTaxonomies } from 'state/post-types/taxonomies/selectors';\n+import Accordion from 'components/accordion';\n+import Gridicon from 'components/gridicon';\n+\n+function EditorDrawerTaxonomies( { siteId, postType, taxonomies } ) {\n+\treturn (\n+\t\t<div className=\"editor-drawer__taxonomies\">\n+\t\t\t{ siteId && postType && (\n+\t\t\t\t<QueryTaxonomies { ...{ siteId, postType } } />\n+\t\t\t) }\n+\t\t\t{ map( taxonomies, ( taxonomy ) => {\n+\t\t\t\tif ( 'post_format' === taxonomy.name ) {\n+\t\t\t\t\t// Post format has its own dedicated accordion\n+\t\t\t\t\treturn;\n+\t\t\t\t}\n+\n+\t\t\t\treturn (\n+\t\t\t\t\t<Accordion\n+\t\t\t\t\t\tkey={ taxonomy.name }\n+\t\t\t\t\t\ttitle={ taxonomy.label }\n+\t\t\t\t\t\ticon={ <Gridicon icon=\"tag\" /> }>","path":"client/post-editor/editor-drawer/taxonomies.jsx","position":35,"original_position":35,"commit_id":"a6cacdb6da353226cf13af746c01666b33098e4a","original_commit_id":"a6cacdb6da353226cf13af746c01666b33098e4a","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":">Need some fancier gridicons here 😆 \r\n\r\nYeah, the repetition of the tag icon in the [example screenshot](https://cloud.githubusercontent.com/assets/1779930/15125886/38568e38-15fd-11e6-85d2-0948344479f5.png) leaves some to be desired. Perhaps we can hard-code icons for the known post types taxonomies? Or choose a different icon for hierarchical and non-hierarchical taxonomies, since at least in this case and for posts, there's one of each (Tags and Types/Categories).\r\n\r\nReference: https://wpcalypso.wordpress.com/devdocs/design/gridicons\r\n\r\n_(\"folder\" for hierarchical types?)_\r\n\r\n/cc @hugobaeta ","created_at":"2016-05-10T13:30:25Z","updated_at":"2016-05-10T13:30:25Z","html_url":"https://github.com/Automattic/wp-calypso/pull/5297#discussion_r62670840","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/62670840"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/5297#discussion_r62670840"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297","id":69400035,"html_url":"https://github.com/Automattic/wp-calypso/pull/5297","diff_url":"https://github.com/Automattic/wp-calypso/pull/5297.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/5297.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5297","number":5297,"state":"open","locked":false,"title":"Editor/CPT: Display accordions for custom taxonomies available for post type","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 a single editor sidebar accordion for each custom taxonomy available for the custom post type.\r\n\r\nBefore|After\r\n---|---\r\n![Before](https://cloud.githubusercontent.com/assets/1779930/15125874/2e07aeee-15fd-11e6-8f4e-36886c7e8ae6.png)|![After](https://cloud.githubusercontent.com/assets/1779930/15125886/38568e38-15fd-11e6-85d2-0948344479f5.png)\r\n\r\n_Example shows portfolio custom post type_\r\n\r\n__Implementation notes:__\r\n\r\nIncludes additional post type taxonomies and edited post selectors for retrieving available taxonomies, and a `<QueryTaxonomies />` [query component](https://github.com/Automattic/wp-calypso/blob/master/docs/our-approach-to-data.md#query-components) for requesting post type taxonomies.\r\n\r\n__Testing instructions:__\r\n\r\nVerify that post type taxonomy accordions are displayed, only for custom post types, and only when the custom post types feature flag is enabled. Since editor routes are not defined for custom post types when  the feature flag is disabled, it should not be possible to reach the editor at all for these post types.\r\n\r\n1. Navigate to My Sites\r\n2. Switch to a site where at least one custom post type is available\r\n3. Click Add next to a post type in the sidebar navigation\r\n4. Note that...\r\n - For \"post\" post type, only the Categories & Tags accordion is shown\r\n - For \"page\" post type, no taxonomy accordions are shown\r\n - For any other post type, an accordion is shown for each available taxonomy\r\n\r\n__Caveats:__\r\n\r\n- The accordion content is currently a placeholder and will be fleshed out in subsequent pull requests","created_at":"2016-05-09T19:50:47Z","updated_at":"2016-05-10T13:30:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d52aac7a610446b8828027e7ee0fafeb7c39bd63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297/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/5297/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/a6cacdb6da353226cf13af746c01666b33098e4a","head":{"label":"Automattic:update/cpt-editor-taxonomies","ref":"update/cpt-editor-taxonomies","sha":"a6cacdb6da353226cf13af746c01666b33098e4a","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-05-10T13:23:27Z","pushed_at":"2016-05-10T13:21:34Z","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":75675,"stargazers_count":7274,"watchers_count":7274,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":878,"mirror_url":null,"open_issues_count":1337,"forks":878,"open_issues":1337,"watchers":7274,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"46592d3f233ea10a66633183bc03d3e7ec21e060","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-05-10T13:23:27Z","pushed_at":"2016-05-10T13:21:34Z","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":75675,"stargazers_count":7274,"watchers_count":7274,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":878,"mirror_url":null,"open_issues_count":1337,"forks":878,"open_issues":1337,"watchers":7274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/5297"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/5297"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/5297/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5297/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/5297/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/a6cacdb6da353226cf13af746c01666b33098e4a"}}}}