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

[Bug] Fix url redirection, add default render path #387

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

TackAdam
Copy link
Contributor

@TackAdam TackAdam commented Sep 5, 2024

Description

  1. Fix url redirection
  2. Add default render path when there is basePath
    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

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Adam Tackett <tackadam@amazon.com>
public/components/app.tsx Outdated Show resolved Hide resolved
Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
public/components/app.tsx Outdated Show resolved Hide resolved
Adam Tackett and others added 2 commits September 5, 2024 15:42
Signed-off-by: Adam Tackett <tackadam@amazon.com>
@@ -53,7 +53,7 @@ export const WorkbenchApp = ({
<Switch>
<Route
exact
path={`/${basePath}`}
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `/${basePath}`}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `/${basePath}`}
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `${basePath}`}

Copy link
Contributor Author

@TackAdam TackAdam Sep 6, 2024

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}

Copy link
Member

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.

@ps48 ps48 merged commit 007eabd into opensearch-project:main Sep 6, 2024
7 of 11 checks passed
@ps48
Copy link
Member

ps48 commented Sep 6, 2024

Thanks @TackAdam for the bug fix 🥳

@ps48 ps48 added the bug Something isn't working label Sep 6, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2024
* bug fix for url redirection, support for modal popout

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* change check to isNav

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* fix formatting lint

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* simplify router case for empty

Signed-off-by: Adam Tackett <tackadam@amazon.com>

---------

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
(cherry picked from commit 007eabd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2024
* bug fix for url redirection, support for modal popout

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* change check to isNav

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* fix formatting lint

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* simplify router case for empty

Signed-off-by: Adam Tackett <tackadam@amazon.com>

---------

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
(cherry picked from commit 007eabd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ps48 pushed a commit that referenced this pull request Sep 10, 2024
* 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 <tackadam@amazon.com>
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 <tackadam@amazon.com>
ps48 pushed a commit that referenced this pull request Sep 10, 2024
* 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 <tackadam@amazon.com>
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 <tackadam@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants