PluginExtensions: Adding extension point id to params passed to the content provider. (#111976)

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-07 10:39:22 +02:00
committed by GitHub
parent 26e147d01f
commit 3fea6e65f7
3 changed files with 4 additions and 0 deletions
@@ -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;
/**
@@ -405,6 +405,7 @@ describe('getPluginExtensions()', () => {
expect.objectContaining({
context,
openModal: expect.any(Function),
extensionPointId: extensionPoint2,
})
);
});
@@ -537,6 +537,7 @@ export function getLinkExtensionOnClick(
const helpers: PluginExtensionEventHelpers = {
context,
extensionPointId,
openModal: createOpenModalFunction(config),
openSidebar: (componentTitle, context) => {
appEvents.publish(