From 62e0fd26adb38f645e15db5bf5783e34ebd1ff60 Mon Sep 17 00:00:00 2001 From: Mark Dunphy Date: Tue, 11 Mar 2025 11:20:46 -0400 Subject: [PATCH] api reports Signed-off-by: Mark Dunphy --- plugins/catalog-react/report-alpha.api.md | 50 +++++++++++++++++++ .../EntityContextMenuItemBlueprint.tsx | 1 + .../src/alpha/blueprints/index.ts | 2 + plugins/catalog/report-alpha.api.md | 7 +++ plugins/catalog/report.api.md | 2 + 5 files changed, 62 insertions(+) diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index e03367dd8b..a3d495bc2a 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -6,6 +6,7 @@ import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; +import { DialogApiDialog } from '@backstage/frontend-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { ExtensionBlueprint } from '@backstage/frontend-plugin-api'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; @@ -325,6 +326,28 @@ export interface EntityContentLayoutProps { }>; } +// @alpha (undocumented) +export const EntityContextMenuItemBlueprint: ExtensionBlueprint<{ + kind: 'entity-context-menu-item'; + name: undefined; + params: EntityContextMenuItemParams; + output: ConfigurableExtensionDataRef< + React_2.JSX.Element, + 'core.reactElement', + {} + >; + inputs: {}; + config: {}; + configInput: {}; + dataRefs: never; +}>; + +// @alpha (undocumented) +export type EntityContextMenuItemParams = + | FactoryLoaderParams + | FactoryHrefParams + | FactoryDialogParams; + // @alpha (undocumented) export const EntityHeaderBlueprint: ExtensionBlueprint<{ kind: 'entity-header'; @@ -393,6 +416,33 @@ export type EntityPredicateValue = $contains: EntityPredicateExpression; }; +// @alpha (undocumented) +export type FactoryDialogParams = { + dialogLoader: () => Promise< + ({ dialog }: { dialog: DialogApiDialog }) => JSX.Element + >; + title: string; + icon: JSX.Element; +}; + +// @alpha (undocumented) +export type FactoryHrefParams = + | { + title: string; + icon: JSX.Element; + useHref: () => string; + } + | { + title: string; + icon: JSX.Element; + href: string; + }; + +// @alpha (undocumented) +export type FactoryLoaderParams = { + loader: () => Promise; +}; + // @alpha export function isOwnerOf(owner: Entity, entity: Entity): boolean; diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.tsx b/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.tsx index bfb3eb17c7..5a4daeaf24 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.tsx @@ -53,6 +53,7 @@ export type FactoryDialogParams = { icon: JSX.Element; }; +/** @alpha */ export type EntityContextMenuItemParams = | FactoryLoaderParams | FactoryHrefParams diff --git a/plugins/catalog-react/src/alpha/blueprints/index.ts b/plugins/catalog-react/src/alpha/blueprints/index.ts index 857cdef5ea..0d4e65a39c 100644 --- a/plugins/catalog-react/src/alpha/blueprints/index.ts +++ b/plugins/catalog-react/src/alpha/blueprints/index.ts @@ -27,4 +27,6 @@ export { EntityContextMenuItemBlueprint, type FactoryHrefParams, type FactoryLoaderParams, + type FactoryDialogParams, + type EntityContextMenuItemParams, } from './EntityContextMenuItemBlueprint'; diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index c63f0f4fce..54f534a537 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -1004,6 +1004,13 @@ const _default: FrontendPlugin< optional: false; } >; + extraContextMenuItems: ExtensionInput< + ConfigurableExtensionDataRef, + { + singleton: false; + optional: false; + } + >; }; kind: 'page'; name: 'entity'; diff --git a/plugins/catalog/report.api.md b/plugins/catalog/report.api.md index 10e120d208..3ddf164802 100644 --- a/plugins/catalog/report.api.md +++ b/plugins/catalog/report.api.md @@ -404,6 +404,8 @@ export interface EntityLayoutProps { children?: ReactNode; // (undocumented) NotFoundComponent?: ReactNode; + // (undocumented) + extraMenuItems?: JSX.Element[]; parentEntityRelations?: string[]; // Warning: (ae-forgotten-export) The symbol "EntityContextMenuOptions" needs to be exported by the entry point index.d.ts //