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

[Theme] Show preview url for gift cards in the initial server logs #4582

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

frandiox
Copy link
Contributor

@frandiox frandiox commented Oct 4, 2024

WHY are these changes introduced?

The gift card preview URL is somewhat unknown. With this, we start showing it in the initial server logs:

image

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@frandiox frandiox requested a review from a team October 4, 2024 06:46
Copy link
Contributor

github-actions bot commented Oct 4, 2024

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-inner-loop

@frandiox
Copy link
Contributor Author

frandiox commented Oct 4, 2024

@karreiro I'm not sure what you meant with handling the /123/preview in the backend but we can keep the conversation here and iterate 🙏

Copy link
Contributor

github-actions bot commented Oct 4, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.73% (+0.02% 🔼)
8563/11774
🟡 Branches
69.72% (+0.03% 🔼)
4205/6031
🟡 Functions 71.69% 2211/3084
🟡 Lines
73.06% (+0.02% 🔼)
8105/11094

Test suite run success

1947 tests passing in 876 suites.

Report generated by 🧪jest coverage report action from 4f1e612

Copy link
Contributor

@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

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

LGTM 🙏

{
link: {
label: 'Preview your gift cards',
url: `${localUrl}/gift_cards/123/preview`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the ID matter here?

Copy link
Contributor

@jamesmengo jamesmengo Oct 4, 2024

Choose a reason for hiding this comment

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

Tried changing the ID value and it doesn't seem to matter, though it does need to be present from @EvilGenius13's testing

image

Copy link
Contributor

@karreiro karreiro Oct 7, 2024

Choose a reason for hiding this comment

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

What do you think about using ${localUrl}/gift_cards/[store_id]/preview for educational purposes, with this in mind https://shopify.dev/docs/storefronts/themes/architecture/templates/gift-card-liquid?

image

The theme editor uses something like ${localUrl}/gift_cards/123456/preview (just a bit longer). But, I think that adding the store id might be a good idea. We don't have the real store id, so we'd really lean into [store_id], which sounds a bit weird but nicer as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, looks good 👍

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you, @frandiox! LGTM and works as expected as well!

What do you think about re-ordering the links? I personally feel like they look a bit nicer like this:

image

@karreiro I'm not sure what you meant with handling the /123/preview in the backend but we can keep the conversation here and iterate 🙏

I mean that users wouldn't see the 123/preview part in the /gift_cards/123/preview path because we'd handle the /gift_cards route as a special case.

Please, let me know your thoughts about these comments :)

{
link: {
label: 'Preview your gift cards',
url: `${localUrl}/gift_cards/123/preview`,
Copy link
Contributor

@karreiro karreiro Oct 7, 2024

Choose a reason for hiding this comment

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

What do you think about using ${localUrl}/gift_cards/[store_id]/preview for educational purposes, with this in mind https://shopify.dev/docs/storefronts/themes/architecture/templates/gift-card-liquid?

image

The theme editor uses something like ${localUrl}/gift_cards/123456/preview (just a bit longer). But, I think that adding the store id might be a good idea. We don't have the real store id, so we'd really lean into [store_id], which sounds a bit weird but nicer as well.

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you for the updates, @frandiox!

@frandiox frandiox added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit 9010496 Oct 10, 2024
36 checks passed
@frandiox frandiox deleted the fd-gift-card-preview-url branch October 10, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants