-
Notifications
You must be signed in to change notification settings - Fork 168
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
MWPW-154098: Retain Modal param while traversing back from Commerce to Page #2781
MWPW-154098: Retain Modal param while traversing back from Commerce to Page #2781
Conversation
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #2781 +/- ##
==========================================
- Coverage 96.34% 96.33% -0.01%
==========================================
Files 243 243
Lines 55284 55322 +38
==========================================
+ Hits 53261 53294 +33
- Misses 2023 2028 +5 ☔ View full report in Codecov by Sentry. |
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR. |
9c1e5c4
to
720538c
Compare
047c360
to
559be32
Compare
6190111
to
61c4c59
Compare
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.
Thanks for addressing the comments.
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
When users open a modal by clicking a CTA on a merch card, navigate away, and then return, the modal needs to reopen automatically. However, this wasn't working because our catalog page uses custom modals without updating the URL hash. As a result, the URL doesn't retain information about the previously open modal.
To address this, this PR introduces URL hash management. We now add a hash to the URL whenever a modal is opened and remove it when the modal is closed. On page load, each CTA is assigned a unique hash. If the browser's URL contains the hash of a previously opened modal, we automatically trigger a click on the corresponding CTA to reopen the modal.
Resolves: MWPW-154098
Test URLs:
For PSI check: https://mwpw-154098-catalog-modal-hash--milo--mirafedas.hlx.live/docs/authoring/promotions/delayed-modal?martech=off&georouting=off&mep=off