Skip to content

[Woo POS] Coupons: Present different views when discerning from no coupons in store vs empty search #15578

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

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Apr 30, 2025

Closes WOOMOB-410

Description

This PR updates the PointOfSaleItemListEmptyView to show slightly different empty views when we find no coupons from store fetch vs no coupons from search. Finding no coupons from search will show a different text, as well as no CTA to create a coupon.

Testing information

  • Update PointOfSaleCouponService.providePointOfSaleCoupons to return .init(items: [], hasMorePages: false).
  • Navigate to POS > Coupons.
  • Observe the existing empty view, tap on search, look for a term.
  • Observe the empty view is different and has no CTA.
Screen.Recording.2025-05-02.at.11.38.11.mov

PD: The flicker in the video is because we return empty immediately for debugging


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 all devices (phone/tablet) and no regressions are added.

We cannot discern why coupons are empty when we fetch, we just set empty state if fetch is zero, and this is reused for both initial fetch and search fetch

We can intercept the fetch strategy and set a different context as associated value for default vs search strategy, so we can set the proper empty state with a context, then present different views as needed.
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Apr 30, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number29629
VersionPR #15578
Bundle IDcom.automattic.alpha.woocommerce
Commit65fd950
Installation URL022d67s9lgeq8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: coupons Related to basic fulfillment such as order tracking. feature: POS labels May 2, 2025
@iamgabrielma iamgabrielma added this to the 22.4 milestone May 2, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review May 2, 2025 04:44
@iamgabrielma iamgabrielma requested a review from staskus May 2, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: coupons Related to basic fulfillment such as order tracking. feature: POS type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants