-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Bug] Fix url redirection, add default render path #387
Conversation
Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
@@ -53,7 +53,7 @@ export const WorkbenchApp = ({ | |||
<Switch> | |||
<Route | |||
exact | |||
path={`/${basePath}`} | |||
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `/${basePath}`} |
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.
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `/${basePath}`} | |
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `${basePath}`} |
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.
For the url re-direction to work correctly while the new home page is disabled the "/" is required or the following fail:
path={/${basePath}/:dataSource}
path={/${basePath}/accelerate/:dataSource}
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 see, yeah you are right.
Thanks @TackAdam for the bug fix 🥳 |
* bug fix for url redirection, support for modal popout Signed-off-by: Adam Tackett <[email protected]> * change check to isNav Signed-off-by: Adam Tackett <[email protected]> * fix formatting lint Signed-off-by: Adam Tackett <[email protected]> * simplify router case for empty Signed-off-by: Adam Tackett <[email protected]> --------- Signed-off-by: Adam Tackett <[email protected]> Co-authored-by: Adam Tackett <[email protected]> (cherry picked from commit 007eabd) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* bug fix for url redirection, support for modal popout Signed-off-by: Adam Tackett <[email protected]> * change check to isNav Signed-off-by: Adam Tackett <[email protected]> * fix formatting lint Signed-off-by: Adam Tackett <[email protected]> * simplify router case for empty Signed-off-by: Adam Tackett <[email protected]> --------- Signed-off-by: Adam Tackett <[email protected]> Co-authored-by: Adam Tackett <[email protected]> (cherry picked from commit 007eabd) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* bug fix for url redirection, support for modal popout * change check to isNav * fix formatting lint * simplify router case for empty --------- (cherry picked from commit 007eabd) Signed-off-by: Adam Tackett <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Adam Tackett <[email protected]>
* bug fix for url redirection, support for modal popout * change check to isNav * fix formatting lint * simplify router case for empty --------- (cherry picked from commit 007eabd) Signed-off-by: Adam Tackett <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Adam Tackett <[email protected]>
Description
closing : [navigation] Add default render path when there is basePath #381
(Support for dev tools under modal pop out)
As we will make dev tools as a full page modal when new nav toggle is turned on, we will use MemoryRouter to replace HashRouter in our page to avoid modifying the hosted page' hash. And this change will impact search relevance functionality.
And this PR adds a default path when there is no '/' route.
For more details please take a look on the comment: [navigation] feat: Render dev tools inside a modal OpenSearch-Dashboards#7938 (comment).
Tested url paths:
path={
/${basePath}/:dataSource
}path={
/${basePath}/accelerate/:dataSource
}path="/"
path={
/${basePath}
}Old Navigation:
OldNav4Links.mov
New Navigation:
NewNav4Links.mov
New Navigation + opensearch-project/OpenSearch-Dashboards#7938 modal applied.
NewNav+ModalPopout4Links.mov
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.