frontend-plugin-api: drop match strategy from PageLayout tabs

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-17 13:14:45 +01:00
parent b2dc178fb6
commit 40dfe4a00f
4 changed files with 12 additions and 6 deletions
@@ -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';
}
/**
+12 -2
View File
@@ -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}
/>
)}