-
Notifications
You must be signed in to change notification settings - Fork 193
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
Feature: allow required blocks to move between sections #6972
Conversation
@jonwaldstein This is ready for review! |
@JasonTheAdams Looks good. Let's add the error icon to the header text like the image below to emphasize on it being an error. Suggestion: Can we also have a cta like "add missing blocks" instead of "Got it" which automatically adds the block to their original/intended position? |
@JasonTheAdams i'm getting a bunch of typescript errors on this PR when running |
src/FormBuilder/resources/js/form-builder/src/styles/_components.scss
Outdated
Show resolved
Hide resolved
I like the idea of this, but I think it's a bit beyond the scope of this right now. This is also an unlikely scenario. We can improve this later. |
Yikes, yeah, you're right @jonwaldstein. None of these have anything to do with what I'm doing, though. Must be from a previous PR. It's weird that these only show up when you run |
yeah, it's something I need to look into but basically laravel mix will prevent bundle from typescript errors while wp scripts ignores them. |
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
Any other feedback, @jonwaldstein, besides the console errors unrelated to this PR? |
@JasonTheAdams i'm only getting these build errors on this PR - not develop so that should be resolved before merging |
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.
Passed manual QA tests.
Description
Forms have a number of blocks/fields that are required for the form to function — e.g. donation amount and email. The primary way we've enforced this is to put a lock on the required blocks. This has a couple of flaws:
We also have a validation system on the server which checks that the required blocks are present when saving. It's simply not likely that folks will remove things like the name and amount field, which means we're creating friction to do something relatively likely (move blocks between sections) for something unlikely that's prevented another way.
This PR removes the locks on the required fields, allowing them to move freely. It also updates the server error flow to display a Gutenberg model instead of an alert, giving a nicer experience.
Affects
The required blocks and the block validation system.
Visuals
Testing Instructions
Move the required blocks around the form builder. Then delete one and try to save. Finally, add it back and attempt to save, making sure it can recover from an error state.
Pre-review Checklist