diff --git a/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx b/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx index 18564cfedc..197cdb2239 100644 --- a/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx +++ b/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx @@ -29,7 +29,7 @@ export function useSelectedSubRoute(subRoutes: SubRoute[]): { const routes = subRoutes.map(({ path, children }) => ({ caseSensitive: false, - path: path ? `${path}/*` : '.', + path: `${path}/*`, element: children, })); @@ -68,7 +68,7 @@ export function RoutedTabs(props: { routes: SubRoute[] }) { const headerTabs = useMemo( () => routes.map(t => ({ - id: t.path ?? '.', + id: t.path, label: t.title, tabProps: t.tabProps, })), @@ -76,7 +76,7 @@ export function RoutedTabs(props: { routes: SubRoute[] }) { ); const onTabChange = (tabIndex: number) => { - let { path = '.' } = routes[tabIndex]; + let { path } = routes[tabIndex]; // Remove trailing /* path = path.replace(/\/\*$/, ''); // And remove leading / for relative navigation diff --git a/packages/core-components/src/components/TabbedLayout/types.ts b/packages/core-components/src/components/TabbedLayout/types.ts index 08ed905f4e..59e26305bd 100644 --- a/packages/core-components/src/components/TabbedLayout/types.ts +++ b/packages/core-components/src/components/TabbedLayout/types.ts @@ -18,7 +18,7 @@ import { TabProps } from '@material-ui/core/Tab'; import * as React from 'react'; export type SubRoute = { - path?: string; + path: string; title: string; children: JSX.Element; tabProps?: TabProps; diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx index 5dcbd702f5..2295034905 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx @@ -52,7 +52,7 @@ import { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu'; /** @public */ export type EntityLayoutRouteProps = { - path?: string; + path: string; title: string; children: JSX.Element; if?: (entity: Entity) => boolean;