-
-
Notifications
You must be signed in to change notification settings - Fork 708
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUU] Showing error summary at top of form #11750
Merged
mkllnk
merged 10 commits into
openfoodfoundation:master
from
dacook:buu-editing-part5c-show-summary-11059
Nov 3, 2023
Merged
[BUU] Showing error summary at top of form #11750
mkllnk
merged 10 commits into
openfoodfoundation:master
from
dacook:buu-editing-part5c-show-summary-11059
Nov 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's generally expected that a #save method will return true on succes, and false on failure.
I found this in my stashes
Trying to cover it more comprehensively, and revealing we have a lot of behaviour to update. Products and their variants should always get saved (or not saved) together. This is considered the most intuitive behaviour. There's still duplication with the "variant has error" context, but I try to avoid nesting shared_examples, it starts to get ugly. Happy to discuss though.
dacook
force-pushed
the
buu-editing-part5c-show-summary-11059
branch
3 times, most recently
from
November 2, 2023 05:59
6cb7335
to
093758e
Compare
dacook
force-pushed
the
buu-editing-part5c-show-summary-11059
branch
from
November 3, 2023 02:26
093758e
to
8a88734
Compare
Ignoring variants for now.
Best viewed with whitespace ignored.
This makes it easier to control in the next commit.
I chose to use the 'elements' collection rather than choosing which elements to include (ie this supports inputs, textareas, buttons and anything else I didn't think of). It could be a bit simpler if we assume the element is a form. Even simpler if it's a fieldset (that has a disabled property). But I didn't want to limit it too much. Unfortunately JS is quite ugly compared to Ruby. And 'prettier' made it uglier in my opinion.
dacook
force-pushed
the
buu-editing-part5c-show-summary-11059
branch
from
November 3, 2023 03:33
8a88734
to
7fe6f3f
Compare
mkllnk
approved these changes
Nov 3, 2023
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!
dacook
added
the
technical changes only
These pull requests do not contain user facing changes and are grouped in release notes
label
Nov 9, 2023
This was referenced Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
technical changes only
These pull requests do not contain user facing changes and are grouped in release notes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
Presenting an error summary at the top of the form when performing a bulk update. And lots of necessary refactors.
This makes a small change to the backend of the current bulk edit products screen, but doesn't change any behaviour, so I think doesn't need manual testing.
What should we test? [admin_style_v3]
Changes listed below (Unchecked parts are not fully implemented).
1. When product has two fields updated:
2. When product and associated variant are updated, but there are errors:
Neither should be saved, summary should show, and unsaved values retained with red/orange border.
But these fail due to #11748
3. When multiple products are updated
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.