<CategorySelect> support post_tags and hierarchical = false taxonomy.#13076
<CategorySelect> support post_tags and hierarchical = false taxonomy.#13076youknowriad merged 5 commits intoWordPress:masterfrom torounit:feature/buildTermsTree-support-tags
Conversation
jorgefilipecosta
left a comment
There was a problem hiding this comment.
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 ? |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
@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.
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.
fixed to use parent: null
|
@jorgefilipecosta use |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
Thank you for your interactions @torounit. I think the PR is ready 👍
Description
<CategorySelect>support custom taxonomy withhierarchical = truenow. but not workinghierarchical = false. fixed it.How has this been tested?
Add this code. and check
core/latest-postsblock.Types of changes
New feature (non-breaking change which adds functionality)
Checklist: