Rename PageTab to PageLayoutTab in @backstage/frontend-plugin-api
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -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.
|
||||
@@ -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;
|
||||
|
||||
@@ -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(<PageContent />);
|
||||
} 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);
|
||||
|
||||
@@ -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<JSX.Element | null>;
|
||||
tabs?: PageTab[];
|
||||
tabs?: PageLayoutTab[];
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user