Skip to content

Conversation

@Ecarrion
Copy link
Contributor

Closes: #7920

Why

This PR makes sure that after selecting a product template the app:

  • Shows a loading screen
  • Cretes & fetch the template product
  • Displays the template product

Note: Refining on the product form for the template(auto-draft) product will come in a next PR #7949

How

  • Call Yosemite action to create and fetch a template product.
  • Show loading view controller while the remote request is being performed.
  • Show error notice if any error occurs.
  • Show product form if template creation is successful.

Demo

template.mov
normal.mov

Testing

  • On a store with less than 3 products, go to the products screen
  • Tap on the add a product CTA
  • Select Template & a product type
  • See that you are navigated to the template product.

Note: Updating the product and making sure it all works & looks correctly will come in a later PR


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

@Ecarrion Ecarrion added the feature: products onboarding Related to onboarding new users to manage products label Oct 31, 2022
@Ecarrion Ecarrion added this to the 11.1 milestone Oct 31, 2022
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 31, 2022

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 pr7992-5269f3e on your iPhone

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

@rachelmcr rachelmcr self-assigned this Nov 1, 2022
Copy link
Contributor

@rachelmcr rachelmcr left a comment

Choose a reason for hiding this comment

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

This looks great for most cases! I just ran into one problem where I'm blocked when the template request fails (details in comment).

switch result {
case .success(let product):
// Dismiss the loader and present the product.
inProgressViewController.dismiss(animated: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of moving this line to above the switch statement, to make sure the loader is dismissed in both success and failure cases? Right now, if the remote request fails the loader view is never dismissed:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! fixed in 5269f3e

error-demo.mov

@Ecarrion Ecarrion requested a review from rachelmcr November 1, 2022 14:07
Copy link
Contributor

@rachelmcr rachelmcr left a comment

Choose a reason for hiding this comment

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

🚀

@Ecarrion Ecarrion enabled auto-merge November 1, 2022 14:50
@Ecarrion Ecarrion merged commit 7bf500c into trunk Nov 1, 2022
@Ecarrion Ecarrion deleted the issue/7920-edpoint-integration branch November 1, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: products onboarding Related to onboarding new users to manage products

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Products Onboarding: Template endpoint integration

4 participants