fixing connectors path redirection issue no to navigate dashboard (#2187)
This commit is contained in:
parent
46bcbb3436
commit
a77869783b
1 changed files with 50 additions and 44 deletions
|
@ -7,57 +7,63 @@ import {
|
|||
clusterConnectConnectorsRelativePath,
|
||||
clusterConnectorNewRelativePath,
|
||||
getNonExactPath,
|
||||
clusterConnectorsPath,
|
||||
} from 'lib/paths';
|
||||
import { BreadcrumbRoute } from 'components/common/Breadcrumb/Breadcrumb.route';
|
||||
import useAppParams from 'lib/hooks/useAppParams';
|
||||
|
||||
import ListContainer from './List/ListContainer';
|
||||
import NewContainer from './New/NewContainer';
|
||||
import DetailsContainer from './Details/DetailsContainer';
|
||||
import EditContainer from './Edit/EditContainer';
|
||||
|
||||
const Connect: React.FC = () => (
|
||||
<Routes>
|
||||
<Route
|
||||
index
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<ListContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectorNewRelativePath}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<NewContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectConnectorEditRelativePath}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<EditContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={getNonExactPath(clusterConnectConnectorRelativePath)}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<DetailsContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectConnectorsRelativePath}
|
||||
element={<Navigate to="/" replace />}
|
||||
/>
|
||||
<Route
|
||||
path={RouteParams.connectName}
|
||||
element={<Navigate to="/" replace />}
|
||||
/>
|
||||
</Routes>
|
||||
);
|
||||
const Connect: React.FC = () => {
|
||||
const { clusterName } = useAppParams();
|
||||
|
||||
return (
|
||||
<Routes>
|
||||
<Route
|
||||
index
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<ListContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectorNewRelativePath}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<NewContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectConnectorEditRelativePath}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<EditContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={getNonExactPath(clusterConnectConnectorRelativePath)}
|
||||
element={
|
||||
<BreadcrumbRoute>
|
||||
<DetailsContainer />
|
||||
</BreadcrumbRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={clusterConnectConnectorsRelativePath}
|
||||
element={<Navigate to={clusterConnectorsPath(clusterName)} replace />}
|
||||
/>
|
||||
<Route
|
||||
path={RouteParams.connectName}
|
||||
element={<Navigate to="/" replace />}
|
||||
/>
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
||||
export default Connect;
|
||||
|
|
Loading…
Add table
Reference in a new issue