-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor ui/forms/address component
#6191
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
Refactor ui/forms/address component
#6191
Conversation
|
@tvdeyen please have a look, this addresses your change request 🙏 #6160 (review) |
e0a3486 to
8f1093f
Compare
admin/app/components/solidus_admin/orders/show/address/component.html.erb
Outdated
Show resolved
Hide resolved
As per this discussion solidusio#6191 (comment).
tvdeyen
left a comment
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.
Thanks
As per this discussion solidusio#6191 (comment).
fc49c32 to
b3717df
Compare
As per this discussion solidusio#6191 (comment).
b3717df to
55380c9
Compare
- change `address` to `addressable` to better reflect that the passed object can not only be an `Address` but any object with address fields (e.g. `StockLocation`); - change `name` to `fieldset_name` to avoid confusion with "Name" field, whereas `fieldset_name` is a name to be used for the form (e.g. "users[billing_address_attributes]");
With default `true`, this flag allows to control whether to show "Name" field on the form (will be used for stock location form where "Name" is the only field not used).
As per this discussion solidusio#6191 (comment).
55380c9 to
4ff6e68
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6191 +/- ##
=======================================
Coverage 88.78% 88.79%
=======================================
Files 839 839
Lines 18215 18216 +1
=======================================
+ Hits 16173 16174 +1
Misses 2042 2042 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@tvdeyen is it good to be merged? |
|
Yes. Usually we have a two approvals from core team members rule, but since this is the new admin, which is still in beta and many core team members are away right now, it should be fine. |
Split from #6160 (commit 062b248)
Summary
Changes description:
@include_name_fieldflag that controls whether to show "Name" field on the form;addresstoaddressableto better reflect the nature of the passed object;nametoform_field_nameto avoid confusion with "Name" field, whereasform_field_nameis a name to be used for the form (e.g. "users[billing_address_attributes]");Motivation:
This change allows to reuse this component in location stock form component, where the only difference between forms is that "Name" field is not there for location stock address.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: