Skip to content
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

Add Order#use_shipping and address management to the admin dashboard #5461

Merged
merged 8 commits into from
Nov 8, 2023

Conversation

rainerdema
Copy link
Contributor

@rainerdema rainerdema commented Oct 26, 2023

Summary

Screenshot 2023-11-07 at 16 12 57 Screenshot 2023-11-07 at 16 13 04
Integrate.address.form.component.for.billing.and.shipping.mov

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@rainerdema rainerdema self-assigned this Oct 26, 2023
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch 2 times, most recently from 052c89a to 788a05a Compare October 30, 2023 18:49
@rainerdema rainerdema changed the title [Admin] Add order address/customer form [Admin] Use address form component for order/customer addresses Oct 30, 2023
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch 2 times, most recently from b4fa09b to ba1f9e1 Compare November 3, 2023 15:24
@rainerdema rainerdema changed the base branch from main to elia/admin/orders-customer-sidebar November 3, 2023 15:24
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from ba1f9e1 to d2380c7 Compare November 3, 2023 17:51
@github-actions github-actions bot added changelog:solidus_api Changes to the solidus_api gem changelog:solidus_core Changes to the solidus_core gem labels Nov 3, 2023
@rainerdema rainerdema changed the title [Admin] Use address form component for order/customer addresses [Admin] Order process: Integrate address form component for billing and shipping Nov 3, 2023
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from d2380c7 to dcb4daf Compare November 3, 2023 18:03
@rainerdema rainerdema marked this pull request as ready for review November 3, 2023 18:18
@rainerdema rainerdema requested a review from a team as a code owner November 3, 2023 18:18
@rainerdema rainerdema requested a review from elia November 3, 2023 18:18
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch 2 times, most recently from de15a9d to f9c39e2 Compare November 3, 2023 22:31
@elia elia force-pushed the elia/admin/orders-customer-sidebar branch from 77b9f54 to 4a13a62 Compare November 6, 2023 09:19
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from f9c39e2 to 50d922d Compare November 6, 2023 09:22
@elia elia force-pushed the elia/admin/orders-customer-sidebar branch 3 times, most recently from 7a4861a to 0dda932 Compare November 6, 2023 14:26
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from 50d922d to 7c80411 Compare November 6, 2023 14:36
@elia elia deleted the branch solidusio:main November 6, 2023 14:45
@elia elia closed this Nov 6, 2023
@elia elia reopened this Nov 6, 2023
@elia elia changed the base branch from elia/admin/orders-customer-sidebar to main November 6, 2023 15:27
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, but can't wait to merge this! 👏

@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from 7c80411 to 6b220de Compare November 7, 2023 13:39
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch 3 times, most recently from 52d356e to fe908f9 Compare November 7, 2023 14:10
@rainerdema rainerdema requested a review from elia November 7, 2023 14:11
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch 2 times, most recently from b86d6ff to f6e2e26 Compare November 7, 2023 15:46
Add use_shipping attribute with syncing logic to `Spree::Order` model.
Similar to the existing `use_billing` feature, a `use_shipping` attribute
has been introduced.
This addition enables the automatic assignment of the shipping address
to the billing address when the `use_shipping` flag is set.
The `before_validation` callbacks ensure that the addresses are
synchronized, thereby streamlining the address management process
in the new admin interface.
- Introduce a new `AddressesController` to handle the creation and updating of
  billing and shipping addresses for orders. Includes new and update actions
  with strong  parameter support and address type validation.
- Add links for address management to customer section component.
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from 114759f to a2a2b90 Compare November 8, 2023 17:49
Leverage the existing `ui/forms/address` component to render the address forms
within the admin order process.
Modify the style definitions for city and zipcode fields to ensure
consistent height alignment with other fields in the form.
Enhance the address form's state field by ensuring the correct state is selected
during asynchronous loading.
This adjustment addresses a timing issue where Stimulus did not populate the
state select promptly, leading to mismatched selections.
Modify the address form logic to accommodate countries without associated
states.
The state select field is now automatically disabled when a country with no
states is selected.
Additionally, this ensure state select field is disabled for preloaded
selected country without states.
Corrected the Stimulus controller event handling to ensure
dropdown <details> close on modal open/close.
Previously, the `turbo:before-cache` event was not properly connected to
the Stimulus controller, causing menus to remain open after a modal was triggered.

The 'closeMenus' method within the controller was attempting to call
'querySelectorAll' on 'this.event', which is undefined within the Stimulus context.

This update corrects the 'closeMenus' method to reference 'this.element',
ensuring that it correctly targets the controller's DOM element.
@rainerdema rainerdema force-pushed the rainerd/admin/order/address-form branch from a2a2b90 to 3a5daf8 Compare November 8, 2023 18:01
@rainerdema rainerdema requested a review from elia November 8, 2023 18:01
@rainerdema rainerdema merged commit 378ed49 into solidusio:main Nov 8, 2023
8 checks passed
@rainerdema rainerdema deleted the rainerd/admin/order/address-form branch November 8, 2023 19:02
@elia elia changed the title [Admin] Order process: Integrate address form component for billing and shipping Add Order#use_shipping and address management to the admin dashboard Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_admin changelog:solidus_api Changes to the solidus_api gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants