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

[Product Global Unique Id] Edit and Validate Value #13022

Merged
merged 7 commits into from
Nov 28, 2024

Conversation

toupper
Copy link
Contributor

@toupper toupper commented Nov 28, 2024

Closes: #13017

Description

With this PR we let the users update the products and variations global unique identifier. We also validate the value to avoid it to contain characters other than numbers and hyphens.

Steps to reproduce

  1. Go to products
  2. Tap on a product.
  3. Tap on inventory. If it's a variable product, select a variation, and tap inventory.
  4. Edit the GTIN value. Test also that we validate the value effectively, that is, that we don't allow it to contain characters other than numbers and hyphens.
  5. Tap on back
  6. Update the product or variation

Duplicated case

Enter a duplicated GTIN value, that is, a value that was assigned before to a product or variation. When saving the product or variation you should see an error coming remotely. (See video)

Testing information

The tests that have been performed

I checked that:

  • It works for products and variations
  • It works for external products
  • We properly show the validation error

Images/gif

Products

Variations

Validating errors

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

@toupper toupper marked this pull request as draft November 28, 2024 09:34
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 28, 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
Commita934e1a
Direct Downloadwoocommerce-wear-prototype-build-pr13022-a934e1a.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 28, 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
Commita934e1a
Direct Downloadwoocommerce-prototype-build-pr13022-a934e1a.apk

@toupper toupper added the feature: product details Related to adding or editing products, includes product settings. label Nov 28, 2024
@toupper toupper added this to the 21.3 milestone Nov 28, 2024
@toupper toupper marked this pull request as ready for review November 28, 2024 10:33
@toupper toupper changed the title Issue/13017 product global unique id edit value [Product Global Unique Id] Edit and Validate Value Nov 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Project coverage is 39.74%. Comparing base (5d96bce) to head (a934e1a).
Report is 8 commits behind head on trunk.

Files with missing lines Patch % Lines
...e/android/ui/products/ProductInventoryViewModel.kt 82.35% 0 Missing and 3 partials ⚠️
...woocommerce/android/ui/products/ProductErrorExt.kt 50.00% 0 Missing and 1 partial ⚠️
...roid/ui/products/details/ProductDetailViewModel.kt 50.00% 0 Missing and 1 partial ⚠️
...ui/products/variations/VariationDetailViewModel.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #13022   +/-   ##
=========================================
  Coverage     39.73%   39.74%           
- Complexity     6038     6044    +6     
=========================================
  Files          1274     1274           
  Lines         73464    73485   +21     
  Branches      10075    10080    +5     
=========================================
+ Hits          29192    29207   +15     
  Misses        41699    41699           
- Partials       2573     2579    +6     

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

@toupper toupper merged commit f65200b into trunk Nov 28, 2024
16 checks passed
@toupper toupper deleted the issue/13017-product-global-unique-id-edit-value branch November 28, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product details Related to adding or editing products, includes product settings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit value from Product Details (Inventory)
3 participants