-
Notifications
You must be signed in to change notification settings - Fork 181
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
[MWPW-163470] Migrate Search in DA #3562
Conversation
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
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
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
@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 |
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.
@maagrawal16 Could you please have a look at review comments?
tools/search/ms-search.js
Outdated
} | ||
|
||
let fullURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + window.location.pathname + '#/search'; | ||
window.history.pushState({}, null, fullURL); |
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.
Simple syntax could have been window.location.replace(fullURL);
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.
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?
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.
That should be fine, you could skip this comment then!
tools/search/ms-search.js
Outdated
return; | ||
} | ||
|
||
let fullURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + window.location.pathname + '#/search'; |
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.
I suppose if fullUrl
is not getting updated, you could use const
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.
That's right, I'll change that.
Resolves: MWPW-163470
Test URLs: