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

[Shipping labels] Add view models to provide data from order items to items section #13962

Merged
merged 7 commits into from
Sep 13, 2024

Conversation

rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Sep 13, 2024

Part of: #13550

Description

This adds view models to provide data for the following new views in the new shipping labels flow for the Woo Shipping extension:

  • WooShippingCreateLabelsView
  • WooShippingItems
  • WooShippingItemRow

A couple notes:

  • For now, these view models only provide data from the order items. A future PR will also add data from the products or product variations corresponding to those order items, to fill in the data not provided in the order (e.g. image URL, product weight, product dimensions).
  • For now, the views aren't as "dumb" as I'd like. I'm passing in the Order to get the item data for the views, and that causes some issues e.g. with the WooShippingCreateLabelsView preview. I accepted this for now because I didn't see a good way around it at this stage, but I hope to address it in a future PR.

Testing information

  1. Install and set up the Woo Shipping extension on your store.
  2. Build and run the app with the revampedShippingLabelCreation feature flag enabled.
  3. Create an order with the processing status and at least one physical product.
  4. In the order details, select "Create Shipping Label."
  5. In the shipping label flow, confirm the items section appears with the following details:
    1. The correct total number of items in the order (taking into account items with a quantity >1).
    2. The correct total price for all items in the order. (Note that the weight shown is a placeholder for now and will always say 1 kg.)
    3. Expand the items section and confirm there is a row for each item in the order. (Note that for now virtual items will still be shown, but those will be filtered out in a future PR.)
    4. Confirm that each row shows the correct quantity, item name, item price (per unit), and a list of variation attributes for product variations.

Screenshots

Simulator.Screen.Recording.-.iPhone.15.Plus.-.2024-09-13.at.15.23.02.mp4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

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 all devices (phone/tablet) and no regressions are added.

@rachelmcr rachelmcr added the feature: shipping labels Related to creating, ordering, or printing shipping labels. label Sep 13, 2024
@rachelmcr rachelmcr added this to the 20.5 milestone Sep 13, 2024
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

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 Numberpr13962-cfb9cc7
Version20.3
Bundle IDcom.automattic.alpha.woocommerce
Commitcfb9cc7
App Center BuildWooCommerce - Prototype Builds #10870
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@rachelmcr rachelmcr merged commit fbdc1c3 into trunk Sep 13, 2024
18 checks passed
@rachelmcr rachelmcr deleted the issue/13550-shipping-label-item-vms branch September 13, 2024 17:18
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants