-
Notifications
You must be signed in to change notification settings - Fork 799
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
Contact Form Block: Fix Missing Button Color Attributes #14898
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: April 7, 2020. |
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.
This looks good, just one nitpick about spelling!
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.
Looks good in my tests. 👍
r203932-wpcom |
Good catch! It looks like we didn't pick up the Contact Form with this change which is probably because it doesn't explicitly use the SubmitButton component. AFAIK we shouldn't be validating the colours has hex values though. I had to remove that validation from another block as the colours can be values like |
@pablinos I think you're right: we should only validate custom colors (that are supposed to always be hex codes), but not named ones. |
Yeah looking at it again, I think I got confused by the all the colour related attributes for the Calendly block. I think there might be a couple we can deprecate now. |
* Initial changelog entry * Changelog: add #14904 * Changelog: add #14910 * Changelog: add #14913 * Changelog: add #14916 * Changelog: add #14922 * Changelog: add #14924 * Changelog: add #14925 * Changelog: add #14928 * Changelog: add #14840 * Changelog: add #14841 * Changelog: add #14842 * Changelog: add #14826 * Changelog: add #14835 * Changelog: add #14859 * Changelog: add #14884 * Changelog: add #14888 * Changelog: add #14817 * Changelog: add #14814 * Changelog: add #14819 * Changelog;: add #14797 * Changelog: add #14798 * Changelog: add #14802 * Changelog: add #13676 * Changelog: add #13744 * Changelog: add #13777 * Changelog: add #14446 * Changelog: add #14739 * Changelog: add #14770 * Changelog: add #14784 * Changelog: add #14897 * Changelog: add #14898 * Changelog: add #14968 * Changelog: add #14985 * Changelog: add #15044 * Changelog: add #15052 * Update to remove Podcast since it remains in Beta * Changelog: add #14803 * Changelog: add #15028 * Changelog: add #15065 * Changelog:add #14886 * Changelog: add #15118 * Changelog: add #14990 * Changelog: add #14528 * Changelog: add #15120 * Changelog: add #15126 * Changelog: add #15049 * Chanegelog: add #14852 * Changelog: add #15090 * Changelog: add #15138 * Changelog: add #15124 * Changelog:add #15055 * Changelog: add #15017 * Changelog: add #15109 * Changelog: add #15145 * Changelog:add #15096 * Changelog:add #15153 * Changelog: add #15133 * Changelog: add #14960 * Changelog: add #15127 * Changelog: add #15056 * Copy current changelog to changelog archive. * Clarify changelog description
Changes proposed in this Pull Request:
The Contact Form block was missing the
textButtonColor
andbackgroundButtonColor
attributes, necessary to make it work with theSubmitButton
shared component.This practically means that, currently, you can change the colors of the Contact Form submit button, you will see the button preview updating correctly (as the colors are applied as CSS classes in the editor), but if you save the post and reload, the colors are not saved.
This only happens for "named" colors; custom colors work fine, as their attributes are not missing.
This PR adds those missing two attributes to the Contact Form block.
Also, externalizes the
colourValidator
utility that was being carelessly copypasted around.I've also americanized the function name, as it's more consistent with the fact that we use
color
everywhere, and I'm ready to fight my British colleagues about it! 😄Note: most changed lines here are automatic Prettier changes on the test file. 😭
Testing instructions:
Proposed changelog entry for your changes: