woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
314 stars 113 forks source link

[Shipping labels] Load the shipping services and rates from remote in the UI layer #14412

Closed rachelmcr closed 1 week ago

rachelmcr commented 1 week ago

Closes: #14393 ⚠️ Based on https://github.com/woocommerce/woocommerce-ios/pull/14411 ⚠️

Description

This adds support for loading the shipping label rates from remote in the Woo Shipping label flow. New behavior:

  1. When the shipping service section appears, it shows a loading indicator to show that the rates are being loaded.
  2. After the rates are loaded, the list of actual rates for the label are displayed.

Note that viewing the shipping service section still requires (for now) testing code to set the selected package.

How

Testing information

Prerequisite: The Woo Shipping extension installed and activated, with at least one order with the processing status and a physical product.

  1. Update WooShippingCreateLabelsViewModel to provide a value for selectedPackage that can be used in the remote request.
  2. Build and run the app with the revampedShippingLabelCreation feature flag enabled.
  3. Go to the Orders tab.
  4. Select an order eligible for a shipping label.
  5. Tap "Create Shipping Label."
  6. Confirm the Shipping service section is displayed with a loading view.
  7. Once the request is completed, confirm a list of shipping rates is displayed, and you can sort and select the rates as expected.
  8. Confirm that selecting a rate updates the shipment costs section in the "Shipment details" bottom sheet as expected.

Screenshots

https://github.com/user-attachments/assets/5013282b-9fed-43fc-b223-3c8e5b670fdd


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:

wpmobilebot commented 1 week ago

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14412-5756d86
Version21.1
Bundle IDcom.automattic.alpha.woocommerce
Commit5756d86bb926060977e52e62cac74eee71beb228
App Center BuildWooCommerce - Prototype Builds #11586

Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.