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 #12890

Closed atorresveiga closed 2 weeks ago

atorresveiga commented 2 weeks 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:

dangermattic commented 2 weeks ago
1 Warning
:warning: This PR is assigned to the milestone 21.1. 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 2 weeks 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
Commitb9516d90f87b5128114224e8cb79996d70f9b77b
Direct Downloadwoocommerce-wear-prototype-build-pr12890-b9516d9.apk
wpmobilebot commented 2 weeks 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
Commitb9516d90f87b5128114224e8cb79996d70f9b77b
Direct Downloadwoocommerce-prototype-build-pr12890-b9516d9.apk
codecov-commenter commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 17.74194% with 51 lines in your changes missing coverage. Please review.

Project coverage is 40.20%. Comparing base (28229e5) to head (b9516d9). Report is 11 commits behind head on trunk.

Files with missing lines Patch % Lines
...rders/creation/shipping/ShippingLineFormSection.kt 0.00% 49 Missing :warning:
...oid/ui/orders/creation/OrderCreateEditViewModel.kt 80.00% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #12890 +/- ## ============================================ - Coverage 40.22% 40.20% -0.02% - Complexity 5790 5791 +1 ============================================ Files 1252 1253 +1 Lines 71329 71359 +30 Branches 9958 9963 +5 ============================================ + Hits 28690 28693 +3 - Misses 40005 40030 +25 - Partials 2634 2636 +2 ```

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