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:
Mau Rodríguez Morales 2022-03-15 07:45:42 -06:00 committed by GitHub
parent ed1e2bd405
commit c28ee0f08b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -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>
);

View file

@ -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`;