Skip to content

[Shipping labels] Use fetched shipments in split shipment screen #13998

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

Open
wants to merge 13 commits into
base: issue/WOOMOB-416-split-shipment-config-endpoint
Choose a base branch
from

Conversation

irfano
Copy link
Contributor

@irfano irfano commented May 1, 2025

Closes WOOMOB-416

Description

This completes the UI parts of fetching shipments from the backend.

Warning

Review #13995 first.

Steps to reproduce

  1. On the web, create an order with shipments.
  2. In the app, open the Orders tab.
  3. Tap the order you created on the web.
  4. Tap on Create shipping label.
  5. Tap Split shipment.
  6. Verify that the shipments match those on the web.

Testing information

  • Test an order that has shipments
  • Test an order that has shipments with the same product type in separate shipments
  • Test a new order that has no shipments
  • Remove shipments
  • Move items

The tests that have been performed

Steps above

Images/gif

after.webm
  • 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.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@irfano irfano added feature: shipping labels Related to creating, ordering, or printing shipping labels. Task (new) labels May 1, 2025
@irfano irfano added this to the 22.4 milestone May 1, 2025
@irfano irfano requested a review from JorgeMucientes May 1, 2025 20:34
@@ -407,10 +409,10 @@ class WooShippingLabelCreationViewModel @Inject constructor(
else -> AddressStatus.UNVERIFIED
}

shippableItems.value = items
shippableItems.value = shipments.value.map { it.items }.flatten()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I used flatten() to display all items on the creation screen, since the creation screen doesn’t support shipments yet.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 1, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit6ec3886
Direct Downloadwoocommerce-wear-prototype-build-pr13998-6ec3886.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 1, 2025

📲 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
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit6ec3886
Direct Downloadwoocommerce-prototype-build-pr13998-6ec3886.apk

@JorgeMucientes JorgeMucientes self-assigned this May 2, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 84.09091% with 7 lines in your changes missing coverage. Please review.

Project coverage is 38.27%. Comparing base (1053e9e) to head (6ec3886).

Files with missing lines Patch % Lines
...ndroid/ui/orders/wooshippinglabels/GetShipments.kt 87.50% 0 Missing and 4 partials ⚠️
...orders/wooshippinglabels/models/ShipmentUIModel.kt 60.00% 2 Missing ⚠️
...hippinglabels/WooShippingLabelCreationViewModel.kt 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                                Coverage Diff                                 @@
##             issue/WOOMOB-416-split-shipment-config-endpoint   #13998   +/-   ##
==================================================================================
  Coverage                                              38.26%   38.27%           
- Complexity                                              9490     9495    +5     
==================================================================================
  Files                                                   2119     2120    +1     
  Lines                                                 116394   116405   +11     
  Branches                                               14937    14939    +2     
==================================================================================
+ Hits                                                   44542    44552   +10     
+ Misses                                                 67781    67780    -1     
- Partials                                                4071     4073    +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: shipping labels Related to creating, ordering, or printing shipping labels. Task (new)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants