Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPT / Editor: Enable custom taxonomies for posts and pages #6744

Merged
merged 3 commits into from
Jul 18, 2016

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Jul 13, 2016

Closes #6626

This pull request seeks to display the <EditorDrawerTaxonomies /> component (custom taxonomies) for all post types. Currently, this is only shown for non-post/page types. However, since posts and pages can have custom taxonomies associated with them, we should render this component.

Posts will continue to show Categories & Tags under a single combined accordion, and logic has been included to avoid duplicate accordions from being shown based on the taxonomies associated with the post type.

Testing instructions:

Verify that there are no visual regressions between this branch and master when viewing posts, pages, or a custom post type. Also ensure that if your theme has registered a custom taxonomy associated with a post or page that it is shown in the sidebar of the editor.

Test live: https://calypso.live/?branch=update/cpt-editor-custom-taxonomies

@aduth aduth added [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Custom Post Types (CPT) labels Jul 13, 2016
if ( config.isEnabled( 'manage/custom-post-types' ) ) {
taxonomies = (
<EditorDrawerTaxonomies
key="taxonomies"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary because createFragment assigns a key itself, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary because createFragment assigns a key itself, right?

Yes, I believe you're correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key removed in rebased 6faa308

@nylen
Copy link
Contributor

nylen commented Jul 18, 2016

Looks good apart from the notes above, and works well in my testing on my primary site:

image

Partially addresses #720 (for any theme features that are implemented as custom taxonomies)

Also related: 11370-gh-calypso-pre-oss

@aduth aduth force-pushed the update/cpt-editor-custom-taxonomies branch 2 times, most recently from d3f2460 to f224d0e Compare July 18, 2016 19:04

const siteVersion = getSiteOption( state, siteId, 'jetpack_version' );
if ( ! siteVersion ) {
return null;
Copy link
Contributor

@timmyc timmyc Jul 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the use case here where the feature requires 4.1 or higher - won't returning null here cause a failure down the line in EditorDrawerTaxonomies since you are explicitly checking for a value of false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't returning null here cause a failure down the line in EditorDrawerTaxonomies since you are explicitly checking for a value of false

I think at worst it would result in a 404 error on the request, and this could only happen if visiting the editor with a non-primed sites state. The alternative would be to hide the taxonomy accordions for all sites until after we can verify that the site is either not Jetpack or meets the satisfying version.

@aduth aduth force-pushed the update/cpt-editor-custom-taxonomies branch from f224d0e to d0ed1b5 Compare July 18, 2016 21:39
@timmyc
Copy link
Contributor

timmyc commented Jul 18, 2016

LGMT 🚢

@timmyc timmyc added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 18, 2016
@aduth aduth merged commit f32efcd into master Jul 18, 2016
@aduth aduth deleted the update/cpt-editor-custom-taxonomies branch July 18, 2016 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Custom Post Types (CPT) [Feature] Post/Page Editor The editor for editing posts and pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants