Fix breadcrumbs behaviour for connectors (#1693)
Co-authored-by: Mau Rodriguez Morales <mrodriguezmorales@provectus.com> Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
parent
ed1e2bd405
commit
c28ee0f08b
2 changed files with 12 additions and 2 deletions
|
@ -1,10 +1,12 @@
|
|||
import React from 'react';
|
||||
import { Switch } from 'react-router-dom';
|
||||
import { Switch, Redirect } from 'react-router-dom';
|
||||
import {
|
||||
clusterConnectorsPath,
|
||||
clusterConnectsPath,
|
||||
clusterConnectorNewPath,
|
||||
clusterConnectConnectorPath,
|
||||
clusterConnectConnectorEditPath,
|
||||
clusterConnectConnectorsPath,
|
||||
} from 'lib/paths';
|
||||
import { BreadcrumbRoute } from 'components/common/Breadcrumb/Breadcrumb.route';
|
||||
|
||||
|
@ -43,6 +45,14 @@ const Connect: React.FC = () => (
|
|||
)}
|
||||
component={DetailsContainer}
|
||||
/>
|
||||
<Redirect
|
||||
from={clusterConnectConnectorsPath(':clusterName', ':connectName')}
|
||||
to={clusterConnectorsPath(':clusterName')}
|
||||
/>
|
||||
<Redirect
|
||||
from={`${clusterConnectsPath(':clusterName')}/:connectName`}
|
||||
to={clusterConnectorsPath(':clusterName')}
|
||||
/>
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -85,7 +85,7 @@ export const clusterConnectorsPath = (clusterName: ClusterName) =>
|
|||
`${clusterPath(clusterName)}/connectors`;
|
||||
export const clusterConnectorNewPath = (clusterName: ClusterName) =>
|
||||
`${clusterConnectorsPath(clusterName)}/create-new`;
|
||||
const clusterConnectConnectorsPath = (
|
||||
export const clusterConnectConnectorsPath = (
|
||||
clusterName: ClusterName,
|
||||
connectName: ConnectName
|
||||
) => `${clusterConnectsPath(clusterName)}/${connectName}/connectors`;
|
||||
|
|
Loading…
Add table
Reference in a new issue