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-157540: fix external modals #2806

Merged
merged 1 commit into from
Sep 2, 2024
Merged

MWPW-157540: fix external modals #2806

merged 1 commit into from
Sep 2, 2024

Conversation

3ch023
Copy link
Contributor

@3ch023 3ch023 commented Aug 30, 2024

Go live 4th September blocker.
Fix external modals on catalog.
checkoutLinkConfig[columnName] is an external CRM modal https://www.adobe.com/plans-fragments/modals/individual/modals-content-rich/all-apps/master.modal.html 
that gets localized and becomes '/plans-fragments/modals/individual/modals-content-rich/all-apps/master.modal.html'
that doesn't pass regex later on on openModal
} else if (/^https?:/.test(url)) {

Resolves: https://jira.corp.adobe.com/browse/MWPW-157540

Test URLs:

@3ch023 3ch023 added run-nala Run Nala Test Automation against PR commerce high priority Why is this a high priority? Blocker? Critical? Dependency? labels Aug 30, 2024
@3ch023 3ch023 requested a review from a team as a code owner August 30, 2024 09:49
Copy link
Contributor

aem-code-sync bot commented Aug 30, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link
Contributor

aem-code-sync bot commented Aug 30, 2024

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.89%. Comparing base (6012fcb) to head (45744ee).
Report is 21 commits behind head on stage.

Additional details and impacted files
@@           Coverage Diff           @@
##            stage    #2806   +/-   ##
=======================================
  Coverage   95.89%   95.89%           
=======================================
  Files         173      173           
  Lines       45889    45889           
=======================================
  Hits        44005    44005           
  Misses       1884     1884           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yesil
Copy link
Contributor

yesil commented Aug 30, 2024

https://www.adobe.com/plans-fragments/modals/individual/modals-content-rich/all-apps/master.modal.html is not a valid url for the feature. It was only developed for TWP and D2P modals and tested against where miniplans page URLs were used.

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.

Discussed with @3ch023 and looks good to me.

@@ -374,7 +374,7 @@ export async function openModal(e, url, offerType) {
if (/\/fragments\//.test(url)) {
const fragmentPath = url.split(/hlx.(page|live)/).pop();
modal = await openFragmentModal(fragmentPath, getModal);
} else if (/^https?:/.test(url)) {
Copy link
Contributor

@npeltier npeltier Aug 30, 2024

Choose a reason for hiding this comment

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

can we rather try /^(https:/)?\// ? this way it's either https (original requirement) or relative path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i can, but what is the point of such validation?
if author will put an invalid URL with or without validation the modal will just not show up, so I am not sure what it brings

Copy link
Contributor

Choose a reason for hiding this comment

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

ok if we neither wants https://... URLs i'm fine thought relative paths were an option

Copy link
Contributor

@npeltier npeltier left a comment

Choose a reason for hiding this comment

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

lgtm (thought originally there was something to forbid http:// & relative paths)

@afmicka afmicka added the verified PR has been E2E tested by a reviewer label Aug 30, 2024
@afmicka
Copy link
Contributor

afmicka commented Aug 30, 2024

Looks good to me too. Have checked it also together with @3ch023 and added the verified label.
@Roycethan could you please also have a separate look and mark it Ready for stage if all good on your end as well?

@Roycethan
Copy link

@3ch023 @afmicka i think you might have simulated the working fix, have covered regressions and marking to stage, lets check once its in Main, or if possible on stage.

@milo-pr-merge milo-pr-merge bot merged commit 8467b03 into stage Sep 2, 2024
32 checks passed
@milo-pr-merge milo-pr-merge bot deleted the MWPW-157540 branch September 2, 2024 08:17
@milo-pr-merge milo-pr-merge bot mentioned this pull request Sep 2, 2024
@mokimo mokimo restored the MWPW-157540 branch September 3, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce high priority Why is this a high priority? Blocker? Critical? Dependency? 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.

6 participants