woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

[Woo POS][Non Simple product types] Fetch variations list #12910

Closed AnirudhBhat closed 22 hours ago

AnirudhBhat commented 1 week ago

Closes: #12844

NOTE: I've extracted the UI in the products screen into separate file which is the cause for many line changes.

Description

This PR fetches variations list and displays on the variations screen.

It makes use of existing VariationsListHandler class for fetching variations.

Testing information

Testing Variations list

  1. Navigate to POS mode (more menu -> POS)
  2. Click on any variable product
  3. Ensure you see variations displayed

Testing Variations pagination

  1. Navigate to POS mode (more menu -> POS)
  2. Click on any variable product that has more than 10 variations
  3. Ensure you see variations displayed and it paginates as expected

Testing Variations pagination error

  1. Navigate to POS mode (more menu -> POS)
  2. Click on any variable product that has more than 10 variations
  3. Ensure you see variations displayed
  4. Turn on airplane mode
  5. Scroll down to end of the list
  6. Ensure you see snackbar message that says failed to fetch variations.

Testing Variations fetch error

  1. Navigate to POS mode (more menu -> POS)
  2. Turn on airplane mode
  3. Click on any variable product
  4. Ensure you see appropriate error screen

The tests that have been performed

Tested all the above scenario listed in both light and dark modes on emulator.

Images/gif

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:

dangermattic commented 1 week ago
4 Warnings
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
:warning: Class WooPosBaseViewState is missing tests, but unit-tests-exemption label was set to ignore this.
:warning: Class WooPosVariationEvents is missing tests, but unit-tests-exemption label was set to ignore this.
:warning: This PR is assigned to the milestone 21.2. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 week ago
📲 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
Commit4e26906a25bb758c236c6d4896526cd4e6afecec
Direct Downloadwoocommerce-wear-prototype-build-pr12910-4e26906.apk
wpmobilebot commented 1 week ago

📲 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
Commit4e26906a25bb758c236c6d4896526cd4e6afecec
Direct Downloadwoocommerce-prototype-build-pr12910-4e26906.apk
codecov-commenter commented 6 days ago

Codecov Report

Attention: Patch coverage is 32.02417% with 225 lines in your changes missing coverage. Please review.

Project coverage is 39.59%. Comparing base (fb44b49) to head (4e26906). Report is 210 commits behind head on trunk.

Files with missing lines Patch % Lines
...ce/android/ui/woopos/home/items/WooPosItemsList.kt 0.00% 183 Missing :warning:
...ome/items/variations/WooPosVariationsDataSource.kt 4.16% 23 Missing :warning:
...home/items/variations/WooPosVariationsViewModel.kt 85.13% 3 Missing and 8 partials :warning:
...droid/ui/woopos/home/items/WooPosItemsViewModel.kt 0.00% 4 Missing :warning:
.../ui/woopos/home/items/WooPosVariationsViewState.kt 83.33% 3 Missing :warning:
...oducts/variations/selector/VariationListHandler.kt 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #12910 +/- ## ============================================ - Coverage 39.63% 39.59% -0.04% - Complexity 5932 5956 +24 ============================================ Files 1261 1267 +6 Lines 72862 73179 +317 Branches 9965 10048 +83 ============================================ + Hits 28879 28976 +97 - Misses 41414 41629 +215 - Partials 2569 2574 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: