Skip to content

Conversation

@atorresveiga
Copy link
Contributor

@atorresveiga atorresveiga commented Nov 22, 2024

Part of: #12998

Description

This PR connects the product card with real data. To achieve this, the GetShippableItems use case is used to get valid shippable items, and the WooShippingLabelCreationViewModel is updated to expose the results.

I decided to include two different classes to represent shippable items: ShippableItemModel and ShippableItemUI. ShippableItemModel will be useful for calculating totals, split shipments, etc., while ShippableItemUI will be the UI representation of the product, including currency format and dimensions.

Testing information

  1. Create an Order with the processing status on a store that can create shipping labels
  2. Tap on Orders
  3. Tap on the order created on step 1
  4. Tap on create shipping labels
  5. Check that the current shippable products are displayed in the product card

The tests that have been performed

  1. Checking the UI works as expected

Images/gif

Screen_recording_20241127_233702.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.

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.

@dangermattic
Copy link
Collaborator

dangermattic commented Nov 22, 2024

1 Warning
⚠️ Class WooShippingViewState is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 22, 2024

📲 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
Commit5716d2b
Direct Downloadwoocommerce-wear-prototype-build-pr12981-5716d2b.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 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
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit5716d2b
Direct Downloadwoocommerce-prototype-build-pr12981-5716d2b.apk

@atorresveiga atorresveiga changed the title Issue/12281 connecting products Connecting products Nov 25, 2024
@atorresveiga atorresveiga added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Nov 28, 2024
@atorresveiga atorresveiga added this to the 21.3 milestone Nov 28, 2024
@atorresveiga atorresveiga marked this pull request as ready for review November 28, 2024 05:38
@atorresveiga atorresveiga mentioned this pull request Nov 28, 2024
5 tasks
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 27.20588% with 99 lines in your changes missing coverage. Please review.

Project coverage is 40.24%. Comparing base (d44f104) to head (5716d2b).
Report is 12 commits behind head on trunk.

Files with missing lines Patch % Lines
...hippinglabels/WooShippingLabelCreationViewModel.kt 0.00% 45 Missing ⚠️
...rders/wooshippinglabels/WooShippingProductsCard.kt 0.00% 28 Missing ⚠️
...ooshippinglabels/WooShippingLabelCreationScreen.kt 0.00% 10 Missing ⚠️
...i/orders/wooshippinglabels/ShippableItemsMapper.kt 0.00% 9 Missing ⚠️
...ders/wooshippinglabels/models/StoreOptionsModel.kt 0.00% 5 Missing ⚠️
...d/ui/orders/wooshippinglabels/GetShippableItems.kt 96.15% 0 Missing and 1 partial ⚠️
...ers/wooshippinglabels/models/ShippableItemModel.kt 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #12981   +/-   ##
=========================================
  Coverage     40.24%   40.24%           
- Complexity     6135     6140    +5     
=========================================
  Files          1283     1287    +4     
  Lines         74037    74136   +99     
  Branches      10138    10142    +4     
=========================================
+ Hits          29795    29838   +43     
- Misses        41656    41710   +54     
- Partials       2586     2588    +2     

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

@ThomazFB ThomazFB self-assigned this Nov 28, 2024
Copy link
Contributor

@ThomazFB ThomazFB left a comment

Choose a reason for hiding this comment

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

Works as described, @atorresveiga! Nice solution taking advantage of the current Product repositories and great unit test coverage! 🚀

@atorresveiga atorresveiga merged commit bf61ebc into trunk Nov 29, 2024
15 checks passed
@atorresveiga atorresveiga deleted the issue/12281-connecting-products branch November 29, 2024 20:29
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. type: task An internally driven task. unit-tests-exemption

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants