Skip to content

Conversation

@rossanafmenezes
Copy link
Contributor

@rossanafmenezes rossanafmenezes commented Nov 28, 2023

NOTE: This FluxC PR needs to be reviewed and merged first

Closes: #10266

Description

context: pdfdoF-47p-p2#comment-5261

This PR adds the logic to hide the Scan Barcode icon from the products list if the Woo Square plugin is active.

Testing instructions

  • Use a store where the Woo Square plugin is installed and active
  • Go to the product list
  • Make sure the Scan Barcode icon in the menu bar is not being displayed
  • Use a store without Woo Square
  • Go to the products list
  • Make sure the Scan Barcode icon is displayed in the menu.

Images/gif

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@rossanafmenezes rossanafmenezes changed the title Issue/10266 scan to update inventory hide icon square active [Scan to Update Inventory] Hide Scan Barcode Menu Item if store has Woo Square Plugin Active Nov 28, 2023
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 28, 2023

📲 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
FlavorJalapeno
Build TypeDebug
Commit3ebe432
Direct Downloadwoocommerce-prototype-build-pr10279-3ebe432.apk

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (ba3fa2f) 41.74% compared to head (3ebe432) 41.74%.
Report is 9 commits behind head on trunk.

Files Patch % Lines
...mmerce/android/ui/products/ProductListViewModel.kt 42.85% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #10279      +/-   ##
============================================
- Coverage     41.74%   41.74%   -0.01%     
  Complexity     4885     4885              
============================================
  Files           993      993              
  Lines         55873    55879       +6     
  Branches       7410     7411       +1     
============================================
+ Hits          23322    23324       +2     
- Misses        30487    30491       +4     
  Partials       2064     2064              

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

@samiuelson samiuelson self-assigned this Nov 29, 2023
Comment on lines 284 to 286
scanBarcodeMenuItem?.let { menuItem ->
if (showScan) menuItem.isVisible else menuItem.isVisible = false
}
Copy link
Contributor

@samiuelson samiuelson Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scanBarcodeMenuItem?.let { menuItem ->
if (showScan) menuItem.isVisible else menuItem.isVisible = false
}
scanBarcodeMenuItem?.isVisible = !productListViewModel.isSquarePluginActive()

💡 Could we simplify the code like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely. Done here 3b4a772

@samiuelson samiuelson added the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Nov 29, 2023
Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just added small improvement idea

@samiuelson samiuelson added this to the 16.6 milestone Dec 1, 2023
Base automatically changed from scan-to-update-inventory-1 to trunk December 7, 2023 19:30
@samiuelson samiuelson force-pushed the issue/10266-Scan-to-update-inventory-hide-icon-square-active branch from 71e7291 to 3b4a772 Compare December 8, 2023 07:53
@samiuelson samiuelson removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Dec 8, 2023
@samiuelson samiuelson enabled auto-merge December 8, 2023 12:29
@wpmobilebot
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 16.6. The due date for this milestone has already passed.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@samiuelson samiuelson merged commit 834883c into trunk Dec 8, 2023
@samiuelson samiuelson deleted the issue/10266-Scan-to-update-inventory-hide-icon-square-active branch December 8, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: product list Related to the product list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Edge cases] Hide "Scan" icon if WooCommerce Square plugin is active

5 participants