Merged
Conversation
8cca352 to
d6b3932
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6294 +/- ##
==========================================
+ Coverage 89.31% 89.33% +0.02%
==========================================
Files 959 961 +2
Lines 20117 20157 +40
==========================================
+ Hits 17968 18008 +40
Misses 2149 2149 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d6b3932 to
fa4fca7
Compare
4 tasks
This will allow to clean up existing forms and write more concise forms in the future. Custom form builder encapsulates all the calls to "render", "component()" initializations, and assumes some defaults, e.g. if "checked" is not passed to "f.checkbox" we get it by calling @object.send(method)
button#submit helper can grab correct button text for us depending on the record passed. In special cases when we need a custom text, keyword argument "text:" can be passed to override default text.
32c2509 to
31952bb
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a convenient SolidusAdmin::FormBuilder with shortcuts for all currently used form elements, such as:
Before:
After:
Lots of boilerplate code and logic is now contained in the builder, e.g. object name and "checked" attribute for checkboxes:
Submit button together with UI/Button's component
#submithas now become a powerful "no-args-required" thing - component chooses a correct button text depending on a record passed to the form builder.So this:
becomes this:
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs: