diff --git a/.changeset/rename-page-tab-to-page-layout-tab.md b/.changeset/rename-page-tab-to-page-layout-tab.md new file mode 100644 index 0000000000..c0b1f9e807 --- /dev/null +++ b/.changeset/rename-page-tab-to-page-layout-tab.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': patch +--- + +Renamed the `PageTab` type to `PageLayoutTab`. The old `PageTab` name is now a deprecated type alias. diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 0ce1c78757..d925be726f 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -1802,13 +1802,13 @@ export interface PageLayoutProps { // (undocumented) noHeader?: boolean; // (undocumented) - tabs?: PageTab[]; + tabs?: PageLayoutTab[]; // (undocumented) title?: string; } // @public -export interface PageTab { +export interface PageLayoutTab { // (undocumented) href: string; // (undocumented) @@ -1819,6 +1819,9 @@ export interface PageTab { label: string; } +// @public @deprecated (undocumented) +export type PageTab = PageLayoutTab; + // @public export type PendingOAuthRequest = { provider: AuthProviderInfo; diff --git a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx index 18c1af0163..513da27faa 100644 --- a/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx +++ b/packages/frontend-plugin-api/src/blueprints/PageBlueprint.tsx @@ -23,7 +23,7 @@ import { createExtensionBlueprint, createExtensionInput, } from '../wiring'; -import { ExtensionBoundary, PageLayout, PageTab } from '../components'; +import { ExtensionBoundary, PageLayout, PageLayoutTab } from '../components'; import { useApi } from '../apis/system'; import { pluginHeaderActionsApiRef } from '../apis/definitions/PluginHeaderActionsApi'; @@ -97,7 +97,7 @@ export const PageBlueprint = createExtensionBlueprint({ yield coreExtensionData.reactElement(); } else if (inputs.pages.length > 0) { // Parent page with sub-pages - render header with tabs - const tabs: PageTab[] = inputs.pages.map(page => { + const tabs: PageLayoutTab[] = inputs.pages.map(page => { const path = page.get(coreExtensionData.routePath); const tabTitle = page.get(coreExtensionData.title); const tabIcon = page.get(coreExtensionData.icon); diff --git a/packages/frontend-plugin-api/src/components/PageLayout.tsx b/packages/frontend-plugin-api/src/components/PageLayout.tsx index 0eadc07ffd..d97d746665 100644 --- a/packages/frontend-plugin-api/src/components/PageLayout.tsx +++ b/packages/frontend-plugin-api/src/components/PageLayout.tsx @@ -22,13 +22,19 @@ import { createSwappableComponent } from './createSwappableComponent'; * Tab configuration for page navigation * @public */ -export interface PageTab { +export interface PageLayoutTab { id: string; label: string; icon?: IconElement; href: string; } +/** + * @deprecated Use {@link PageLayoutTab} instead + * @public + */ +export type PageTab = PageLayoutTab; + /** * Props for the PageLayout component * @public @@ -38,7 +44,7 @@ export interface PageLayoutProps { icon?: IconElement; noHeader?: boolean; headerActions?: Array; - tabs?: PageTab[]; + tabs?: PageLayoutTab[]; children?: ReactNode; } diff --git a/packages/frontend-plugin-api/src/components/index.ts b/packages/frontend-plugin-api/src/components/index.ts index e04cbb3c65..7cb109932a 100644 --- a/packages/frontend-plugin-api/src/components/index.ts +++ b/packages/frontend-plugin-api/src/components/index.ts @@ -25,4 +25,9 @@ export { } from './createSwappableComponent'; export { useAppNode } from './AppNodeProvider'; export * from './DefaultSwappableComponents'; -export { PageLayout, type PageLayoutProps, type PageTab } from './PageLayout'; +export { + PageLayout, + type PageLayoutProps, + type PageLayoutTab, + type PageTab, +} from './PageLayout';