mirror of https://github.com/grafana/grafana.git
Added extension point id to the helpers so you can identify which extension triggered the event.
This commit is contained in:
parent
6248971d1e
commit
28bd6aebd2
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue