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-163470] Migrate Search in DA #3562

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

maagrawal16
Copy link

  • Added Milo Studio : Search build for DA.
  • Now IMS token and tenant getting fetched from session storage.

Resolves: MWPW-163470

Test URLs:

a.Jb = function (a) {
return (
/^(?:\d{1,3}\.){3}\d{1,3}$/.test(a) ||
/^([a-f0-9:]+:+)+[a-f0-9]+$/.test(a)

Check failure

Code scanning / CodeQL

Inefficient regular expression High library

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0:'.
a.Jb = function (a) {
return (
/^(?:\d{1,3}\.){3}\d{1,3}$/.test(a) ||
/^([a-f0-9:]+:+)+[a-f0-9]+$/.test(a)

Check failure

Code scanning / CodeQL

Inefficient regular expression High library

This part of the regular expression may cause exponential backtracking on strings starting with '0' and containing many repetitions of '::'.
return 0 != a.indexOf('#') &&
0 != a.indexOf('about:') &&
0 != a.indexOf('opera:') &&
0 != a.indexOf('javascript:')

Check failure

Code scanning / CodeQL

Incomplete URL scheme check High library

This check does not consider data: and vbscript:.
@maagrawal16 maagrawal16 added trivial PR doesn't require E2E testing by a reviewer zero-impact labels Jan 28, 2025
@nkthakur48 nkthakur48 deleted the branch adobecom:milostudio-stage January 29, 2025 09:03
@nkthakur48 nkthakur48 closed this Jan 29, 2025
@nkthakur48 nkthakur48 reopened this Jan 29, 2025
@nkthakur48
Copy link
Contributor

nkthakur48 commented Jan 30, 2025

@maagrawal16 Please add entry point HTMLs (search.html) along with auth.js to facilitate communication with exec shell and bundled react app

A sample path for say search could be http://main--milo--adobecom.hlx.page/tools/search.html

Copy link
Contributor

@nkthakur48 nkthakur48 left a comment

Choose a reason for hiding this comment

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

@maagrawal16 Could you please have a look at review comments?

}

let fullURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + window.location.pathname + '#/search';
window.history.pushState({}, null, fullURL);
Copy link
Contributor

Choose a reason for hiding this comment

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

Simple syntax could have been window.location.replace(fullURL);

Copy link
Author

Choose a reason for hiding this comment

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

That would not work since this reloads the page and sets the token and tenant in the session storage again which would then not exists since we are removing the query params for the same. I can persist it in the session storage but I'll have to change some logic in the authentication. Should I go ahead with that?

Copy link
Contributor

Choose a reason for hiding this comment

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

That should be fine, you could skip this comment then!

return;
}

let fullURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + window.location.pathname + '#/search';
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose if fullUrl is not getting updated, you could use const

Copy link
Author

Choose a reason for hiding this comment

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

That's right, I'll change that.

@nkthakur48 nkthakur48 merged commit f13b8bd into adobecom:milostudio-stage Feb 7, 2025
5 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trivial PR doesn't require E2E testing by a reviewer zero-impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants