Skip to content

Enhancement/41 Podcasts Taxonomy term(s) added in block settings#183

Merged
faisal-alvi merged 3 commits intodevelopfrom
enhancement/41
Oct 10, 2022
Merged

Enhancement/41 Podcasts Taxonomy term(s) added in block settings#183
faisal-alvi merged 3 commits intodevelopfrom
enhancement/41

Conversation

@faisal-alvi
Copy link
Copy Markdown
Contributor

@faisal-alvi faisal-alvi commented Sep 14, 2022

Description of the Change

  • This PR adds the podcasts taxonomy panel picker in the Block settings.
  • Please note, that the taxonomy selection would be still connected with the post itself, not the block.

Closes #41

Alternate Designs

image

Possible Drawbacks

  • Not a drawback but, the default taxonomy panel under the "Post" tab is still there because if we remove it by making show_in_rest: true, we can not replicate it under the settings tab too. If we still need that removed, we may have to add display: none to it.

Verification Process

  1. Switch to the PR branch.
  2. Run npm run build.
  3. Create a new/edit existing post.
  4. Select the Podcast block.
  5. See the podcast taxonomy panel under the block settings.
  6. Make sure it works.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - Podcasts Taxonomy term(s) added in block settings

Credits

Props @helen @jeffpaul @faisal-alvi

@faisal-alvi faisal-alvi self-assigned this Sep 14, 2022
@faisal-alvi faisal-alvi added this to the Future Release milestone Sep 14, 2022
@faisal-alvi faisal-alvi requested review from a team and peterwilsoncc and removed request for a team September 14, 2022 12:56
peterwilsoncc
peterwilsoncc previously approved these changes Sep 15, 2022
Copy link
Copy Markdown
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

This looks good to me but I think it might be possible to simplify the code by using the Gutenberg components.

const ALLOWED_MEDIA_TYPES = [ 'audio' ];

// Import taxonomy panel.
import PostTaxonomies from './taxonomy-panel';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I'd give the component and file the same name: either PostTaxonomies from './post-taxonomies' or TaxonomyPanel from ...

*/
import TaxonomyPanel from './taxonomy-panel';

function PostTaxonomies() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to simplify this with <HierarchicalTermSelector slug="podcasting_podcasts" /> similar to how the category selector is shown on the post-publish-check page (but without the messy checking of whether or not to display it)?

https://github.com/WordPress/gutenberg/blob/5d5e97abd5e082050fdbb88bb1c93f9dbe10a23b/packages/editor/src/components/post-publish-panel/maybe-category-panel.js#L77-L84

@faisal-alvi
Copy link
Copy Markdown
Contributor Author

@peterwilsoncc thanks for the suggestion, I have implemented HierarchicalTermSelector. Please let me know if any chagnes are required.

image

peterwilsoncc
peterwilsoncc previously approved these changes Sep 15, 2022
Copy link
Copy Markdown
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

Thank you, this LGTM with one suggestion to add a todo.

Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

Thanks!

@cadic cadic modified the milestones: Future Release, 1.3.0 Sep 16, 2022
@jeffpaul
Copy link
Copy Markdown
Member

@faisal-alvi is this good to come out of Draft (and then get merged in)?

@faisal-alvi faisal-alvi marked this pull request as ready for review October 10, 2022 17:27
@faisal-alvi faisal-alvi requested a review from cadic as a code owner October 10, 2022 17:27
@faisal-alvi faisal-alvi merged commit b98fc73 into develop Oct 10, 2022
@faisal-alvi faisal-alvi deleted the enhancement/41 branch October 10, 2022 17:28
@iamdharmesh iamdharmesh mentioned this pull request Feb 14, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gutenberg: Set taxonomy term(s) in block settings

4 participants