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 Variation Attributes] Do not use ignore case when renaming attributes #12608

Merged
merged 5 commits into from
Sep 16, 2024

Conversation

toupper
Copy link
Contributor

@toupper toupper commented Sep 13, 2024

Closes: #12561

Description

With this PR we fix the issue that was preventing users from renaming their variation attributes from a different case (upper to lower or vice-versa)

Note: there are other cases where we ignore the case for attributes: when adding a new attribute, or when deleting them. I preferred to leave them like that as we could have unexpected cases if we modified. For renaming it's ok though, as this case is isolated enough.

Steps to reproduce

  1. Attempt to rename a product attribute by just changing any number of characters from lower case to upper case.
  2. Then navigate back
  3. See a toast stating that the product attribute
  4. The product attribute won't be renamed and you'll have to remove it and add it again with the correct letter case. See screen recording for extra details.

Testing information

See steps to reproduce

The tests that have been performed

I ensured with the steps to reproduce that it's working properly. I also verified it in wc-admin

Images/gif

Before

CannotRename.mp4

After

Screen_Recording_20240913_160949_WooCommerce.Dev.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.

@toupper toupper marked this pull request as draft September 13, 2024 12:47
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 13, 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
Commitbaa7dea
Direct Downloadwoocommerce-wear-prototype-build-pr12608-baa7dea.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 13, 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
Commitbaa7dea
Direct Downloadwoocommerce-prototype-build-pr12608-baa7dea.apk

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 40.63%. Comparing base (d1eb9ed) to head (baa7dea).
Report is 6 commits behind head on trunk.

Files with missing lines Patch % Lines
...roid/ui/products/details/ProductDetailViewModel.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #12608      +/-   ##
============================================
+ Coverage     40.61%   40.63%   +0.02%     
- Complexity     5685     5687       +2     
============================================
  Files          1230     1230              
  Lines         69167    69167              
  Branches       9575     9575              
============================================
+ Hits          28093    28109      +16     
+ Misses        38493    38474      -19     
- Partials       2581     2584       +3     

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

@toupper toupper added type: bug A confirmed bug. feature: product details Related to adding or editing products, includes product settings. labels Sep 13, 2024
@toupper toupper added this to the 20.5 milestone Sep 13, 2024
@toupper toupper marked this pull request as ready for review September 13, 2024 14:19
@toupper toupper changed the title Do not use ignore case when renaming attributes [Product Variation Attributes] Do not use ignore case when renaming attributes Sep 13, 2024
@toupper toupper merged commit 5eb3cd9 into trunk Sep 16, 2024
15 checks passed
@toupper toupper deleted the issue/12561-fix-renaming-attribute branch September 16, 2024 15:10
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. type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product Attribute Rename Validations Are Not Case Sensitive
3 participants