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

MWPW-154098: Retain Modal param while traversing back from Commerce to Page #2781

Merged

Conversation

mirafedas
Copy link
Contributor

@mirafedas mirafedas commented Aug 23, 2024

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

Copy link
Contributor

aem-code-sync bot commented Aug 23, 2024

Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Aug 31, 2024
Copy link

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.33%. Comparing base (ec48f3c) to head (5c4f5fa).
Report is 8 commits behind head on stage.

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.
📢 Have feedback on the report? Share it here.

@3ch023 3ch023 removed the Stale label Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 7, 2024

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.

@mirafedas mirafedas added the run-nala Run Nala Test Automation against PR label Sep 10, 2024
libs/blocks/merch/merch.js Outdated Show resolved Hide resolved
libs/blocks/merch/merch.js Outdated Show resolved Hide resolved
Copy link
Contributor

@yesil yesil left a 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.

Copy link
Contributor

github-actions bot commented Oct 5, 2024

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.

@github-actions github-actions bot added the Stale label Oct 5, 2024
@mirafedas mirafedas removed the Stale label Oct 8, 2024
@afmicka afmicka added verified PR has been E2E tested by a reviewer Ready for Stage labels Oct 16, 2024
@milo-pr-merge milo-pr-merge bot merged commit 179732a into adobecom:stage Oct 21, 2024
22 checks passed
@mokimo mokimo mentioned this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Stage run-nala Run Nala Test Automation against PR verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants