Skip to content
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

Product Form: Support viewing product page for coming soon sites #14931

Merged
merged 13 commits into from
Jan 24, 2025

Conversation

itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Jan 21, 2025

Closes: #14924

Description

In an upcoming change, WooCommerce plugin will set all new sites to coming soon mode by default.

This PR updates the web view used in the product form for viewing product page to support viewing products in non-published sites.

Also: updated the background color of the product status badge in the product form.

Steps to reproduce

  • Log in to a WPCom store that's set to coming soon with existing products.
  • Navigate to the Products tab and select a published product.
  • Select the ellipsis menu on the top right and tap View Product in Store.
  • Confirm that you can see the product page with product details.
  • Switch to a self-hosted site while still authenticated with WPCom.
  • Confirm that viewing product page still work for this site.
  • Log out and back in to a self-hosted site using site credentials.
  • Confirm that viewing product page still work for this site.

Testing information

Tested on simulator iPhone 16 Pro iOS 18.2 and confirmed that I can see the product page for all products in both public and coming-soon stores.

Screenshots

/ Before After
Coming soon WPCom store

  • I have considered if this change warrants user-facing release notes and have added them to 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:

  • 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.

@itsmeichigo itsmeichigo added type: enhancement A request for an enhancement. feature: add/edit products Related to adding or editing products. labels Jan 21, 2025
@itsmeichigo itsmeichigo added this to the 21.5 milestone Jan 21, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 21, 2025

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14931-62dca84
Version21.4
Bundle IDcom.automattic.alpha.woocommerce
Commit62dca84
App Center BuildWooCommerce - Prototype Builds #12689
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@pmusolino pmusolino self-assigned this Jan 21, 2025
Copy link
Member

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

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

Something strange is happening in my testing store with this PR.

Both with "coming soon" mode enabled or disabled. When opening the web page of every type of product, a Jetpack stats page is loading for me.
While, if I open a published product using trunk, everything works as expected.
It's like in the version with AuthenticatedWebViewController, the redirect doesn't work properly.

Screenshot of what I see:
Simulator Screenshot - iPhone 16 Pro - 2025-01-21 at 17 58 36

@itsmeichigo
Copy link
Contributor Author

itsmeichigo commented Jan 22, 2025

Hey @pmusolino - can you confirm how you are authenticated in the app? E.g. with WPCom or application password?

Can you also try logging out and in again to see if you can reproduce the issue consistently? And does the issue happen to all your test sites?

@pmusolino
Copy link
Member

with WPCom or application password?

I'm authenticated with WPCom

Can you also try logging out and in again to see if you can reproduce the issue consistently? And does the issue happen to all your test sites?

  • It happens just on my testing store. If I try to use your testing store or other testing stores, everything works properly.
  • If I logout, then i login, I'm still able to reproduce the issue.

@itsmeichigo
Copy link
Contributor Author

Thanks @pmusolino for the review! It looks like the authenticated web view doesn't work if you're authenticated with a WPCom account and open the product page on a self-hosted site. I'll convert this PR back to draft and see how this should be updated.

@itsmeichigo itsmeichigo marked this pull request as draft January 23, 2025 14:17
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 23, 2025

1 Warning
⚠️ This PR is assigned to the milestone 21.5. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@itsmeichigo itsmeichigo changed the title Product Form: Support viewing product page for coming soon sites and non-public products Product Form: Support viewing product page for coming soon sites Jan 24, 2025
@itsmeichigo
Copy link
Contributor Author

Hi @pmusolino - I updated the PR with two changes:

  • Disable preview for non-public products.
  • Authenticate the preview page only for:
    • WPCom sites
    • Self-hosted sites when the user is authenticated with application password/nonce.

I updated the PR description accordingly - this PR is ready for another look!

@itsmeichigo itsmeichigo requested a review from pmusolino January 24, 2025 02:58
@itsmeichigo itsmeichigo marked this pull request as ready for review January 24, 2025 02:59
Copy link
Member

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

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

I tested all the cases mentioned in this PR, both with WPCom and Application Password login, and everything works fine now!

Just a nit on release-notes 👍

@@ -7,6 +7,7 @@
- [*] Receipts: Email receipts can now be sent to customers after failed payments using WooCommerce Stripe 9.1.0+. [https://github.com/woocommerce/woocommerce-ios/pull/14864].
- [*] Order Creation: orders are always created using the store's currency, not the user's [https://github.com/woocommerce/woocommerce-ios/pull/14907]
- [*] Dashboard: Updated the drag gesture on the Performance chart to show stats instantly. [https://github.com/woocommerce/woocommerce-ios/pull/14906]
- [*] Product Form: Support previewing products on coming-soon stores. [https://github.com/woocommerce/woocommerce-ios/pull/14931]
Copy link
Member

Choose a reason for hiding this comment

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

nit: I wonder if for end users it's more clear "Product Detail" instead of "Product Form".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll rewrite the message on the changelog anyway, I think this note is mostly for us developers. Since changing this will trigger CI again, I'll keep it as-is and merge the PR for the code freeze. I hope that's fine.

@itsmeichigo itsmeichigo merged commit ad5c9da into trunk Jan 24, 2025
12 checks passed
@itsmeichigo itsmeichigo deleted the enhancement/14924-previewing-product-page branch January 24, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: add/edit products Related to adding or editing products. type: enhancement A request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Products] Improve handling of Product Preview button to work with "Coming Soon" feature
4 participants