Skip to content

Conversation

@iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Jan 16, 2023

Closes: #8636
Part of: #8530

Description

This PR adds the in-app feedback banner to the Order view, as well as the buttons to launch a survey and dismiss the banner.

At the moment the banner is not dismissible. Dismiss will be part of a different PR.

Changes

  • Adds a .IPP case as new FeedbackType
  • Upon configuring OrderListViewController, we set the existing top banner view (generally used to display the Order Creation banner, or an error) to a new IPP banner survey. This uses the existing TopBannerView and TopBannerViewModel components.
  • We have a new Publisher hideIPPFeedbackBanner, so we can listen to changes and set priorities on the different banners that should display in the view.
  • The banner has an ActionButton that will launch the feedback survey via the existing SurveyCoordinatingController component.

Testing instructions

  1. Go to Menu > Orders > See the banner at the top of the screen
  2. Tap "Share Feedback", a WebView showing a survey form will shop up. Scroll down and tap "Finish Survey", a "Feedback Sent" view will be shown and you'll be redirected to the Orders page.

Screenshots

Simulator Screen Recording - iPhone 11 Pro - 2023-01-16 at 12 40 23


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

@iamgabrielma iamgabrielma added type: enhancement A request for an enhancement. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: draft This is a draft, still need more work but can be reviewed and commented if asked. labels Jan 16, 2023
@iamgabrielma iamgabrielma added this to the 12.0 milestone Jan 16, 2023
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 16, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8640-1190434 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@iamgabrielma iamgabrielma marked this pull request as ready for review January 16, 2023 07:37
@iamgabrielma iamgabrielma requested a review from toupper January 16, 2023 07:37
@iamgabrielma iamgabrielma added status: do not merge Dependent on another PR, ready for review but not ready for merge. and removed status: draft This is a draft, still need more work but can be reviewed and commented if asked. labels Jan 16, 2023
@toupper
Copy link
Contributor

toupper commented Jan 16, 2023

Great job @iamgabrielma! I added a few comments regarding the code.
Apart from that, I have a question about the design. It seems like the banner message -"Rate your In-Person Payments experience"- does not go under the x button in the original design, unlike in your implementation:

Is that something we have to fix?


/// Identifier for the In-Person Payments feedback survey
///
case IPPFeedback
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor thing here, if the enum type name already contains "Feedback", I think we can omit it here: case IPP, as in the case of the ordersCreation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed on 83835c4


if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.IPPInAppFeedbackBanner) {
// TODO: Remove. Temporarily set to false so we can debug the IPPFeedback banner easily.
hideOrdersBanners = false
Copy link
Contributor

Choose a reason for hiding this comment

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

I find a bit dangerous to keep this in the PR, even if we add the TODO comment. If it goes to trunk it would disable the banner, which is not what we want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, that makes sense. I'll experiment with the @Published properties to find a better way to display/hide these.

I see we're using Publishers.CombineLatest(:) so the view model internal state figures out which banner should assign to the view, we could pass the $hideIPPFeedbackBanner binding as well there and use CombineLatest3(:) to figure this one out.

loadOrdersBannerVisibility()

if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.IPPInAppFeedbackBanner) {
loadIPPFeedbackBannerVisibility()
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a question here, don't we load the orders banner if the IPP Feedback is enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, after thinking further about it I was unsure how to fully deal with the Order Creation banner if IPP is enabled.

As per discussion at p1673883711765819?thread_ts=1673876649.359489&cid=C025A8VV728-slack-C025A8VV728 we're opting for:

  • Prioritise showing the IPP survey. Show the Order Creation banner only when the IPP survey is not displayed.
  • If IPP survey is dismissed, ideally we shouldn't show Order Creation immediately, unless that's the default behavior and changing it involves a certain level of complexity (as we're targeting to release this survey as soon as possible, then iterate later if needed).

}

func dismissIPPFeedbackBanner() {
print("dismiss tapped")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we delete these prints here, as this is likely going to trunk?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely, removed on ff7a3ee

@toupper toupper self-assigned this Jan 16, 2023
Base automatically changed from task/ippiaf-eligibility to trunk January 17, 2023 02:03
@iamgabrielma iamgabrielma removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Jan 17, 2023
The IPP banner dismiss logic is not part of this PR. Removing for simplicity and to reduce scope.
@iamgabrielma iamgabrielma requested a review from toupper January 18, 2023 03:23
@iamgabrielma
Copy link
Contributor Author

Thanks for your review @toupper , I addressed the comments and this is ready for review again 👍

I have a question about the design. It seems like the banner message -"Rate your In-Person Payments experience"- does not go under the x button in the original design, unlike in your implementation. Is that something we have to fix?

I missed that one! This UI tweak and others is something I'd leave for a different PR ( tracked here ), as we're using an existing component I wanted to work through its functionality first 👯

.map { hasError, hasDismissedIPPFeedbackBanner, hasDismissedOrdersBanners -> TopBanner in

if hasError {
guard !hasError else {
Copy link
Contributor

Choose a reason for hiding this comment

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

So beautiful code 😉

@toupper
Copy link
Contributor

toupper commented Jan 18, 2023

Great job @iamgabrielma! Impressive how you are progressively tackling more complex features 👏 :shipit:

@iamgabrielma iamgabrielma merged commit a487574 into trunk Jan 18, 2023
@iamgabrielma iamgabrielma deleted the issue/8636-orders-view-ippiaf-banner branch January 18, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IPPInAppFeedback] UI: Orders banner placement

4 participants