-
Notifications
You must be signed in to change notification settings - Fork 116
[Woo POS] Coupons: List - Enable Coupons - Wrap Up (Designer UI and Copy) #15505
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
[Woo POS] Coupons: List - Enable Coupons - Wrap Up (Designer UI and Copy) #15505
Conversation
…ate-designer-ui-and-copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
@@ -186,7 +186,9 @@ extension PointOfSaleAggregateModel { | |||
@available(iOS 17.0, *) | |||
extension PointOfSaleAggregateModel { | |||
func enableCoupons() async { | |||
await couponsController.enableCoupons() | |||
if await couponsController.enableCoupons() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going back and forth on whether enableCoupons
should return a result, or throw an error. In the end, opted for the most straightforward solution - return a boolean. Since the error is handled within the controller, there's no point in propagating the error for the controller's caller.
|
Co-authored-by: Copilot <[email protected]>
…ate-designer-ui-and-copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One small question shared inline.
@@ -140,7 +140,9 @@ extension PointOfSaleAggregateModel { | |||
@available(iOS 17.0, *) | |||
extension PointOfSaleAggregateModel { | |||
func enableCoupons() async { | |||
await couponsController.enableCoupons() | |||
if await couponsController.enableCoupons() { | |||
await couponsController.loadItems(base: .root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do this inside the couponsController
's enableCoupons
function as well? That would make it safe to call it directly on the now-exposed coupons controller. I don't know if that's a good thing or not, so just a question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back and forth on this. It felt like enableCoupons
would be a bit misleading since it would do more than just enable but maybe I was overthinking.
On another note, I think this whole method can be removed and we can call couponsController
directly from the ItemListView
. I'll update.
…ate-designer-ui-and-copy
…ate-designer-ui-and-copy
Description
A wrap-up of enabling coupons setting:
Steps to reproduce
Prerequisites:
Enable the use of coupon codes
in WooCommerce -> SettingsenableCouponsInPointOfSale
feature flagTesting information
Tested iPad Air 11 Inch M2 iOS 18.2
Screenshots
Enabling and loading coupons
enabling.and.loading.coupons.mp4
Error enabling coupons
error.enabling.coupons.mp4
RELEASE-NOTES.txt
if necessary.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: