woocommerce / woocommerce-android

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

Lock shipping lines when the screen is not idle or the order editable #12916

Closed atorresveiga closed 1 week ago

atorresveiga commented 1 week ago

Closes: #12869

Description

This PR fixes the issue of the shipping lines being editable at all times. It does that by introducing the ShippingLineSection class that includes the isEnabled state. Relying on the isEnabled state value, the shipping lines section now locks(disabled) the interaction with the shipping lines controls if the isEnabled property is false,

Testing information

  1. Go to Order List
  2. Click on Create Order
  3. Add a product
  4. Notice Add shipping button is disabled when the order is refreshed
  5. Add a shipping line
  6. Notice the added shipping line is disabled when the order is refreshed
  7. Add a product
  8. Notice Add shipping button is disabled when the order is refreshed

The tests that have been performed

  1. Testing that the shipping lines section is disabled when the order is refreshing or is not editable.

Images/gif

https://github.com/user-attachments/assets/5c87bad7-0993-44e5-a9cf-4539bd198466

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
📲 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
Commit873fcb9745318687b4788e023e91b57538ed35ae
Direct Downloadwoocommerce-wear-prototype-build-pr12916-873fcb9.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
Commit873fcb9745318687b4788e023e91b57538ed35ae
Direct Downloadwoocommerce-prototype-build-pr12916-873fcb9.apk
codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 34.11765% with 56 lines in your changes missing coverage. Please review.

Project coverage is 39.60%. Comparing base (bb66fa8) to head (873fcb9). Report is 11 commits behind head on trunk.

Files with missing lines Patch % Lines
...rders/creation/shipping/ShippingLineFormSection.kt 0.00% 50 Missing :warning:
...oid/ui/orders/creation/OrderCreateEditViewModel.kt 81.25% 0 Missing and 3 partials :warning:
...ui/orders/creation/shipping/ShippingLineDetails.kt 81.25% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #12916 +/- ## ============================================ - Coverage 39.61% 39.60% -0.01% - Complexity 5918 5926 +8 ============================================ Files 1259 1260 +1 Lines 72781 72817 +36 Branches 9955 9961 +6 ============================================ + Hits 28830 28840 +10 - Misses 41385 41409 +24 - Partials 2566 2568 +2 ```

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