Skip to content

Order create edit shipping lines support #11571

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

Conversation

atorresveiga
Copy link
Contributor

@atorresveiga atorresveiga commented May 22, 2024

Closes: #11393
Closes: #11395

Description

This PR introduces a significant enhancement by adding support for multiple shipping lines to the order create/edit flows. This is achieved by incorporating a new shipping section into the order create/edit screen. To display the shipping details, we utilize the current shipping lines field within the order, fetching the shipping method title from the GetShippingMethodsWithOtherValue use case. If the method title is not present in the local DB, it is simply not displayed.
In addition to displaying shipping lines, I cleaned up all legacy codes of the button interaction for the shipping section in the order totals sheet and the logic to display a warning when there was more than one shipping line.
Finally, I made a slight adjustment to rely on the shipping lines itemId field for the add/update/delete functions so that we can manage the order's shipping lines.

Testing instructions

TC1

  1. Open the app
  2. Tap on Add a new order
  3. Add a product to enable the shipping section
  4. Tap on add shipping and add a new shipping line
  5. Check that the new shipping section is displayed
  6. Optionally, you can remove the shipping line just added to check that when there is no shipping line, the shipping section is hidden.
  7. Tap on the plus button in the shipping section
  8. Add a shipping line line
  9. Check that the new shipping line is added to the order
  10. Edit one of the shipping lines
  11. Check that the changes are persisted
  12. Delete one of the shipping lines
  13. Check that the shipping line is removed from the order
  14. Create the order

TC2

  1. Using the order form TC1
  2. Tap on Edit to enter the edit flow
  3. Tap on the plus button in the shipping section
  4. Add a shipping line line
  5. Check that the new shipping line is added to the order
  6. Edit one of the shipping lines
  7. Check that the changes are persisted
  8. Delete one of the shipping lines
  9. Check that the shipping line is removed from the order

Images/gif

Screen_recording_20240522_163108.mp4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@atorresveiga atorresveiga added type: task An internally driven task. feature: order creation Related to the Order Creation feature labels May 22, 2024
@atorresveiga atorresveiga added this to the 18.8 milestone May 22, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented May 22, 2024

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 22, 2024

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
FlavorJalapeno
Build TypeDebug
Commit753dfdb
Direct Downloadwoocommerce-prototype-build-pr11571-753dfdb.apk

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

Attention: Patch coverage is 17.61006% with 131 lines in your changes are missing coverage. Please review.

Project coverage is 40.35%. Comparing base (84d4f66) to head (753dfdb).
Report is 31 commits behind head on issue/multiple-shipping-lines-support.

Files Patch % Lines
...rders/creation/shipping/ShippingLineFormSection.kt 0.00% 111 Missing ⚠️
...oid/ui/orders/creation/OrderCreateEditViewModel.kt 51.42% 13 Missing and 4 partials ⚠️
...woocommerce/android/ui/compose/theme/Typography.kt 0.00% 2 Missing ⚠️
...ers/creation/totals/OrderCreateEditTotalsHelper.kt 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##             issue/multiple-shipping-lines-support   #11571      +/-   ##
===========================================================================
- Coverage                                    40.44%   40.35%   -0.10%     
  Complexity                                    5202     5202              
===========================================================================
  Files                                         1084     1085       +1     
  Lines                                        63090    63201     +111     
  Branches                                      8643     8664      +21     
===========================================================================
- Hits                                         25518    25504      -14     
- Misses                                       35273    35397     +124     
- Partials                                      2299     2300       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@atorresveiga atorresveiga marked this pull request as ready for review May 23, 2024 17:09
Base automatically changed from issue/11394-shipping-lines-in-order-details to issue/multiple-shipping-lines-support May 23, 2024 17:13
@atorresveiga atorresveiga merged commit c834ca1 into issue/multiple-shipping-lines-support May 23, 2024
16 checks passed
@atorresveiga atorresveiga deleted the issue/11393-order-create-edit-shipping-lines-support branch May 23, 2024 17:50
Copy link

sentry-io bot commented May 28, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IllegalArgumentException: Navigation action/destination com.woocommerce.android:id/action_orderCreationFragment_to_customer... com.woocommerce.android.ui.orders.creation.navi... View Issue
  • ‼️ IllegalArgumentException: Navigation action/destination com.woocommerce.android:id/action_orderCreationFragment_to_couponSe... com.woocommerce.android.ui.orders.creation.navi... View Issue
  • ‼️ IllegalArgumentException: Navigation action/destination com.woocommerce.android:id/action_orderCreationFragment_to_orderCre... com.woocommerce.android.ui.orders.creation.navi... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order creation Related to the Order Creation feature type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants