frontend-plugin-api: drop match strategy from PageLayout tabs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -1825,8 +1825,6 @@ export interface PageTab {
|
||||
id: string;
|
||||
// (undocumented)
|
||||
label: string;
|
||||
// (undocumented)
|
||||
matchStrategy?: 'prefix' | 'exact';
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@@ -110,7 +110,6 @@ export const PageBlueprint = createExtensionBlueprint({
|
||||
label: tabTitle || path,
|
||||
icon: tabIcon,
|
||||
href: path,
|
||||
matchStrategy: 'prefix' as const,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ export interface PageTab {
|
||||
label: string;
|
||||
icon?: IconElement;
|
||||
href: string;
|
||||
matchStrategy?: 'prefix' | 'exact';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
} from '@backstage/core-components';
|
||||
import { PluginHeader } from '@backstage/ui';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export const Progress = SwappableComponentBlueprint.make({
|
||||
name: 'core-progress',
|
||||
@@ -74,14 +75,23 @@ export const PageLayout = SwappableComponentBlueprint.make({
|
||||
component: SwappablePageLayout,
|
||||
loader: () => (props: PageLayoutProps) => {
|
||||
const { title, icon, noHeader, headerActions, tabs, children } = props;
|
||||
if (tabs) {
|
||||
const tabsWithMatchStrategy = useMemo(
|
||||
() =>
|
||||
tabs?.map(tab => ({
|
||||
...tab,
|
||||
matchStrategy: 'prefix' as const,
|
||||
})),
|
||||
[tabs],
|
||||
);
|
||||
|
||||
if (tabsWithMatchStrategy) {
|
||||
return (
|
||||
<>
|
||||
{!noHeader && (
|
||||
<PluginHeader
|
||||
title={title}
|
||||
icon={icon}
|
||||
tabs={tabs}
|
||||
tabs={tabsWithMatchStrategy}
|
||||
customActions={headerActions}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user