Added extension point id to the helpers so you can identify which extension triggered the event.

This commit is contained in:
Marcus Andersson 2025-10-03 11:36:51 +02:00
parent 6248971d1e
commit 28bd6aebd2
No known key found for this signature in database
GPG Key ID: 5E93670261CE6DED
3 changed files with 4 additions and 0 deletions

View File

@ -165,6 +165,8 @@ export type PluginExtensionOpenModalOptions = {
export type PluginExtensionEventHelpers<Context extends object = object> = {
context?: Readonly<Context>;
// The ID of the extension point that triggered this event
extensionPointId: string;
// Opens a modal dialog and renders the provided React component inside it
openModal: (options: PluginExtensionOpenModalOptions) => void;
/**

View File

@ -405,6 +405,7 @@ describe('getPluginExtensions()', () => {
expect.objectContaining({
context,
openModal: expect.any(Function),
extensionPointId: extensionPoint2,
})
);
});

View File

@ -537,6 +537,7 @@ export function getLinkExtensionOnClick(
const helpers: PluginExtensionEventHelpers = {
context,
extensionPointId,
openModal: createOpenModalFunction(config),
openSidebar: (componentTitle, context) => {
appEvents.publish(