-
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
Adds multi-select to categories on Latest Posts #20781
Adds multi-select to categories on Latest Posts #20781
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.
Great work @Ringish :) Left some comments about the code. As a general note i advise you to follow the setup in the code contribution guide to benefit from automatic linting and early problem detection.
Setting up locally Docker
and the @wordpress/wp-env
package will also allow you to run failing tests locally and debug.
Looking forward for testing this again after you've went through my suggestions! 🚀
Really good feedback. Thank you! I've pushed a new commit. |
Tested this locally by filtering on multiple categories and LGTM! |
Will we still see the list of possible categories below the multiselect box? |
@paaljoachim not at this point, no. That is a disatvantage of this tokenized system. When implementing such a system you basically trat categories like tags and type two letters to get a fuzzy match list. On another note, I will open an issue to move the control token select to |
@@ -96,6 +97,22 @@ class LatestPostsEdit extends Component { | |||
featuredImageSizeWidth, | |||
featuredImageSizeHeight, | |||
} = attributes; | |||
const suggestions = categoriesList.reduce( |
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.
We should rename suggestions
to categorySuggestions
The change of attribute schema for this block here should have been accompanied with provisions for migration, especially considering that this is a dynamic block. |
Description
Adds possibility to add & select posts in
LatestPosts
by multiple categories as described in #20046.How has this been tested?
Added a couple of posts and categories, and used the new implementation to test, edit and save.
Screenshots
Types of changes
Adds ability to filter by multiple categories. May be breaking change? Probably this could break blocks with the old implementation.
Checklist: