@@ -6,7 +6,6 @@
|
||||
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';
|
||||
@@ -88,6 +87,23 @@ export const catalogReactTranslationRef: TranslationRef<
|
||||
}
|
||||
>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ContextMenuItemComponent = (
|
||||
props: ContextMenuItemProps,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const contextMenuItemComponentDataRef: ConfigurableExtensionDataRef<
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ContextMenuItemProps = {
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export function convertLegacyEntityCardExtension(
|
||||
LegacyExtension: ComponentType<{}>,
|
||||
@@ -332,8 +348,8 @@ export const EntityContextMenuItemBlueprint: ExtensionBlueprint<{
|
||||
name: undefined;
|
||||
params: EntityContextMenuItemParams;
|
||||
output: ConfigurableExtensionDataRef<
|
||||
React_2.JSX.Element,
|
||||
'core.reactElement',
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
@@ -344,7 +360,6 @@ export const EntityContextMenuItemBlueprint: ExtensionBlueprint<{
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type EntityContextMenuItemParams =
|
||||
| FactoryLoaderParams
|
||||
| FactoryHrefParams
|
||||
| FactoryDialogParams;
|
||||
|
||||
@@ -418,31 +433,27 @@ export type EntityPredicateValue =
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FactoryDialogParams = {
|
||||
dialogLoader: () => Promise<
|
||||
({ dialog }: { dialog: DialogApiDialog }) => JSX.Element
|
||||
>;
|
||||
title: string;
|
||||
icon: JSX.Element;
|
||||
useOnClick: () => React_2.MouseEventHandler<HTMLLIElement>;
|
||||
useTitle: () => string;
|
||||
icon: React_2.JSX.Element;
|
||||
useIsDisabled?: () => boolean;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FactoryHrefParams =
|
||||
| {
|
||||
title: string;
|
||||
icon: JSX.Element;
|
||||
useTitle: () => string;
|
||||
icon: React_2.JSX.Element;
|
||||
useHref: () => string;
|
||||
useIsDisabled?: () => boolean;
|
||||
}
|
||||
| {
|
||||
title: string;
|
||||
icon: JSX.Element;
|
||||
useTitle: () => string;
|
||||
icon: React_2.JSX.Element;
|
||||
href: string;
|
||||
useIsDisabled?: () => boolean;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FactoryLoaderParams = {
|
||||
loader: () => Promise<JSX.Element>;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export function isOwnerOf(owner: Entity, entity: Entity): boolean;
|
||||
|
||||
|
||||
@@ -52,14 +52,17 @@ export type EntityContextMenuItemParams =
|
||||
| FactoryHrefParams
|
||||
| FactoryDialogParams;
|
||||
|
||||
/** @alpha */
|
||||
export type ContextMenuItemProps = {
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export type ContextMenuItemComponent = (
|
||||
props: ContextMenuItemProps,
|
||||
) => React.JSX.Element;
|
||||
|
||||
/** @alpha */
|
||||
export const contextMenuItemComponentDataRef =
|
||||
createExtensionDataRef<ContextMenuItemComponent>().with({
|
||||
id: 'catalog.contextMenuItemComponent',
|
||||
|
||||
@@ -7,10 +7,12 @@ import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ContextMenuItemComponent } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { defaultEntityContentGroups } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityCardType } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { EntityContextMenuItemParams } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
@@ -859,6 +861,45 @@ const _default: FrontendPlugin<
|
||||
filter?: string | EntityPredicate | ((entity: Entity) => boolean);
|
||||
};
|
||||
}>;
|
||||
'entity-context-menu-item:catalog/copy-entity-url': ExtensionDefinition<{
|
||||
kind: 'entity-context-menu-item';
|
||||
name: 'copy-entity-url';
|
||||
config: {};
|
||||
configInput: {};
|
||||
output: ConfigurableExtensionDataRef<
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: EntityContextMenuItemParams;
|
||||
}>;
|
||||
'entity-context-menu-item:catalog/inspect-entity': ExtensionDefinition<{
|
||||
kind: 'entity-context-menu-item';
|
||||
name: 'inspect-entity';
|
||||
config: {};
|
||||
configInput: {};
|
||||
output: ConfigurableExtensionDataRef<
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: EntityContextMenuItemParams;
|
||||
}>;
|
||||
'entity-context-menu-item:catalog/unregister-entity': ExtensionDefinition<{
|
||||
kind: 'entity-context-menu-item';
|
||||
name: 'unregister-entity';
|
||||
config: {};
|
||||
configInput: {};
|
||||
output: ConfigurableExtensionDataRef<
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
params: EntityContextMenuItemParams;
|
||||
}>;
|
||||
'nav-item:catalog': ExtensionDefinition<{
|
||||
kind: 'nav-item';
|
||||
name: undefined;
|
||||
@@ -1004,8 +1045,12 @@ const _default: FrontendPlugin<
|
||||
optional: false;
|
||||
}
|
||||
>;
|
||||
extraContextMenuItems: ExtensionInput<
|
||||
ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>,
|
||||
contextMenuItems: ExtensionInput<
|
||||
ConfigurableExtensionDataRef<
|
||||
ContextMenuItemComponent,
|
||||
'catalog.contextMenuItemComponent',
|
||||
{}
|
||||
>,
|
||||
{
|
||||
singleton: false;
|
||||
optional: false;
|
||||
|
||||
Reference in New Issue
Block a user