-
Notifications
You must be signed in to change notification settings - Fork 115
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
NEW Inline save all rendered element forms on parent form submit #1214
NEW Inline save all rendered element forms on parent form submit #1214
Conversation
df8b525
to
027a700
Compare
6d0930b
to
6a8f776
Compare
6a8f776
to
15c9006
Compare
@@ -1,52 +0,0 @@ | |||
@javascript | |||
Feature: Don't lose content when page or block is invalid |
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 whole file was testing validation messages after page save. Since we've removed that functionality entirely this feature file is no longer relevant
15c9006
to
fffa9ba
Compare
fffa9ba
to
123be88
Compare
Problems encountered when testing locally: There's no feedback
There's nothing at all indicating that something went wrong. No toast, and the block doesn't open. It looks like the page save is just broken but in reality there's a validation error I'm not being told about. There should definitely be a toast message, and ideally the block should open so that I can immediately see the validation error message without opening all the blocks to try find it. This is partially #1177 which is meant to be fixed by this PR. Blocks get double saved - which turns them back to "modified"
The block is now "Modified" even though I didn't make any changes! Note that the page itself isn't "modified", so this isn't just how the CMS treats a save that happens after a publish.
|
183ea5c
to
f29fcd9
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.
Need to set a composer requirement of silverstripe/admin ^2.3
Note that I still have the "no feedback" and "Blocks get double saved - which turns them back to "modified"" issues as described above. Note that the "no feedback" problem only happens with form validation (i.e. |
I've solved the "Blocks get double saved - which turns them back to "modified" issue - change here For the "no feedback" issue with RequiredFields ... I don't know how to resolve this one without globally removing client-side validation (which admittedly would simplify things, but we probably shouldn't. Though I also won't really mind :-). The issue is that RequiredFields has client-side (pure js) validation which prevents an XHR request from being sent to the server in the first place. The 'feedback' of popping opening the element happens as part of the XHR response which is formSchema formatted and contains the validation errors. However with the client-side validation there's nothing "returned" to trigger opening the element. If we did globally remove client-side validation then it'll make an XHR request and fail validation on the server and behave the same UX wise as DataObject->validate() failing I think the client-side validation is passed in as a callback into redux-form ... somehow (this maybe?). I don't think there's anyway to somehow extract a 'response' from it, particularly as we're remote-submitting the form which does not return a promise So I guess, options are: |
I don't think that's really an option, since It's interesting to note that a Is that front-end validation JS able to trigger a toast? That would resolve the problem well enough for now, I think. Better if the block opens, but at least if there's a toast it prompts the content author to start looking for a validation error message as opposed to just thinking something's not working the way it should be. |
I've the validation fixed it by hardcoding something into admin to disable client-side validation for elemental specifically - https://github.com/silverstripe/silverstripe-admin/pull/1792/files#diff-cc40afd32326a7c9ddea47afd5623f5dd54abfe99db517c1f6e72ca43337a4cbR73 It's obviously not the prettiest, though the UX experience is now much better. Note that I'm pretty sure this change will require updating a behat test that expects client side validation, so rerun tests for this is the admin PR is merged |
36ec955
to
41060e0
Compare
fa0710b
to
e2a7828
Compare
e2a7828
to
823cc53
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.
LGTM - will merge the other PRs then rerun CI.
Behat failing |
Needed to tag 5.4.0 of behat-extension, have done that an re-run, working now |
Issue #1215
Requires silverstripe/silverstripe-admin#1792 and silverstripe/silverstripe-behat-extension#277 and silverstripe/silverstripe-frameworktest#193 and silverstripe/silverstripe-framework#11301
What this PR does