This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LevinMedia
approved these changes
Nov 18, 2018
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 start, testing well for me!
tiagonoronha
approved these changes
Nov 19, 2018
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.
Nice work, looking good! 👍
ryelle
force-pushed
the
add/product-category-block
branch
from
November 19, 2018 16:32
35c08b9
to
206edaf
Compare
23 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR creates a basic, early iteration of the "Products by Category" block. This adds a basic preview UI, the inspector controls, and the alignment controls. This does not add the "edit state"/initial view. This also uses the core
TreeSelect
for picking a category, not the custom search/checkboxes. Both of those will be done in future PRs.Fixes #116, also adds support for
menu_order
ordering, so fixes #125. This is build upon #135.Screenshots
The whole block with all settings sections:
An example of full-width in Gutenberg
These use the shortcode to display on the frontend, and in Twenty Nineteen look like this:
I've also added basic support for "loading" and "empty" states:
Code notes
I've introduced some utilities that I think will be shared across blocks.
shared-attributes
has definitions forrows
,columns
, etc; and I'll use these plus block-specific settings like this. I've also introducedgetQuery
andgetShortcode
, which are used to generate the API query and shortcode string respectively.How to test the changes in this Pull Request:
npm test
, for the added component &getQuery
tests (a shortcode test suite will be added later).There are probably edge cases I'm not testing with, so feel free to use strange combinations of settings 😆