Repository navigation
[WIP] Forms: Create new base blocks to enable Global Styles support JETPACK-261 - #42889
aaronrobertshaw wants to merge 6 commits into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage Summary17 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
1ce694a to
9bcd54d
Compare
Introduces foundational form field blocks: - jetpack/input - jetpack/label - jetpack/option - jetpack/options These blocks will be reused across all field types using inner blocks.
- Prevents adding bulk changes when syncing blocks to the undo stack - Correctly determines the parent field block for option blocks to check if syncing is enabled - Correctly find all option blocks regardless of whether they are a field's direct child, e.g. consent, or nested within an options block e.g. single/multiple choice fields.
2171100 to
dd0c310
Compare
| // TODO: Work out the best approach here for type. | ||
| // Currently, the type attribute isn't required as it can be passed via block | ||
| // context. It turns out though that choice items for the single and multiple | ||
| // choice fields had custom and different icons. Sharing a single | ||
| // `jetpack/option` block for global styling purposes means that can't happen | ||
| // without block variations. Block variations would require the type attribute | ||
| // at this block's level to allow different icons for each variation. | ||
| // | ||
| // Is this really needed? | ||
| // | ||
| // type: { | ||
| // type: 'string', | ||
| // default: 'checkbox', | ||
| // }, |
There was a problem hiding this comment.
Is this just about different icons within the editor? If that's the only difference between the two, then I'd lean toward not including a type attribute for now, and circle back to it if we wind up feeling like there's a need for it further down the track.
There was a problem hiding this comment.
It is.
This came up in discussion with @simison and the expectation is we might ideally have separate icons. The catch is we'll need to refactor this attribute sooner rather than later to avoid needing deprecations if we waited until post-release of inner blocks.
This is an enhancement over trunk however the is some work required to make this actually work, especially given the shortcode rendering on the frontend. For the time being this support will explicitly be opted out of. It can be revisited when the benefit justifies the additional complexity and work.
|
With many hands working on testing and refining #42890, it's proven tricky to ensure this base branch is kept up-to-date with all the tweaks to the new base blocks without interfering with progress and momentum on #42890. After some discussion with @talldan, I've decided to close this PR so we only have a single PR to manage with #42890 now to be based off trunk. |
JETPACK-261
Fixes #42355
Proposed changes:
jetpack/inputjetpack/labeljetpack/optionjetpack/optionsOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
TBA