Skip to content

Commit

Permalink
[Bug] Fix url redirection, add default render path (#387)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
TackAdam and Adam Tackett authored Sep 6, 2024
1 parent 8c545ae commit 007eabd
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 007eabd

Please sign in to comment.