Skip to content

Commit

Permalink
[Bug] Fix url redirection, add default render path (#387) (#392)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 0a189ec commit 077e071
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/components/Main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class Main extends React.Component<MainProps, MainState> {
refreshTree: false,
isAccelerationFlyoutOpened: false,
isCallOutVisible: false,
cluster: 'Indexes',
cluster: props.urlDataSource ? 'Data source Connections' : 'Indexes',
dataSourceOptions: [],
selectedMDSDataConnectionId: this.props.dataSourceMDSId,
mdsClusterName: '',
Expand Down
8 changes: 4 additions & 4 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const WorkbenchApp = ({
setActionMenu,
}: WorkbenchAppDeps) => {
const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled();
const basePath = isNavGroupEnabled ? 'opensearch-query-workbench' : '';
const basePath = isNavGroupEnabled ? '/opensearch-query-workbench' : '';

return (
<HashRouter>
Expand All @@ -53,7 +53,7 @@ export const WorkbenchApp = ({
<Switch>
<Route
exact
path={`/${basePath}`}
path={isNavGroupEnabled ? [`${basePath}`, `/`] : `/${basePath}`}
render={(props) => (
<Main
httpClient={http}
Expand All @@ -72,7 +72,7 @@ export const WorkbenchApp = ({
/>
<Route
exact
path={`/${basePath}/:dataSource`}
path={`${basePath}/:dataSource`}
render={(props) => (
<Main
httpClient={http}
Expand All @@ -91,7 +91,7 @@ export const WorkbenchApp = ({
/>
<Route
exact
path={`/${basePath}/accelerate/:dataSource`}
path={`${basePath}/accelerate/:dataSource`}
render={(props) => (
<Main
httpClient={http}
Expand Down

0 comments on commit 077e071

Please sign in to comment.