-
Notifications
You must be signed in to change notification settings - Fork 800
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
Forms: refactor Multiple and Single Choice fields #39141
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
7b941d8
to
da9cb53
Compare
d87fa7d
to
2533b5d
Compare
f6fe196
to
4394262
Compare
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 on this!
Tests well.
projects/packages/forms/src/blocks/contact-form/util/merge-settings.js
Outdated
Show resolved
Hide resolved
…tings.js Co-authored-by: Karen Attfield <[email protected]>
* Forms: Refactor Multiple Choice field * changelog * Add back deprecated version * Refactor Single Choice field * Fix wrong prop value for Multiple field * Fix Button style * Update projects/packages/forms/src/blocks/contact-form/util/merge-settings.js Co-authored-by: Karen Attfield <[email protected]> --------- Co-authored-by: Karen Attfield <[email protected]>
Proposed changes:
#38916 made one of the Calyso e2e tests fail (see conversion linked below) because it changed the markup of the Multiple Choice and Single Choice blocks in the editor. It highlighted that the block and the inner block props were passed incorrectly. This PR refactors these two blocks to match how Gutenberg handles block and inner blocks (e.g. the List block). It should fix the failing e2e test as well.
In detail, the PR does the following:
child-blocks.js
for readability, respectively in thejetpack-field-multiple-choice
andjetpack-field-single-choice
foldersjetpack-field-choice
editor.scss
to prevent any design breakagegetFieldLabel
in a separate filemergeSettings
utility to merge a block settings with default settingsjetpack-field-option.js
fileOther information:
Jetpack product discussion
Conversation: p1724766845302749-slack-C01U2KGS2PQ
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
trunk
branch. You need to be able to switch branch later on.Note: the label is different in the editor and the preview as long as it's not edited. This issue is already present on trunk and will be addressed in a separate PR.