-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
<CategorySelect> support post_tags and hierarchical = false taxonomy. #13076
<CategorySelect> support post_tags and hierarchical = false taxonomy. #13076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @torounit, thank you for your contribution 👍
Unfortunately, to not have cyclic dependencies the buildTermsTree logic is duplicated
https://github.com/WordPress/gutenberg/blob/feature/buildTermsTree-support-tags/packages/editor/src/utils/terms.js#L14.
Would it be possible to update the other version?
@jorgefilipecosta Thanks reviewing! found in same method in |
@jorgefilipecosta need update test ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jorgefilipecosta need update test ?
Yes we need to update the test case on lines https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/utils/test/terms.js#L7-L11
It would also be good if we could add some additional tests specific to this logic.
const termsByParent = groupBy( flatTerms, 'parent' ); | ||
const flatTermsWithParent = flatTerms.map( ( term ) => { | ||
return { | ||
parent: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this fix also work if the parent was null instead of 0? This makes it clear that no parent exists in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed to use parent: null
@jorgefilipecosta use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your interactions @torounit. I think the PR is ready 👍
Description
<CategorySelect>
support custom taxonomy withhierarchical = true
now. but not workinghierarchical = false
. fixed it.How has this been tested?
Add this code. and check
core/latest-posts
block.Types of changes
New feature (non-breaking change which adds functionality)
Checklist: