diff --git a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.contextmenutrigger.md b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.contextmenutrigger.md
index 0a88e1e0a2ea..eec1e9ac7e3f 100644
--- a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.contextmenutrigger.md
+++ b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.contextmenutrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'>
+contextMenuTrigger: Trigger
```
diff --git a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddable.supportedtriggers.md b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddable.supportedtriggers.md
index 16676bc732b1..8a5efe60ba41 100644
--- a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddable.supportedtriggers.md
+++ b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddable.supportedtriggers.md
@@ -7,9 +7,9 @@
Signature:
```typescript
-supportedTriggers(): Array;
+supportedTriggers(): string[];
```
Returns:
-`Array`
+`string[]`
diff --git a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.iembeddable.supportedtriggers.md b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.iembeddable.supportedtriggers.md
index 5480f3b24664..bb560c11bf44 100644
--- a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.iembeddable.supportedtriggers.md
+++ b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.iembeddable.supportedtriggers.md
@@ -9,9 +9,9 @@ List of triggers that this embeddable will execute.
Signature:
```typescript
-supportedTriggers(): Array;
+supportedTriggers(): string[];
```
Returns:
-`Array`
+`string[]`
diff --git a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelbadgetrigger.md b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelbadgetrigger.md
index f6113c93a1c6..feacd0152d38 100644
--- a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelbadgetrigger.md
+++ b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelbadgetrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'>
+panelBadgeTrigger: Trigger
```
diff --git a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelnotificationtrigger.md b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelnotificationtrigger.md
index df606c11f64c..c831df19d295 100644
--- a/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelnotificationtrigger.md
+++ b/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.panelnotificationtrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-panelNotificationTrigger: Trigger<'PANEL_NOTIFICATION_TRIGGER'>
+panelNotificationTrigger: Trigger
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.md
index 19af63a679de..d8e527debcc4 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.md
@@ -7,7 +7,7 @@
Signature:
```typescript
-export interface Action extends Partial>>
+export interface Action extends Partial>>
```
## Properties
@@ -17,7 +17,7 @@ export interface Action extend
| [id](./kibana-plugin-plugins-ui_actions-public.action.id.md) | string
| A unique identifier for this action instance. |
| [MenuItem](./kibana-plugin-plugins-ui_actions-public.action.menuitem.md) | UiComponent<{
context: ActionExecutionContext<Context>;
}>
| UiComponent
to render when displaying this action as a context menu item. If not provided, getDisplayName
will be used instead. |
| [order](./kibana-plugin-plugins-ui_actions-public.action.order.md) | number
| Determined the order when there is more than one action matched to a trigger. Higher numbers are displayed first. |
-| [type](./kibana-plugin-plugins-ui_actions-public.action.type.md) | T
| The action type is what determines the context shape. |
+| [type](./kibana-plugin-plugins-ui_actions-public.action.type.md) | string
| The action type is what determines the context shape. |
## Methods
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.type.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.type.md
index c423df9d1324..6905f3deb441 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.type.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.action.type.md
@@ -9,5 +9,5 @@ The action type is what determines the context shape.
Signature:
```typescript
-readonly type: T;
+readonly type: string;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionbytype.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionbytype.md
deleted file mode 100644
index 3ceb96adadb1..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionbytype.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionByType](./kibana-plugin-plugins-ui_actions-public.actionbytype.md)
-
-## ActionByType type
-
-Signature:
-
-```typescript
-export declare type ActionByType = Action;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md
deleted file mode 100644
index eb7b1e5954ed..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) > [""](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md)
-
-## ActionContextMapping."" property
-
-Signature:
-
-```typescript
-[DEFAULT_ACTION]: BaseContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md
deleted file mode 100644
index eb0547bbf826..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) > [ACTION\_VISUALIZE\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md)
-
-## ActionContextMapping.ACTION\_VISUALIZE\_FIELD property
-
-Signature:
-
-```typescript
-[ACTION_VISUALIZE_FIELD]: VisualizeFieldContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md
deleted file mode 100644
index b44ed7510642..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) > [ACTION\_VISUALIZE\_GEO\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md)
-
-## ActionContextMapping.ACTION\_VISUALIZE\_GEO\_FIELD property
-
-Signature:
-
-```typescript
-[ACTION_VISUALIZE_GEO_FIELD]: VisualizeFieldContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_lens_field.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_lens_field.md
deleted file mode 100644
index 96370a07806d..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_lens_field.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) > [ACTION\_VISUALIZE\_LENS\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_lens_field.md)
-
-## ActionContextMapping.ACTION\_VISUALIZE\_LENS\_FIELD property
-
-Signature:
-
-```typescript
-[ACTION_VISUALIZE_LENS_FIELD]: VisualizeFieldContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md
deleted file mode 100644
index f83632dea0aa..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md)
-
-## ActionContextMapping interface
-
-Signature:
-
-```typescript
-export interface ActionContextMapping
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [""](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md) | BaseContext
| |
-| [ACTION\_VISUALIZE\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md) | VisualizeFieldContext
| |
-| [ACTION\_VISUALIZE\_GEO\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md) | VisualizeFieldContext
| |
-| [ACTION\_VISUALIZE\_LENS\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_lens_field.md) | VisualizeFieldContext
| |
-
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md
deleted file mode 100644
index ba4dc39088fe..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionDefinitionByType](./kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md)
-
-## ActionDefinitionByType type
-
-Signature:
-
-```typescript
-export declare type ActionDefinitionByType = ActionDefinition;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md
index 3271d8677995..d6f754a1ba45 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md
@@ -9,5 +9,5 @@ Action methods are executed with Context from trigger + [ActionExecutionMeta](./
Signature:
```typescript
-export declare type ActionExecutionContext = Context & ActionExecutionMeta;
+export declare type ActionExecutionContext = Context & ActionExecutionMeta;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiontype.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiontype.md
deleted file mode 100644
index 491658553100..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actiontype.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [ActionType](./kibana-plugin-plugins-ui_actions-public.actiontype.md)
-
-## ActionType type
-
-Signature:
-
-```typescript
-export declare type ActionType = keyof ActionContextMapping;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.createaction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.createaction.md
index 04ab36c2e3f5..8bb9094a1d8b 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.createaction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.createaction.md
@@ -7,16 +7,16 @@
Signature:
```typescript
-export declare function createAction(action: ActionDefinitionByType): ActionByType;
+export declare function createAction(action: ActionDefinition): Action;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| action | ActionDefinitionByType<T>
| |
+| action | ActionDefinition<Context>
| |
Returns:
-`ActionByType`
+`Action`
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md
index 76e347bddd16..9f009d1617cc 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md
@@ -24,11 +24,9 @@
| Interface | Description |
| --- | --- |
| [Action](./kibana-plugin-plugins-ui_actions-public.action.md) | |
-| [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) | |
| [ActionExecutionMeta](./kibana-plugin-plugins-ui_actions-public.actionexecutionmeta.md) | During action execution we can provide additional information, for example, trigger, that caused the action execution |
| [RowClickContext](./kibana-plugin-plugins-ui_actions-public.rowclickcontext.md) | |
| [Trigger](./kibana-plugin-plugins-ui_actions-public.trigger.md) | This is a convenience interface used to register a \*trigger\*.Trigger
specifies a named anchor to which Action
can be attached. When Trigger
is being \*called\* it creates a Context
object and passes it to the execute
method of an Action
.More than one action can be attached to a single trigger, in which case when trigger is \*called\* it first displays a context menu for user to pick a single action to execute. |
-| [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md) | |
| [UiActionsActionDefinition](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.md) | A convenience interface used to register an action. |
| [UiActionsPresentable](./kibana-plugin-plugins-ui_actions-public.uiactionspresentable.md) | Represents something that can be displayed to user in UI. |
| [UiActionsServiceParams](./kibana-plugin-plugins-ui_actions-public.uiactionsserviceparams.md) | |
@@ -52,12 +50,7 @@
| Type Alias | Description |
| --- | --- |
-| [ActionByType](./kibana-plugin-plugins-ui_actions-public.actionbytype.md) | |
-| [ActionDefinitionByType](./kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md) | |
| [ActionExecutionContext](./kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md) | Action methods are executed with Context from trigger + [ActionExecutionMeta](./kibana-plugin-plugins-ui_actions-public.actionexecutionmeta.md) |
-| [ActionType](./kibana-plugin-plugins-ui_actions-public.actiontype.md) | |
-| [TriggerContext](./kibana-plugin-plugins-ui_actions-public.triggercontext.md) | |
-| [TriggerId](./kibana-plugin-plugins-ui_actions-public.triggerid.md) | |
| [UiActionsPresentableGrouping](./kibana-plugin-plugins-ui_actions-public.uiactionspresentablegrouping.md) | |
| [UiActionsSetup](./kibana-plugin-plugins-ui_actions-public.uiactionssetup.md) | |
| [UiActionsStart](./kibana-plugin-plugins-ui_actions-public.uiactionsstart.md) | |
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.rowclicktrigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.rowclicktrigger.md
index aa1097d8c086..f05138296e6e 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.rowclicktrigger.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.rowclicktrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-rowClickTrigger: Trigger<'ROW_CLICK_TRIGGER'>
+rowClickTrigger: Trigger
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.id.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.id.md
index 5603c852ad39..5bf868720cde 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.id.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.id.md
@@ -9,5 +9,5 @@ Unique name of the trigger as identified in `ui_actions` plugin trigger registry
Signature:
```typescript
-id: ID;
+id: string;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.md
index ed76cfea9768..d829d7b87c17 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.trigger.md
@@ -13,7 +13,7 @@ More than one action can be attached to a single trigger, in which case when tri
Signature:
```typescript
-export interface Trigger
+export interface Trigger
```
## Properties
@@ -21,6 +21,6 @@ export interface Trigger
| Property | Type | Description |
| --- | --- | --- |
| [description](./kibana-plugin-plugins-ui_actions-public.trigger.description.md) | string
| A longer user friendly description of the trigger. |
-| [id](./kibana-plugin-plugins-ui_actions-public.trigger.id.md) | ID
| Unique name of the trigger as identified in ui_actions
plugin trigger registry. |
+| [id](./kibana-plugin-plugins-ui_actions-public.trigger.id.md) | string
| Unique name of the trigger as identified in ui_actions
plugin trigger registry. |
| [title](./kibana-plugin-plugins-ui_actions-public.trigger.title.md) | string
| User friendly name of the trigger. |
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontext.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontext.md
deleted file mode 100644
index 4ce95d27ecff..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontext.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContext](./kibana-plugin-plugins-ui_actions-public.triggercontext.md)
-
-## TriggerContext type
-
-Signature:
-
-```typescript
-export declare type TriggerContext = T extends TriggerId ? TriggerContextMapping[T] : never;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.__.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.__.md
deleted file mode 100644
index 17ad926f8ee8..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.__.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md) > [""](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.__.md)
-
-## TriggerContextMapping."" property
-
-Signature:
-
-```typescript
-[DEFAULT_TRIGGER]: TriggerContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md
deleted file mode 100644
index da7a7a8bfe64..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md)
-
-## TriggerContextMapping interface
-
-Signature:
-
-```typescript
-export interface TriggerContextMapping
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [""](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.__.md) | TriggerContext
| |
-| [ROW\_CLICK\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.row_click_trigger.md) | RowClickContext
| |
-| [VISUALIZE\_FIELD\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_field_trigger.md) | VisualizeFieldContext
| |
-| [VISUALIZE\_GEO\_FIELD\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_geo_field_trigger.md) | VisualizeFieldContext
| |
-
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.row_click_trigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.row_click_trigger.md
deleted file mode 100644
index cf253df33737..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.row_click_trigger.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md) > [ROW\_CLICK\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.row_click_trigger.md)
-
-## TriggerContextMapping.ROW\_CLICK\_TRIGGER property
-
-Signature:
-
-```typescript
-[ROW_CLICK_TRIGGER]: RowClickContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_field_trigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_field_trigger.md
deleted file mode 100644
index feaaffac8a23..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_field_trigger.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md) > [VISUALIZE\_FIELD\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_field_trigger.md)
-
-## TriggerContextMapping.VISUALIZE\_FIELD\_TRIGGER property
-
-Signature:
-
-```typescript
-[VISUALIZE_FIELD_TRIGGER]: VisualizeFieldContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_geo_field_trigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_geo_field_trigger.md
deleted file mode 100644
index 023490a2ae02..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_geo_field_trigger.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerContextMapping](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.md) > [VISUALIZE\_GEO\_FIELD\_TRIGGER](./kibana-plugin-plugins-ui_actions-public.triggercontextmapping.visualize_geo_field_trigger.md)
-
-## TriggerContextMapping.VISUALIZE\_GEO\_FIELD\_TRIGGER property
-
-Signature:
-
-```typescript
-[VISUALIZE_GEO_FIELD_TRIGGER]: VisualizeFieldContext;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggerid.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggerid.md
deleted file mode 100644
index 6e5a234e286f..000000000000
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.triggerid.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) > [TriggerId](./kibana-plugin-plugins-ui_actions-public.triggerid.md)
-
-## TriggerId type
-
-Signature:
-
-```typescript
-export declare type TriggerId = keyof TriggerContextMapping;
-```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.md
index 7c873715795e..a4de28ff4d1a 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.md
@@ -9,7 +9,7 @@ A convenience interface used to register an action.
Signature:
```typescript
-export interface ActionDefinition extends Partial>>
+export interface ActionDefinition extends Partial>>
```
## Properties
@@ -17,7 +17,7 @@ export interface ActionDefinition extends Part
| Property | Type | Description |
| --- | --- | --- |
| [id](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.id.md) | string
| ID of the action that uniquely identifies this action in the actions registry. |
-| [type](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md) | ActionType
| ID of the factory for this action. Used to construct dynamic actions. |
+| [type](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md) | string
| ID of the factory for this action. Used to construct dynamic actions. |
## Methods
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md
index 125f834e9036..c2cc8b41568c 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md
@@ -9,5 +9,5 @@ ID of the factory for this action. Used to construct dynamic actions.
Signature:
```typescript
-readonly type?: ActionType;
+readonly type?: string;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentable.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentable.md
index 03fa7fb6e447..659ea999b9f8 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentable.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentable.md
@@ -9,7 +9,7 @@ Represents something that can be displayed to user in UI.
Signature:
```typescript
-export interface Presentable
+export interface Presentable
```
## Properties
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentablegrouping.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentablegrouping.md
index a61ff65e39c6..2fb6c3e187d3 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentablegrouping.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionspresentablegrouping.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-export declare type PresentableGrouping = Array>;
+export declare type PresentableGrouping = Array>;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md
index f29d487d774e..30272cdcdc7f 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md
@@ -11,5 +11,5 @@
Signature:
```typescript
-readonly addTriggerAction: (triggerId: T, action: ActionDefinition | Action) => void;
+readonly addTriggerAction: (triggerId: string, action: ActionDefinition) => void;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md
index 1ebb30c49c0b..fd17c76b0ee9 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly attachAction: (triggerId: T, actionId: string) => void;
+readonly attachAction: (triggerId: string, actionId: string) => void;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md
index a6ff2489c6f0..bf9c589e59f6 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly detachAction: (triggerId: TriggerId, actionId: string) => void;
+readonly detachAction: (triggerId: string, actionId: string) => void;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md
index b20f08520c43..fb1a1ef14d31 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md
@@ -12,5 +12,5 @@
Signature:
```typescript
-readonly executeTriggerActions: (triggerId: T, context: TriggerContext) => Promise;
+readonly executeTriggerActions: (triggerId: string, context: object) => Promise;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md
index 300c46a47c47..32a4fcf8e6f8 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly getAction: >(id: string) => Action, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">;
+readonly getAction: >(id: string) => Action>;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md
index 95b737a8d6ca..b8f59e943f38 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly getTrigger: (triggerId: T) => TriggerContract;
+readonly getTrigger: (triggerId: string) => TriggerContract;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md
index 27c1b1eb48f1..c7c0eac755ae 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly getTriggerActions: (triggerId: T) => Action[];
+readonly getTriggerActions: (triggerId: string) => Action[];
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md
index edb7d2d3a155..9e3e38a6ac43 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly getTriggerCompatibleActions: (triggerId: T, context: TriggerContextMapping[T]) => Promise[]>;
+readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md
index 4fe8431770de..fced0bbc3cde 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md
@@ -21,19 +21,19 @@ export declare class UiActionsService
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [actions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.actions.md) | | ActionRegistry
| |
-| [addTriggerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T, action: ActionDefinition<TriggerContextMapping[T]> | Action<TriggerContextMapping[T], "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">) => void
| addTriggerAction
is similar to attachAction
as it attaches action to a trigger, but it also registers the action, if it has not been registered, yet.addTriggerAction
also infers better typing of the action
argument. |
-| [attachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T, actionId: string) => void
| |
+| [addTriggerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md) | | (triggerId: string, action: ActionDefinition) => void
| addTriggerAction
is similar to attachAction
as it attaches action to a trigger, but it also registers the action, if it has not been registered, yet.addTriggerAction
also infers better typing of the action
argument. |
+| [attachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md) | | (triggerId: string, actionId: string) => void
| |
| [clear](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.clear.md) | | () => void
| Removes all registered triggers and actions. |
-| [detachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md) | | (triggerId: TriggerId, actionId: string) => void
| |
-| [executeTriggerActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T, context: TriggerContext<T>) => Promise<void>
| |
+| [detachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md) | | (triggerId: string, actionId: string) => void
| |
+| [executeTriggerActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.executetriggeractions.md) | | (triggerId: string, context: object) => Promise<void>
| |
| [executionService](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.executionservice.md) | | UiActionsExecutionService
| |
| [fork](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.fork.md) | | () => UiActionsService
| "Fork" a separate instance of UiActionsService
that inherits all existing triggers and actions, but going forward all new triggers and actions added to this instance of UiActionsService
are only available within this instance. |
-| [getAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md) | | <T extends ActionDefinition<{}>>(id: string) => Action<ActionContext<T>, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">
| |
-| [getTrigger](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T) => TriggerContract<T>
| |
-| [getTriggerActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T) => Action<TriggerContextMapping[T], "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">[]
| |
-| [getTriggerCompatibleActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md) | | <T extends "" | "ROW_CLICK_TRIGGER" | "VISUALIZE_FIELD_TRIGGER" | "VISUALIZE_GEO_FIELD_TRIGGER" | "FILTER_TRIGGER" | "CONTEXT_MENU_TRIGGER" | "PANEL_BADGE_TRIGGER" | "PANEL_NOTIFICATION_TRIGGER" | "SELECT_RANGE_TRIGGER" | "VALUE_CLICK_TRIGGER">(triggerId: T, context: TriggerContextMapping[T]) => Promise<Action<TriggerContextMapping[T], "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">[]>
| |
+| [getAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md) | | <T extends ActionDefinition<object>>(id: string) => Action<ActionContext<T>>
| |
+| [getTrigger](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettrigger.md) | | (triggerId: string) => TriggerContract
| |
+| [getTriggerActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md) | | (triggerId: string) => Action[]
| |
+| [getTriggerCompatibleActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md) | | (triggerId: string, context: object) => Promise<Action[]>
| |
| [hasAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.hasaction.md) | | (actionId: string) => boolean
| |
-| [registerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md) | | <A extends ActionDefinition<{}>>(definition: A) => Action<ActionContext<A>, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">
| |
+| [registerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md) | | <A extends ActionDefinition<object>>(definition: A) => Action<ActionContext<A>>
| |
| [registerTrigger](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.registertrigger.md) | | (trigger: Trigger) => void
| |
| [triggers](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.triggers.md) | | TriggerRegistry
| |
| [triggerToActions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.triggertoactions.md) | | TriggerToActionsRegistry
| |
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md
index dee5f75f7c07..75289e8f3235 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-readonly registerAction: >(definition: A) => Action, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">;
+readonly registerAction: >(definition: A) => Action>;
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizefieldtrigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizefieldtrigger.md
index 15510bd3eb4a..eb62d36df84d 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizefieldtrigger.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizefieldtrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-visualizeFieldTrigger: Trigger<'VISUALIZE_FIELD_TRIGGER'>
+visualizeFieldTrigger: Trigger
```
diff --git a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizegeofieldtrigger.md b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizegeofieldtrigger.md
index faec6a69b71f..c547c33aaccb 100644
--- a/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizegeofieldtrigger.md
+++ b/docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.visualizegeofieldtrigger.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-visualizeGeoFieldTrigger: Trigger<'VISUALIZE_GEO_FIELD_TRIGGER'>
+visualizeGeoFieldTrigger: Trigger
```
diff --git a/examples/embeddable_examples/public/book/add_book_to_library_action.tsx b/examples/embeddable_examples/public/book/add_book_to_library_action.tsx
index 4ae3a545df0d..b36635feb3dc 100644
--- a/examples/embeddable_examples/public/book/add_book_to_library_action.tsx
+++ b/examples/embeddable_examples/public/book/add_book_to_library_action.tsx
@@ -35,6 +35,7 @@ export const createAddBookToLibraryAction = () =>
i18n.translate('embeddableExamples.book.addToLibrary', {
defaultMessage: 'Add Book To Library',
}),
+ id: ACTION_ADD_BOOK_TO_LIBRARY,
type: ACTION_ADD_BOOK_TO_LIBRARY,
order: 100,
getIconType: () => 'folderCheck',
diff --git a/examples/embeddable_examples/public/book/edit_book_action.tsx b/examples/embeddable_examples/public/book/edit_book_action.tsx
index 877e50560000..6fa5ff15716a 100644
--- a/examples/embeddable_examples/public/book/edit_book_action.tsx
+++ b/examples/embeddable_examples/public/book/edit_book_action.tsx
@@ -53,6 +53,7 @@ export const createEditBookAction = (getStartServices: () => Promise
i18n.translate('embeddableExamples.book.edit', { defaultMessage: 'Edit Book' }),
+ id: ACTION_EDIT_BOOK,
type: ACTION_EDIT_BOOK,
order: 100,
getIconType: () => 'documents',
diff --git a/examples/embeddable_examples/public/book/unlink_book_from_library_action.tsx b/examples/embeddable_examples/public/book/unlink_book_from_library_action.tsx
index ebab2c483c62..54857010a146 100644
--- a/examples/embeddable_examples/public/book/unlink_book_from_library_action.tsx
+++ b/examples/embeddable_examples/public/book/unlink_book_from_library_action.tsx
@@ -35,6 +35,7 @@ export const createUnlinkBookFromLibraryAction = () =>
i18n.translate('embeddableExamples.book.unlinkFromLibrary', {
defaultMessage: 'Unlink Book from Library Item',
}),
+ id: ACTION_UNLINK_BOOK_FROM_LIBRARY,
type: ACTION_UNLINK_BOOK_FROM_LIBRARY,
order: 100,
getIconType: () => 'folderExclamation',
diff --git a/examples/embeddable_examples/public/plugin.ts b/examples/embeddable_examples/public/plugin.ts
index 9b9770e40611..8e8f2ddfe212 100644
--- a/examples/embeddable_examples/public/plugin.ts
+++ b/examples/embeddable_examples/public/plugin.ts
@@ -51,21 +51,15 @@ import {
TodoRefEmbeddableFactory,
TodoRefEmbeddableFactoryDefinition,
} from './todo/todo_ref_embeddable_factory';
-import { ACTION_EDIT_BOOK, createEditBookAction } from './book/edit_book_action';
-import { BookEmbeddable, BOOK_EMBEDDABLE } from './book/book_embeddable';
+import { createEditBookAction } from './book/edit_book_action';
+import { BOOK_EMBEDDABLE } from './book/book_embeddable';
import {
BookEmbeddableFactory,
BookEmbeddableFactoryDefinition,
} from './book/book_embeddable_factory';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
-import {
- ACTION_ADD_BOOK_TO_LIBRARY,
- createAddBookToLibraryAction,
-} from './book/add_book_to_library_action';
-import {
- ACTION_UNLINK_BOOK_FROM_LIBRARY,
- createUnlinkBookFromLibraryAction,
-} from './book/unlink_book_from_library_action';
+import { createAddBookToLibraryAction } from './book/add_book_to_library_action';
+import { createUnlinkBookFromLibraryAction } from './book/unlink_book_from_library_action';
export interface EmbeddableExamplesSetupDependencies {
embeddable: EmbeddableSetup;
@@ -92,14 +86,6 @@ export interface EmbeddableExamplesStart {
factories: ExampleEmbeddableFactories;
}
-declare module '../../../src/plugins/ui_actions/public' {
- export interface ActionContextMapping {
- [ACTION_EDIT_BOOK]: { embeddable: BookEmbeddable };
- [ACTION_ADD_BOOK_TO_LIBRARY]: { embeddable: BookEmbeddable };
- [ACTION_UNLINK_BOOK_FROM_LIBRARY]: { embeddable: BookEmbeddable };
- }
-}
-
export class EmbeddableExamplesPlugin
implements
Plugin<
diff --git a/examples/ui_action_examples/public/hello_world_action.tsx b/examples/ui_action_examples/public/hello_world_action.tsx
index da20f4046451..54e3fbe10095 100644
--- a/examples/ui_action_examples/public/hello_world_action.tsx
+++ b/examples/ui_action_examples/public/hello_world_action.tsx
@@ -30,6 +30,7 @@ interface StartServices {
export const createHelloWorldAction = (getStartServices: () => Promise) =>
createAction({
+ id: ACTION_HELLO_WORLD,
type: ACTION_HELLO_WORLD,
getDisplayName: () => 'Hello World!',
execute: async () => {
diff --git a/examples/ui_action_examples/public/plugin.ts b/examples/ui_action_examples/public/plugin.ts
index 3a9f673261e3..1d896d330566 100644
--- a/examples/ui_action_examples/public/plugin.ts
+++ b/examples/ui_action_examples/public/plugin.ts
@@ -19,8 +19,8 @@
import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public';
import { UiActionsSetup, UiActionsStart } from '../../../src/plugins/ui_actions/public';
-import { createHelloWorldAction, ACTION_HELLO_WORLD } from './hello_world_action';
-import { helloWorldTrigger, HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger';
+import { createHelloWorldAction } from './hello_world_action';
+import { helloWorldTrigger } from './hello_world_trigger';
export interface UiActionExamplesSetupDependencies {
uiActions: UiActionsSetup;
@@ -30,16 +30,6 @@ export interface UiActionExamplesStartDependencies {
uiActions: UiActionsStart;
}
-declare module '../../../src/plugins/ui_actions/public' {
- export interface TriggerContextMapping {
- [HELLO_WORLD_TRIGGER_ID]: {};
- }
-
- export interface ActionContextMapping {
- [ACTION_HELLO_WORLD]: {};
- }
-}
-
export class UiActionExamplesPlugin
implements
Plugin {
diff --git a/examples/ui_actions_explorer/public/actions/actions.tsx b/examples/ui_actions_explorer/public/actions/actions.tsx
index 777bcd9c1811..1d9987ad73a2 100644
--- a/examples/ui_actions_explorer/public/actions/actions.tsx
+++ b/examples/ui_actions_explorer/public/actions/actions.tsx
@@ -38,7 +38,8 @@ export const ACTION_EDIT_USER = 'ACTION_EDIT_USER';
export const ACTION_TRIGGER_PHONE_USER = 'ACTION_TRIGGER_PHONE_USER';
export const ACTION_SHOWCASE_PLUGGABILITY = 'ACTION_SHOWCASE_PLUGGABILITY';
-export const showcasePluggability = createAction({
+export const showcasePluggability = createAction({
+ id: ACTION_SHOWCASE_PLUGGABILITY,
type: ACTION_SHOWCASE_PLUGGABILITY,
getDisplayName: () => 'This is pluggable! Any plugin can inject their actions here.',
execute: async (context: ActionExecutionContext) =>
@@ -49,13 +50,15 @@ export interface PhoneContext {
phone: string;
}
-export const makePhoneCallAction = createAction({
+export const makePhoneCallAction = createAction({
+ id: ACTION_CALL_PHONE_NUMBER,
type: ACTION_CALL_PHONE_NUMBER,
getDisplayName: () => 'Call phone number',
execute: async (context) => alert(`Pretend calling ${context.phone}...`),
});
-export const lookUpWeatherAction = createAction({
+export const lookUpWeatherAction = createAction({
+ id: ACTION_TRAVEL_GUIDE,
type: ACTION_TRAVEL_GUIDE,
getIconType: () => 'popout',
getDisplayName: () => 'View travel guide',
@@ -68,7 +71,8 @@ export interface CountryContext {
country: string;
}
-export const viewInMapsAction = createAction({
+export const viewInMapsAction = createAction({
+ id: ACTION_VIEW_IN_MAPS,
type: ACTION_VIEW_IN_MAPS,
getIconType: () => 'popout',
getDisplayName: () => 'View in maps',
@@ -109,7 +113,8 @@ function EditUserModal({
}
export const createEditUserAction = (getOpenModal: () => Promise) =>
- createAction({
+ createAction({
+ id: ACTION_EDIT_USER,
type: ACTION_EDIT_USER,
getIconType: () => 'pencil',
getDisplayName: () => 'Edit user',
@@ -126,7 +131,8 @@ export interface UserContext {
}
export const createTriggerPhoneTriggerAction = (getUiActionsApi: () => Promise) =>
- createAction({
+ createAction({
+ id: ACTION_TRIGGER_PHONE_USER,
type: ACTION_TRIGGER_PHONE_USER,
getDisplayName: () => 'Call phone number',
shouldAutoExecute: async () => true,
diff --git a/examples/ui_actions_explorer/public/app.tsx b/examples/ui_actions_explorer/public/app.tsx
index bc8bdee75047..38fc4e22b284 100644
--- a/examples/ui_actions_explorer/public/app.tsx
+++ b/examples/ui_actions_explorer/public/app.tsx
@@ -77,7 +77,7 @@ const ActionsExplorer = ({ uiActionsApi, openModal }: Props) => {
{
- const dynamicAction = createAction({
+ const dynamicAction = createAction({
id: `${ACTION_HELLO_WORLD}-${name}`,
type: ACTION_HELLO_WORLD,
getDisplayName: () => `Say hello to ${name}`,
diff --git a/examples/ui_actions_explorer/public/plugin.tsx b/examples/ui_actions_explorer/public/plugin.tsx
index b28e5e7a9f69..757a2f1dfa86 100644
--- a/examples/ui_actions_explorer/public/plugin.tsx
+++ b/examples/ui_actions_explorer/public/plugin.tsx
@@ -28,15 +28,6 @@ import {
createEditUserAction,
makePhoneCallAction,
showcasePluggability,
- UserContext,
- CountryContext,
- PhoneContext,
- ACTION_EDIT_USER,
- ACTION_SHOWCASE_PLUGGABILITY,
- ACTION_CALL_PHONE_NUMBER,
- ACTION_TRAVEL_GUIDE,
- ACTION_VIEW_IN_MAPS,
- ACTION_TRIGGER_PHONE_USER,
createTriggerPhoneTriggerAction,
} from './actions/actions';
import { DeveloperExamplesSetup } from '../../developer_examples/public';
@@ -51,23 +42,6 @@ interface SetupDeps {
developerExamples: DeveloperExamplesSetup;
}
-declare module '../../../src/plugins/ui_actions/public' {
- export interface TriggerContextMapping {
- [USER_TRIGGER]: UserContext;
- [COUNTRY_TRIGGER]: CountryContext;
- [PHONE_TRIGGER]: PhoneContext;
- }
-
- export interface ActionContextMapping {
- [ACTION_EDIT_USER]: UserContext;
- [ACTION_SHOWCASE_PLUGGABILITY]: {};
- [ACTION_CALL_PHONE_NUMBER]: PhoneContext;
- [ACTION_TRAVEL_GUIDE]: CountryContext;
- [ACTION_VIEW_IN_MAPS]: CountryContext;
- [ACTION_TRIGGER_PHONE_USER]: UserContext;
- }
-}
-
export class UiActionsExplorerPlugin implements Plugin {
public setup(core: CoreSetup, deps: SetupDeps) {
deps.uiActions.registerTrigger({
diff --git a/src/plugins/dashboard/public/application/actions/add_to_library_action.tsx b/src/plugins/dashboard/public/application/actions/add_to_library_action.tsx
index 880d40cc3c61..e0d59ef2a17b 100644
--- a/src/plugins/dashboard/public/application/actions/add_to_library_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/add_to_library_action.tsx
@@ -19,7 +19,7 @@
import _ from 'lodash';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import {
ViewMode,
PanelState,
@@ -39,7 +39,7 @@ export interface AddToLibraryActionContext {
embeddable: IEmbeddable;
}
-export class AddToLibraryAction implements ActionByType {
+export class AddToLibraryAction implements Action {
public readonly type = ACTION_ADD_TO_LIBRARY;
public readonly id = ACTION_ADD_TO_LIBRARY;
public order = 15;
diff --git a/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx b/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx
index d27e2d6dce65..e59cefed598e 100644
--- a/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx
@@ -21,7 +21,7 @@ import _ from 'lodash';
import uuid from 'uuid';
import { CoreStart } from 'src/core/public';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import { SavedObject } from '../../services/saved_objects';
import {
ViewMode,
@@ -45,7 +45,7 @@ export interface ClonePanelActionContext {
embeddable: IEmbeddable;
}
-export class ClonePanelAction implements ActionByType {
+export class ClonePanelAction implements Action {
public readonly type = ACTION_CLONE_PANEL;
public readonly id = ACTION_CLONE_PANEL;
public order = 45;
diff --git a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx
index fe14ce13d44b..3336f8dc5915 100644
--- a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx
@@ -19,7 +19,7 @@
import { dashboardExpandPanelAction } from '../../dashboard_strings';
import { IEmbeddable } from '../../services/embeddable';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import {
DASHBOARD_CONTAINER_TYPE,
DashboardContainer,
@@ -46,7 +46,7 @@ export interface ExpandPanelActionContext {
embeddable: IEmbeddable;
}
-export class ExpandPanelAction implements ActionByType {
+export class ExpandPanelAction implements Action {
public readonly type = ACTION_EXPAND_PANEL;
public readonly id = ACTION_EXPAND_PANEL;
public order = 7;
diff --git a/src/plugins/dashboard/public/application/actions/export_csv_action.tsx b/src/plugins/dashboard/public/application/actions/export_csv_action.tsx
index a31ecbea88ba..1048ce218974 100644
--- a/src/plugins/dashboard/public/application/actions/export_csv_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/export_csv_action.tsx
@@ -24,7 +24,7 @@ import { FormatFactory } from '../../../../data/common/field_formats/utils';
import { DataPublicPluginStart, exporters } from '../../services/data';
import { downloadMultipleAs } from '../../services/share';
import { Adapters, IEmbeddable } from '../../services/embeddable';
-import { ActionByType } from '../../services/ui_actions';
+import { Action } from '../../services/ui_actions';
import { dashboardExportCsvAction } from '../../dashboard_strings';
export const ACTION_EXPORT_CSV = 'ACTION_EXPORT_CSV';
@@ -44,7 +44,7 @@ export interface ExportContext {
* This is "Export CSV" action which appears in the context
* menu of a dashboard panel.
*/
-export class ExportCSVAction implements ActionByType {
+export class ExportCSVAction implements Action {
public readonly id = ACTION_EXPORT_CSV;
public readonly type = ACTION_EXPORT_CSV;
diff --git a/src/plugins/dashboard/public/application/actions/library_notification_action.tsx b/src/plugins/dashboard/public/application/actions/library_notification_action.tsx
index 13ccb279df82..a6d718846b9f 100644
--- a/src/plugins/dashboard/public/application/actions/library_notification_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/library_notification_action.tsx
@@ -19,7 +19,7 @@
import React from 'react';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import { reactToUiComponent } from '../../services/kibana_react';
import {
IEmbeddable,
@@ -38,7 +38,7 @@ export interface LibraryNotificationActionContext {
embeddable: IEmbeddable;
}
-export class LibraryNotificationAction implements ActionByType {
+export class LibraryNotificationAction implements Action {
public readonly id = ACTION_LIBRARY_NOTIFICATION;
public readonly type = ACTION_LIBRARY_NOTIFICATION;
public readonly order = 1;
diff --git a/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx
index 553a0b9770d0..909b758c511a 100644
--- a/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx
@@ -20,7 +20,7 @@
import { CoreStart } from 'src/core/public';
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../services/embeddable';
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import { openReplacePanelFlyout } from './open_replace_panel_flyout';
import { dashboardReplacePanelAction } from '../../dashboard_strings';
@@ -34,7 +34,7 @@ export interface ReplacePanelActionContext {
embeddable: IEmbeddable;
}
-export class ReplacePanelAction implements ActionByType {
+export class ReplacePanelAction implements Action {
public readonly type = ACTION_REPLACE_PANEL;
public readonly id = ACTION_REPLACE_PANEL;
public order = 3;
diff --git a/src/plugins/dashboard/public/application/actions/unlink_from_library_action.tsx b/src/plugins/dashboard/public/application/actions/unlink_from_library_action.tsx
index 93ceb7262425..901367b6af83 100644
--- a/src/plugins/dashboard/public/application/actions/unlink_from_library_action.tsx
+++ b/src/plugins/dashboard/public/application/actions/unlink_from_library_action.tsx
@@ -18,7 +18,7 @@
*/
import _ from 'lodash';
-import { ActionByType, IncompatibleActionError } from '../../services/ui_actions';
+import { Action, IncompatibleActionError } from '../../services/ui_actions';
import {
ViewMode,
PanelState,
@@ -38,7 +38,7 @@ export interface UnlinkFromLibraryActionContext {
embeddable: IEmbeddable;
}
-export class UnlinkFromLibraryAction implements ActionByType {
+export class UnlinkFromLibraryAction implements Action {
public readonly type = ACTION_UNLINK_FROM_LIBRARY;
public readonly id = ACTION_UNLINK_FROM_LIBRARY;
public order = 15;
diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx
index 4dff423098c5..166f4eaf3999 100644
--- a/src/plugins/dashboard/public/plugin.tsx
+++ b/src/plugins/dashboard/public/plugin.tsx
@@ -62,27 +62,15 @@ import {
} from './services/kibana_react';
import {
- ACTION_CLONE_PANEL,
- ACTION_EXPAND_PANEL,
- ACTION_REPLACE_PANEL,
ClonePanelAction,
- ClonePanelActionContext,
createDashboardContainerByValueRenderer,
DASHBOARD_CONTAINER_TYPE,
DashboardContainerFactory,
DashboardContainerFactoryDefinition,
ExpandPanelAction,
- ExpandPanelActionContext,
ReplacePanelAction,
- ReplacePanelActionContext,
- ACTION_UNLINK_FROM_LIBRARY,
- UnlinkFromLibraryActionContext,
UnlinkFromLibraryAction,
- ACTION_ADD_TO_LIBRARY,
- AddToLibraryActionContext,
AddToLibraryAction,
- ACTION_LIBRARY_NOTIFICATION,
- LibraryNotificationActionContext,
LibraryNotificationAction,
} from './application';
import {
@@ -94,11 +82,7 @@ import { createSavedDashboardLoader } from './saved_dashboards';
import { DashboardConstants } from './dashboard_constants';
import { PlaceholderEmbeddableFactory } from './application/embeddable/placeholder';
import { UrlGeneratorState } from '../../share/public';
-import {
- ACTION_EXPORT_CSV,
- ExportContext,
- ExportCSVAction,
-} from './application/actions/export_csv_action';
+import { ExportCSVAction } from './application/actions/export_csv_action';
import { dashboardFeatureCatalog } from './dashboard_strings';
declare module '../../share/public' {
@@ -147,18 +131,6 @@ export interface DashboardStart {
DashboardContainerByValueRenderer: ReturnType;
}
-declare module '../../../plugins/ui_actions/public' {
- export interface ActionContextMapping {
- [ACTION_EXPAND_PANEL]: ExpandPanelActionContext;
- [ACTION_REPLACE_PANEL]: ReplacePanelActionContext;
- [ACTION_CLONE_PANEL]: ClonePanelActionContext;
- [ACTION_ADD_TO_LIBRARY]: AddToLibraryActionContext;
- [ACTION_UNLINK_FROM_LIBRARY]: UnlinkFromLibraryActionContext;
- [ACTION_LIBRARY_NOTIFICATION]: LibraryNotificationActionContext;
- [ACTION_EXPORT_CSV]: ExportContext;
- }
-}
-
export class DashboardPlugin
implements
Plugin {
diff --git a/src/plugins/dashboard/public/services/ui_actions.ts b/src/plugins/dashboard/public/services/ui_actions.ts
index 4c9ac590191f..81bdad35d464 100644
--- a/src/plugins/dashboard/public/services/ui_actions.ts
+++ b/src/plugins/dashboard/public/services/ui_actions.ts
@@ -18,7 +18,7 @@
*/
export {
- ActionByType,
+ Action,
IncompatibleActionError,
UiActionsSetup,
UiActionsStart,
diff --git a/src/plugins/data/public/actions/apply_filter_action.ts b/src/plugins/data/public/actions/apply_filter_action.ts
index 84ce5b038262..909d6e97c221 100644
--- a/src/plugins/data/public/actions/apply_filter_action.ts
+++ b/src/plugins/data/public/actions/apply_filter_action.ts
@@ -19,7 +19,7 @@
import { i18n } from '@kbn/i18n';
import { toMountPoint } from '../../../kibana_react/public';
-import { ActionByType, createAction, IncompatibleActionError } from '../../../ui_actions/public';
+import { Action, createAction, IncompatibleActionError } from '../../../ui_actions/public';
import { getOverlays, getIndexPatterns } from '../services';
import { applyFiltersPopover } from '../ui/apply_filters';
import { Filter, FilterManager, TimefilterContract, esFilters } from '..';
@@ -41,8 +41,8 @@ async function isCompatible(context: ApplyGlobalFilterActionContext) {
export function createFilterAction(
filterManager: FilterManager,
timeFilter: TimefilterContract
-): ActionByType {
- return createAction({
+): Action {
+ return createAction({
type: ACTION_GLOBAL_APPLY_FILTER,
id: ACTION_GLOBAL_APPLY_FILTER,
order: 100,
diff --git a/src/plugins/data/public/actions/filters/create_filters_from_range_select.test.ts b/src/plugins/data/public/actions/filters/create_filters_from_range_select.test.ts
index 6dcfa4d02bcb..9830bf5b7ba8 100644
--- a/src/plugins/data/public/actions/filters/create_filters_from_range_select.test.ts
+++ b/src/plugins/data/public/actions/filters/create_filters_from_range_select.test.ts
@@ -29,12 +29,16 @@ import {
} from '../../../public';
import { dataPluginMock } from '../../../public/mocks';
import { setIndexPatterns, setSearchService } from '../../../public/services';
-import { TriggerContextMapping } from '../../../../ui_actions/public';
describe('brushEvent', () => {
const DAY_IN_MS = 24 * 60 * 60 * 1000;
const JAN_01_2014 = 1388559600000;
- let baseEvent: TriggerContextMapping['SELECT_RANGE_TRIGGER']['data'];
+ let baseEvent: {
+ table: any;
+ column: number;
+ range: number[];
+ timeFieldName?: string;
+ };
const mockField = {
name: 'time',
diff --git a/src/plugins/data/public/actions/select_range_action.ts b/src/plugins/data/public/actions/select_range_action.ts
index 3b84523d782f..c6d234665c05 100644
--- a/src/plugins/data/public/actions/select_range_action.ts
+++ b/src/plugins/data/public/actions/select_range_action.ts
@@ -18,7 +18,7 @@
*/
import { Datatable } from 'src/plugins/expressions/public';
-import { ActionByType, createAction, UiActionsStart } from '../../../../plugins/ui_actions/public';
+import { Action, createAction, UiActionsStart } from '../../../../plugins/ui_actions/public';
import { APPLY_FILTER_TRIGGER } from '../triggers';
import { createFiltersFromRangeSelectAction } from './filters/create_filters_from_range_select';
@@ -38,8 +38,8 @@ export const ACTION_SELECT_RANGE = 'ACTION_SELECT_RANGE';
export function createSelectRangeAction(
getStartServices: () => { uiActions: UiActionsStart }
-): ActionByType {
- return createAction({
+): Action {
+ return createAction({
type: ACTION_SELECT_RANGE,
id: ACTION_SELECT_RANGE,
shouldAutoExecute: async () => true,
diff --git a/src/plugins/data/public/actions/value_click_action.ts b/src/plugins/data/public/actions/value_click_action.ts
index 8f207e94e8fb..41c2943a6a5b 100644
--- a/src/plugins/data/public/actions/value_click_action.ts
+++ b/src/plugins/data/public/actions/value_click_action.ts
@@ -18,7 +18,7 @@
*/
import { Datatable } from 'src/plugins/expressions/public';
-import { ActionByType, createAction, UiActionsStart } from '../../../../plugins/ui_actions/public';
+import { Action, createAction, UiActionsStart } from '../../../../plugins/ui_actions/public';
import { APPLY_FILTER_TRIGGER } from '../triggers';
import { createFiltersFromValueClickAction } from './filters/create_filters_from_value_click';
import type { Filter } from '../../common/es_query/filters';
@@ -44,8 +44,8 @@ export interface ValueClickContext {
export function createValueClickAction(
getStartServices: () => { uiActions: UiActionsStart }
-): ActionByType {
- return createAction({
+): Action {
+ return createAction({
type: ACTION_VALUE_CLICK,
id: ACTION_VALUE_CLICK,
shouldAutoExecute: async () => true,
diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts
index 28a551b324f1..0d94fd3b2ef3 100644
--- a/src/plugins/data/public/plugin.ts
+++ b/src/plugins/data/public/plugin.ts
@@ -54,11 +54,6 @@ import {
createFilterAction,
createFiltersFromValueClickAction,
createFiltersFromRangeSelectAction,
- ApplyGlobalFilterActionContext,
- ACTION_SELECT_RANGE,
- ACTION_VALUE_CLICK,
- SelectRangeActionContext,
- ValueClickActionContext,
createValueClickAction,
createSelectRangeAction,
} from './actions';
@@ -67,19 +62,6 @@ import { SavedObjectsClientPublicToCommon } from './index_patterns';
import { getIndexPatternLoad } from './index_patterns/expressions';
import { UsageCollectionSetup } from '../../usage_collection/public';
import { getTableViewDescription } from './utils/table_inspector_view';
-import { TriggerId } from '../../ui_actions/public';
-
-declare module '../../ui_actions/public' {
- export interface TriggerContextMapping {
- [APPLY_FILTER_TRIGGER]: ApplyGlobalFilterActionContext;
- }
-
- export interface ActionContextMapping {
- [ACTION_GLOBAL_APPLY_FILTER]: ApplyGlobalFilterActionContext;
- [ACTION_SELECT_RANGE]: SelectRangeActionContext;
- [ACTION_VALUE_CLICK]: ValueClickActionContext;
- }
-}
export class DataPublicPlugin
implements
@@ -126,14 +108,14 @@ export class DataPublicPlugin
);
uiActions.addTriggerAction(
- 'SELECT_RANGE_TRIGGER' as TriggerId,
+ 'SELECT_RANGE_TRIGGER',
createSelectRangeAction(() => ({
uiActions: startServices().plugins.uiActions,
}))
);
uiActions.addTriggerAction(
- 'VALUE_CLICK_TRIGGER' as TriggerId,
+ 'VALUE_CLICK_TRIGGER',
createValueClickAction(() => ({
uiActions: startServices().plugins.uiActions,
}))
diff --git a/src/plugins/data/public/triggers/apply_filter_trigger.ts b/src/plugins/data/public/triggers/apply_filter_trigger.ts
index 816c1737608d..07422eb313ae 100644
--- a/src/plugins/data/public/triggers/apply_filter_trigger.ts
+++ b/src/plugins/data/public/triggers/apply_filter_trigger.ts
@@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
import { Trigger } from '../../../ui_actions/public';
export const APPLY_FILTER_TRIGGER = 'FILTER_TRIGGER';
-export const applyFilterTrigger: Trigger<'FILTER_TRIGGER'> = {
+export const applyFilterTrigger: Trigger = {
id: APPLY_FILTER_TRIGGER,
title: i18n.translate('data.triggers.applyFilterTitle', {
defaultMessage: 'Apply filter',
diff --git a/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx b/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx
index f842568859fc..f4d1a8988da7 100644
--- a/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx
+++ b/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx
@@ -38,7 +38,7 @@ import { DataViewRow, DataViewColumn } from '../types';
import { IUiSettingsClient } from '../../../../../../core/public';
import { Datatable, DatatableColumn } from '../../../../../expressions/public';
import { FieldFormatsStart } from '../../../field_formats';
-import { TriggerId, UiActionsStart } from '../../../../../ui_actions/public';
+import { UiActionsStart } from '../../../../../ui_actions/public';
interface DataTableFormatState {
columns: DataViewColumn[];
@@ -112,7 +112,7 @@ export class DataTableFormat extends Component {
const value = table.rows[rowIndex][column.id];
const eventData = { table, column: columnIndex, row: rowIndex, value };
- uiActions.executeTriggerActions('VALUE_CLICK_TRIGGER' as TriggerId, {
+ uiActions.executeTriggerActions('VALUE_CLICK_TRIGGER', {
data: { data: [eventData] },
});
}}
@@ -145,7 +145,7 @@ export class DataTableFormat extends Component {
const value = table.rows[rowIndex][column.id];
const eventData = { table, column: columnIndex, row: rowIndex, value };
- uiActions.executeTriggerActions('VALUE_CLICK_TRIGGER' as TriggerId, {
+ uiActions.executeTriggerActions('VALUE_CLICK_TRIGGER', {
data: { data: [eventData], negate: true },
});
}}
diff --git a/src/plugins/embeddable/public/bootstrap.ts b/src/plugins/embeddable/public/bootstrap.ts
index efaff42c19e2..7898fac16fd9 100644
--- a/src/plugins/embeddable/public/bootstrap.ts
+++ b/src/plugins/embeddable/public/bootstrap.ts
@@ -18,44 +18,13 @@
*/
import { UiActionsSetup } from '../../ui_actions/public';
import {
- ACTION_ADD_PANEL,
- ACTION_CUSTOMIZE_PANEL,
- ACTION_EDIT_PANEL,
- ACTION_INSPECT_PANEL,
- CONTEXT_MENU_TRIGGER,
contextMenuTrigger,
- EmbeddableContext,
- PANEL_BADGE_TRIGGER,
- PANEL_NOTIFICATION_TRIGGER,
panelBadgeTrigger,
panelNotificationTrigger,
- RangeSelectContext,
- REMOVE_PANEL_ACTION,
- SELECT_RANGE_TRIGGER,
selectRangeTrigger,
- ValueClickContext,
- VALUE_CLICK_TRIGGER,
valueClickTrigger,
} from './lib';
-declare module '../../ui_actions/public' {
- export interface TriggerContextMapping {
- [CONTEXT_MENU_TRIGGER]: EmbeddableContext;
- [PANEL_BADGE_TRIGGER]: EmbeddableContext;
- [PANEL_NOTIFICATION_TRIGGER]: EmbeddableContext;
- [SELECT_RANGE_TRIGGER]: RangeSelectContext;
- [VALUE_CLICK_TRIGGER]: ValueClickContext;
- }
-
- export interface ActionContextMapping {
- [ACTION_CUSTOMIZE_PANEL]: EmbeddableContext;
- [ACTION_ADD_PANEL]: EmbeddableContext;
- [ACTION_INSPECT_PANEL]: EmbeddableContext;
- [REMOVE_PANEL_ACTION]: EmbeddableContext;
- [ACTION_EDIT_PANEL]: EmbeddableContext;
- }
-}
-
/**
* This method initializes Embeddable plugin with initial set of
* triggers and actions.
diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx
index 2173082d67d3..f776e41a2045 100644
--- a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx
+++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx
@@ -25,7 +25,6 @@ import { RenderCompleteDispatcher } from '../../../../kibana_utils/public';
import { Adapters } from '../types';
import { IContainer } from '../containers';
import { EmbeddableOutput, IEmbeddable } from './i_embeddable';
-import { TriggerContextMapping } from '../ui_actions';
import { EmbeddableInput, ViewMode } from '../../../common/types';
function getPanelTitle(input: EmbeddableInput, output: EmbeddableOutput) {
@@ -248,7 +247,7 @@ export abstract class Embeddable<
this.onResetInput(newInput);
}
- public supportedTriggers(): Array {
+ public supportedTriggers(): string[] {
return [];
}
}
diff --git a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts
index a19ec2345db8..3b0c60f3fb08 100644
--- a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts
+++ b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts
@@ -20,7 +20,6 @@
import { Observable } from 'rxjs';
import { Adapters } from '../types';
import { IContainer } from '../containers/i_container';
-import { TriggerContextMapping } from '../../../../ui_actions/public';
import { EmbeddableInput } from '../../../common/types';
export interface EmbeddableError {
@@ -173,5 +172,5 @@ export interface IEmbeddable<
/**
* List of triggers that this embeddable will execute.
*/
- supportedTriggers(): Array;
+ supportedTriggers(): string[];
}
diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
index 2104d93da9ad..80238b06ff9f 100644
--- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
+++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
@@ -24,7 +24,7 @@ import { mountWithIntl, nextTick } from '@kbn/test/jest';
import { findTestSubject } from '@elastic/eui/lib/test';
import { I18nProvider } from '@kbn/i18n/react';
import { CONTEXT_MENU_TRIGGER } from '../triggers';
-import { Action, UiActionsStart, ActionType } from '../../../../ui_actions/public';
+import { Action, UiActionsStart } from '../../../../ui_actions/public';
import { Trigger, ViewMode } from '../types';
import { isErrorEmbeddable } from '../embeddables';
import { EmbeddablePanel } from './embeddable_panel';
@@ -216,7 +216,7 @@ const renderInEditModeAndOpenContextMenu = async (
test('HelloWorldContainer in edit mode hides disabledActions', async () => {
const action = {
id: 'FOO',
- type: 'FOO' as ActionType,
+ type: 'FOO',
getIconType: () => undefined,
getDisplayName: () => 'foo',
isCompatible: async () => true,
@@ -252,7 +252,7 @@ test('HelloWorldContainer in edit mode hides disabledActions', async () => {
test('HelloWorldContainer hides disabled badges', async () => {
const action = {
id: 'BAR',
- type: 'BAR' as ActionType,
+ type: 'BAR',
getIconType: () => undefined,
getDisplayName: () => 'bar',
isCompatible: async () => true,
diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts
index bb34b474efda..ce13c40f08d7 100644
--- a/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts
+++ b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts
@@ -17,16 +17,15 @@
* under the License.
*/
-import { createAction, ActionType } from '../../ui_actions';
+import { createAction } from '../../ui_actions';
import { ViewMode } from '../../types';
import { IEmbeddable } from '../..';
-// Casting to ActionType is a hack - in a real situation use
-// declare module and add this id to ActionContextMapping.
-export const EDIT_MODE_ACTION = 'EDIT_MODE_ACTION' as ActionType;
+export const EDIT_MODE_ACTION = 'EDIT_MODE_ACTION';
export function createEditModeAction() {
- return createAction({
+ return createAction({
+ id: EDIT_MODE_ACTION,
type: EDIT_MODE_ACTION,
getDisplayName: () => 'I only show up in edit mode',
isCompatible: async (context: { embeddable: IEmbeddable }) =>
diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx
index 968caf67b182..2aa42cbc2455 100644
--- a/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx
+++ b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx
@@ -17,12 +17,10 @@
* under the License.
*/
-import { IncompatibleActionError, ActionType, ActionDefinitionByType } from '../../ui_actions';
+import { IncompatibleActionError, Action } from '../../ui_actions';
import { EmbeddableInput, Embeddable, EmbeddableOutput, IEmbeddable } from '../../embeddables';
-// Casting to ActionType is a hack - in a real situation use
-// declare module and add this id to ActionContextMapping.
-export const SAY_HELLO_ACTION = 'SAY_HELLO_ACTION' as ActionType;
+export const SAY_HELLO_ACTION = 'SAY_HELLO_ACTION';
export interface FullNameEmbeddableOutput extends EmbeddableOutput {
fullName: string;
@@ -42,7 +40,7 @@ export interface SayHelloActionContext {
message?: string;
}
-export class SayHelloAction implements ActionDefinitionByType {
+export class SayHelloAction implements Action {
public readonly type = SAY_HELLO_ACTION;
public readonly id = SAY_HELLO_ACTION;
diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx
index 04898550532d..1427a8dcb736 100644
--- a/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx
+++ b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx
@@ -18,16 +18,14 @@
*/
import React from 'react';
import { EuiFlyoutBody } from '@elastic/eui';
-import { createAction, IncompatibleActionError, ActionType } from '../../ui_actions';
+import { createAction, IncompatibleActionError } from '../../ui_actions';
import { CoreStart } from '../../../../../../core/public';
import { toMountPoint } from '../../../../../kibana_react/public';
import { Embeddable, EmbeddableInput } from '../../embeddables';
import { GetMessageModal } from './get_message_modal';
import { FullNameEmbeddableOutput, hasFullNameOutput } from './say_hello_action';
-// Casting to ActionType is a hack - in a real situation use
-// declare module and add this id to ActionContextMapping.
-export const ACTION_SEND_MESSAGE = 'ACTION_SEND_MESSAGE' as ActionType;
+export const ACTION_SEND_MESSAGE = 'ACTION_SEND_MESSAGE';
interface ActionContext {
embeddable: Embeddable;
@@ -44,7 +42,8 @@ export function createSendMessageAction(overlays: CoreStart['overlays']) {
overlays.openFlyout(toMountPoint({content}));
};
- return createAction({
+ return createAction({
+ id: ACTION_SEND_MESSAGE,
type: ACTION_SEND_MESSAGE,
getDisplayName: () => 'Send message',
isCompatible,
diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
index 01228c778754..bacc764469a7 100644
--- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
+++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
@@ -24,13 +24,6 @@ import { EuiButton } from '@elastic/eui';
import * as Rx from 'rxjs';
import { UiActionsStart } from '../../../../../../ui_actions/public';
import { ContactCardEmbeddable, CONTACT_USER_TRIGGER } from './contact_card_embeddable';
-import { EmbeddableContext } from '../../../triggers';
-
-declare module '../../../../../../ui_actions/public' {
- export interface TriggerContextMapping {
- [CONTACT_USER_TRIGGER]: EmbeddableContext;
- }
-}
interface Props {
embeddable: ContactCardEmbeddable;
diff --git a/src/plugins/embeddable/public/lib/triggers/triggers.ts b/src/plugins/embeddable/public/lib/triggers/triggers.ts
index d9fb063a5bb5..cb315b880448 100644
--- a/src/plugins/embeddable/public/lib/triggers/triggers.ts
+++ b/src/plugins/embeddable/public/lib/triggers/triggers.ts
@@ -56,7 +56,7 @@ export type ChartActionContext =
| RowClickContext;
export const CONTEXT_MENU_TRIGGER = 'CONTEXT_MENU_TRIGGER';
-export const contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'> = {
+export const contextMenuTrigger: Trigger = {
id: CONTEXT_MENU_TRIGGER,
title: i18n.translate('embeddableApi.contextMenuTrigger.title', {
defaultMessage: 'Context menu',
@@ -67,7 +67,7 @@ export const contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'> = {
};
export const PANEL_BADGE_TRIGGER = 'PANEL_BADGE_TRIGGER';
-export const panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'> = {
+export const panelBadgeTrigger: Trigger = {
id: PANEL_BADGE_TRIGGER,
title: i18n.translate('embeddableApi.panelBadgeTrigger.title', {
defaultMessage: 'Panel badges',
@@ -78,7 +78,7 @@ export const panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'> = {
};
export const PANEL_NOTIFICATION_TRIGGER = 'PANEL_NOTIFICATION_TRIGGER';
-export const panelNotificationTrigger: Trigger<'PANEL_NOTIFICATION_TRIGGER'> = {
+export const panelNotificationTrigger: Trigger = {
id: PANEL_NOTIFICATION_TRIGGER,
title: i18n.translate('embeddableApi.panelNotificationTrigger.title', {
defaultMessage: 'Panel notifications',
@@ -89,7 +89,7 @@ export const panelNotificationTrigger: Trigger<'PANEL_NOTIFICATION_TRIGGER'> = {
};
export const SELECT_RANGE_TRIGGER = 'SELECT_RANGE_TRIGGER';
-export const selectRangeTrigger: Trigger<'SELECT_RANGE_TRIGGER'> = {
+export const selectRangeTrigger: Trigger = {
id: SELECT_RANGE_TRIGGER,
title: i18n.translate('embeddableApi.selectRangeTrigger.title', {
defaultMessage: 'Range selection',
@@ -100,7 +100,7 @@ export const selectRangeTrigger: Trigger<'SELECT_RANGE_TRIGGER'> = {
};
export const VALUE_CLICK_TRIGGER = 'VALUE_CLICK_TRIGGER';
-export const valueClickTrigger: Trigger<'VALUE_CLICK_TRIGGER'> = {
+export const valueClickTrigger: Trigger = {
id: VALUE_CLICK_TRIGGER,
title: i18n.translate('embeddableApi.valueClickTrigger.title', {
defaultMessage: 'Single click',
diff --git a/src/plugins/embeddable/public/public.api.md b/src/plugins/embeddable/public/public.api.md
index b20d5866298d..386f1b369bef 100644
--- a/src/plugins/embeddable/public/public.api.md
+++ b/src/plugins/embeddable/public/public.api.md
@@ -215,7 +215,7 @@ export const CONTEXT_MENU_TRIGGER = "CONTEXT_MENU_TRIGGER";
// Warning: (ae-missing-release-tag) "contextMenuTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'>;
+export const contextMenuTrigger: Trigger;
// Warning: (ae-missing-release-tag) "defaultEmbeddableFactoryProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -298,10 +298,8 @@ export abstract class Embeddable;
+ supportedTriggers(): string[];
// (undocumented)
abstract readonly type: string;
// (undocumented)
@@ -663,7 +661,7 @@ export interface IEmbeddable;
+ supportedTriggers(): string[];
readonly type: string;
updateInput(changes: Partial): void;
}
@@ -741,7 +739,7 @@ export const PANEL_NOTIFICATION_TRIGGER = "PANEL_NOTIFICATION_TRIGGER";
// Warning: (ae-missing-release-tag) "panelBadgeTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'>;
+export const panelBadgeTrigger: Trigger;
// Warning: (ae-missing-release-tag) "PanelNotFoundError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -755,7 +753,7 @@ export class PanelNotFoundError extends Error {
// Warning: (ae-missing-release-tag) "panelNotificationTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const panelNotificationTrigger: Trigger<'PANEL_NOTIFICATION_TRIGGER'>;
+export const panelNotificationTrigger: Trigger;
// Warning: (ae-missing-release-tag) "PanelState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
diff --git a/src/plugins/ui_actions/public/actions/action.test.ts b/src/plugins/ui_actions/public/actions/action.test.ts
index 1f76223a0d7c..4a51c0323fa8 100644
--- a/src/plugins/ui_actions/public/actions/action.test.ts
+++ b/src/plugins/ui_actions/public/actions/action.test.ts
@@ -18,14 +18,12 @@
*/
import { ActionExecutionContext, createAction } from '../../../ui_actions/public';
-import { ActionType } from '../types';
import { defaultTrigger } from '../triggers';
-const sayHelloAction = createAction({
- // Casting to ActionType is a hack - in a real situation use
- // declare module and add this id to ActionContextMapping.
- type: 'test' as ActionType,
- isCompatible: ({ amICompatible }: { amICompatible: boolean }) => Promise.resolve(amICompatible),
+const sayHelloAction = createAction<{ amICompatible: boolean }>({
+ id: 'test',
+ type: 'test',
+ isCompatible: ({ amICompatible }) => Promise.resolve(amICompatible),
execute: () => Promise.resolve(),
});
@@ -33,7 +31,7 @@ test('action is not compatible based on context', async () => {
const isCompatible = await sayHelloAction.isCompatible({
amICompatible: false,
trigger: defaultTrigger,
- } as ActionExecutionContext);
+ } as ActionExecutionContext<{ amICompatible: boolean }>);
expect(isCompatible).toBe(false);
});
@@ -41,6 +39,6 @@ test('action is compatible based on context', async () => {
const isCompatible = await sayHelloAction.isCompatible({
amICompatible: true,
trigger: defaultTrigger,
- } as ActionExecutionContext);
+ } as ActionExecutionContext<{ amICompatible: boolean }>);
expect(isCompatible).toBe(true);
});
diff --git a/src/plugins/ui_actions/public/actions/action.ts b/src/plugins/ui_actions/public/actions/action.ts
index 8005dadd8f5e..5d479577d4bc 100644
--- a/src/plugins/ui_actions/public/actions/action.ts
+++ b/src/plugins/ui_actions/public/actions/action.ts
@@ -18,15 +18,9 @@
*/
import { UiComponent } from 'src/plugins/kibana_utils/public';
-import { ActionType, ActionContextMapping, BaseContext } from '../types';
import { Presentable } from '../util/presentable';
import { Trigger } from '../triggers';
-export type ActionByType = Action;
-export type ActionDefinitionByType = ActionDefinition<
- ActionContextMapping[T]
->;
-
/**
* During action execution we can provide additional information,
* for example, trigger, that caused the action execution
@@ -41,19 +35,18 @@ export interface ActionExecutionMeta {
/**
* Action methods are executed with Context from trigger + {@link ActionExecutionMeta}
*/
-export type ActionExecutionContext = Context &
- ActionExecutionMeta;
+export type ActionExecutionContext = Context & ActionExecutionMeta;
/**
* Simplified action context for {@link ActionDefinition}
* When defining action consumer may use either it's own Context
* or an ActionExecutionContext to get access to {@link ActionExecutionMeta} params
*/
-export type ActionDefinitionContext =
+export type ActionDefinitionContext =
| Context
| ActionExecutionContext;
-export interface Action
+export interface Action
extends Partial>> {
/**
* Determined the order when there is more than one action matched to a trigger.
@@ -69,7 +62,7 @@ export interface Action
/**
* The action type is what determines the context shape.
*/
- readonly type: T;
+ readonly type: string;
/**
* Optional EUI icon type that can be displayed along with the title.
@@ -117,7 +110,7 @@ export interface Action
/**
* A convenience interface used to register an action.
*/
-export interface ActionDefinition
+export interface ActionDefinition
extends Partial>> {
/**
* ID of the action that uniquely identifies this action in the actions registry.
@@ -127,7 +120,7 @@ export interface ActionDefinition
/**
* ID of the factory for this action. Used to construct dynamic actions.
*/
- readonly type?: ActionType;
+ readonly type?: string;
/**
* Returns a promise that resolves to true if this item is compatible given
diff --git a/src/plugins/ui_actions/public/actions/action_internal.ts b/src/plugins/ui_actions/public/actions/action_internal.ts
index fe7c986bdb7e..7cae0f68bd00 100644
--- a/src/plugins/ui_actions/public/actions/action_internal.ts
+++ b/src/plugins/ui_actions/public/actions/action_internal.ts
@@ -22,7 +22,6 @@ import React from 'react';
import { Action, ActionContext as Context, ActionDefinition } from './action';
import { Presentable, PresentableGrouping } from '../util/presentable';
import { uiToReactComponent } from '../../../kibana_react/public';
-import { ActionType } from '../types';
/**
* @internal
@@ -32,7 +31,7 @@ export class ActionInternal
constructor(public readonly definition: A) {}
public readonly id: string = this.definition.id;
- public readonly type: ActionType = this.definition.type || '';
+ public readonly type: string = this.definition.type || '';
public readonly order: number = this.definition.order || 0;
public readonly MenuItem? = this.definition.MenuItem;
public readonly ReactMenuItem? = this.MenuItem ? uiToReactComponent(this.MenuItem) : undefined;
diff --git a/src/plugins/ui_actions/public/actions/create_action.ts b/src/plugins/ui_actions/public/actions/create_action.ts
index dea21678ecce..0199812c4080 100644
--- a/src/plugins/ui_actions/public/actions/create_action.ts
+++ b/src/plugins/ui_actions/public/actions/create_action.ts
@@ -17,25 +17,16 @@
* under the License.
*/
-import { ActionContextMapping } from '../types';
-import { ActionByType } from './action';
-import { ActionType } from '../types';
-import { ActionDefinition } from './action';
+import { ActionDefinition, Action } from './action';
-interface ActionDefinitionByType
- extends Omit, 'id'> {
- id?: string;
-}
-
-export function createAction(
- action: ActionDefinitionByType
-): ActionByType {
+export function createAction(
+ action: ActionDefinition
+): Action {
return {
getIconType: () => undefined,
order: 0,
- id: action.type,
isCompatible: () => Promise.resolve(true),
getDisplayName: () => '',
...action,
- } as ActionByType;
+ } as Action;
}
diff --git a/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.test.ts b/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.test.ts
index 3111a0b55084..ac19889aa653 100644
--- a/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.test.ts
+++ b/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.test.ts
@@ -34,6 +34,7 @@ const createTestAction = ({
grouping?: PresentableGrouping;
}) =>
createAction({
+ id: type as any, // mapping doesn't matter for this test
type: type as any, // mapping doesn't matter for this test
getDisplayName: () => dispayName,
order,
diff --git a/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx b/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx
index 63586ca3da1f..aa3fd57be695 100644
--- a/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx
+++ b/src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx
@@ -24,7 +24,6 @@ import { i18n } from '@kbn/i18n';
import { uiToReactComponent } from '../../../kibana_react/public';
import { Action, ActionExecutionContext } from '../actions';
import { Trigger } from '../triggers';
-import { BaseContext } from '../types';
export const defaultTitle = i18n.translate('uiActions.actionPanel.title', {
defaultMessage: 'Options',
@@ -34,7 +33,7 @@ export const txtMore = i18n.translate('uiActions.actionPanel.more', {
defaultMessage: 'More',
});
-interface ActionWithContext {
+interface ActionWithContext {
action: Action;
context: Context;
diff --git a/src/plugins/ui_actions/public/index.ts b/src/plugins/ui_actions/public/index.ts
index 7890e4bab44a..9ac5c19033e4 100644
--- a/src/plugins/ui_actions/public/index.ts
+++ b/src/plugins/ui_actions/public/index.ts
@@ -39,7 +39,6 @@ export {
} from './util';
export {
Trigger,
- TriggerContext,
VISUALIZE_FIELD_TRIGGER,
visualizeFieldTrigger,
VISUALIZE_GEO_FIELD_TRIGGER,
@@ -49,18 +48,9 @@ export {
RowClickContext,
} from './triggers';
export {
- TriggerContextMapping,
- TriggerId,
- ActionContextMapping,
- ActionType,
VisualizeFieldContext,
ACTION_VISUALIZE_FIELD,
ACTION_VISUALIZE_GEO_FIELD,
ACTION_VISUALIZE_LENS_FIELD,
} from './types';
-export {
- ActionByType,
- ActionDefinitionByType,
- ActionExecutionContext,
- ActionExecutionMeta,
-} from './actions';
+export { ActionExecutionContext, ActionExecutionMeta } from './actions';
diff --git a/src/plugins/ui_actions/public/mocks.ts b/src/plugins/ui_actions/public/mocks.ts
index 759430169b61..fa2473801491 100644
--- a/src/plugins/ui_actions/public/mocks.ts
+++ b/src/plugins/ui_actions/public/mocks.ts
@@ -21,7 +21,6 @@ import { CoreSetup, CoreStart } from 'src/core/public';
import { UiActionsSetup, UiActionsStart } from '.';
import { plugin as pluginInitializer } from '.';
import { coreMock } from '../../../core/public/mocks';
-import { TriggerId } from './types';
export type Setup = jest.Mocked;
export type Start = jest.Mocked;
@@ -50,7 +49,7 @@ const createStartContract = (): Start => {
getAction: jest.fn(),
hasAction: jest.fn(),
getTrigger: jest.fn(),
- getTriggerActions: jest.fn((id: TriggerId) => []),
+ getTriggerActions: jest.fn((id: string) => []),
getTriggerCompatibleActions: jest.fn(),
registerAction: jest.fn(),
registerTrigger: jest.fn(),
diff --git a/src/plugins/ui_actions/public/public.api.md b/src/plugins/ui_actions/public/public.api.md
index 808cb1f3fbca..0d3ab1086904 100644
--- a/src/plugins/ui_actions/public/public.api.md
+++ b/src/plugins/ui_actions/public/public.api.md
@@ -15,11 +15,10 @@ import { PublicMethodsOf } from '@kbn/utility-types';
import React from 'react';
import { UiComponent } from 'src/plugins/kibana_utils/public';
-// Warning: (ae-forgotten-export) The symbol "BaseContext" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "Action" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export interface Action extends Partial>> {
+export interface Action extends Partial>> {
execute(context: ActionExecutionContext): Promise;
getDisplayName(context: ActionExecutionContext): string;
getHref?(context: ActionExecutionContext): Promise;
@@ -31,7 +30,7 @@ export interface Action extend
}>;
order?: number;
shouldAutoExecute?(context: ActionExecutionContext): Promise;
- readonly type: T;
+ readonly type: string;
}
// Warning: (ae-missing-release-tag) "ACTION_VISUALIZE_FIELD" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -49,36 +48,10 @@ export const ACTION_VISUALIZE_GEO_FIELD = "ACTION_VISUALIZE_GEO_FIELD";
// @public (undocumented)
export const ACTION_VISUALIZE_LENS_FIELD = "ACTION_VISUALIZE_LENS_FIELD";
-// Warning: (ae-missing-release-tag) "ActionByType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export type ActionByType = Action;
-
-// Warning: (ae-missing-release-tag) "ActionContextMapping" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export interface ActionContextMapping {
- // Warning: (ae-forgotten-export) The symbol "DEFAULT_ACTION" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- [DEFAULT_ACTION]: BaseContext;
- // (undocumented)
- [ACTION_VISUALIZE_FIELD]: VisualizeFieldContext;
- // (undocumented)
- [ACTION_VISUALIZE_GEO_FIELD]: VisualizeFieldContext;
- // (undocumented)
- [ACTION_VISUALIZE_LENS_FIELD]: VisualizeFieldContext;
-}
-
-// Warning: (ae-missing-release-tag) "ActionDefinitionByType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export type ActionDefinitionByType = UiActionsActionDefinition;
-
// Warning: (ae-missing-release-tag) "ActionExecutionContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
-export type ActionExecutionContext = Context & ActionExecutionMeta;
+export type ActionExecutionContext = Context & ActionExecutionMeta;
// Warning: (ae-missing-release-tag) "ActionExecutionMeta" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -87,22 +60,16 @@ export interface ActionExecutionMeta {
trigger: Trigger;
}
-// Warning: (ae-missing-release-tag) "ActionType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export type ActionType = keyof ActionContextMapping;
-
// Warning: (ae-forgotten-export) The symbol "BuildContextMenuParams" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "buildContextMenuForActions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function buildContextMenuForActions({ actions, title, closeMenu, }: BuildContextMenuParams): Promise;
-// Warning: (ae-forgotten-export) The symbol "ActionDefinitionByType" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "createAction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export function createAction(action: ActionDefinitionByType_2): ActionByType;
+export function createAction(action: UiActionsActionDefinition): Action;
// Warning: (ae-missing-release-tag) "IncompatibleActionError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -142,61 +109,34 @@ export interface RowClickContext {
// Warning: (ae-missing-release-tag) "rowClickTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const rowClickTrigger: Trigger<'ROW_CLICK_TRIGGER'>;
+export const rowClickTrigger: Trigger;
// Warning: (ae-missing-release-tag) "Trigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
-export interface Trigger {
+export interface Trigger {
description?: string;
- id: ID;
+ id: string;
title?: string;
}
-// Warning: (ae-missing-release-tag) "TriggerContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export type TriggerContext = T extends TriggerId ? TriggerContextMapping[T] : never;
-
-// Warning: (ae-missing-release-tag) "TriggerContextMapping" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export interface TriggerContextMapping {
- // Warning: (ae-forgotten-export) The symbol "DEFAULT_TRIGGER" needs to be exported by the entry point index.d.ts
- // Warning: (ae-forgotten-export) The symbol "TriggerContext" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- [DEFAULT_TRIGGER]: TriggerContext_2;
- // (undocumented)
- [ROW_CLICK_TRIGGER]: RowClickContext;
- // (undocumented)
- [VISUALIZE_FIELD_TRIGGER]: VisualizeFieldContext;
- // (undocumented)
- [VISUALIZE_GEO_FIELD_TRIGGER]: VisualizeFieldContext;
-}
-
-// Warning: (ae-missing-release-tag) "TriggerId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
-//
-// @public (undocumented)
-export type TriggerId = keyof TriggerContextMapping;
-
// Warning: (ae-forgotten-export) The symbol "ActionDefinitionContext" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ActionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
-export interface UiActionsActionDefinition extends Partial>> {
+export interface UiActionsActionDefinition extends Partial>> {
execute(context: ActionDefinitionContext): Promise;
getHref?(context: ActionDefinitionContext): Promise;
readonly id: string;
isCompatible?(context: ActionDefinitionContext): Promise;
shouldAutoExecute?(context: ActionDefinitionContext): Promise;
- readonly type?: ActionType;
+ readonly type?: string;
}
// Warning: (ae-missing-release-tag) "Presentable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
-export interface UiActionsPresentable {
+export interface UiActionsPresentable {
getDisplayName(context: Context): string;
getDisplayNameTooltip(context: Context): string;
getHref?(context: Context): Promise;
@@ -214,7 +154,7 @@ export interface UiActionsPresentable {
// Warning: (ae-missing-release-tag) "PresentableGrouping" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export type UiActionsPresentableGrouping = Array>;
+export type UiActionsPresentableGrouping = Array>;
// Warning: (ae-missing-release-tag) "UiActionsService" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -225,35 +165,35 @@ export class UiActionsService {
//
// (undocumented)
protected readonly actions: ActionRegistry;
- readonly addTriggerAction: (triggerId: T, action: UiActionsActionDefinition | Action) => void;
+ readonly addTriggerAction: (triggerId: string, action: UiActionsActionDefinition) => void;
// (undocumented)
- readonly attachAction: (triggerId: T, actionId: string) => void;
+ readonly attachAction: (triggerId: string, actionId: string) => void;
readonly clear: () => void;
// (undocumented)
- readonly detachAction: (triggerId: TriggerId, actionId: string) => void;
+ readonly detachAction: (triggerId: string, actionId: string) => void;
// @deprecated (undocumented)
- readonly executeTriggerActions: (triggerId: T, context: TriggerContext) => Promise;
+ readonly executeTriggerActions: (triggerId: string, context: object) => Promise;
// Warning: (ae-forgotten-export) The symbol "UiActionsExecutionService" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly executionService: UiActionsExecutionService;
readonly fork: () => UiActionsService;
// (undocumented)
- readonly getAction: >(id: string) => Action, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">;
+ readonly getAction: >(id: string) => Action>;
// Warning: (ae-forgotten-export) The symbol "TriggerContract" needs to be exported by the entry point index.d.ts
//
// (undocumented)
- readonly getTrigger: (triggerId: T) => TriggerContract;
+ readonly getTrigger: (triggerId: string) => TriggerContract;
// (undocumented)
- readonly getTriggerActions: (triggerId: T) => Action[];
+ readonly getTriggerActions: (triggerId: string) => Action[];
// (undocumented)
- readonly getTriggerCompatibleActions: (triggerId: T, context: TriggerContextMapping[T]) => Promise[]>;
+ readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise;
// (undocumented)
readonly hasAction: (actionId: string) => boolean;
// Warning: (ae-forgotten-export) The symbol "ActionContext" needs to be exported by the entry point index.d.ts
//
// (undocumented)
- readonly registerAction: >(definition: A) => Action, "" | "ACTION_VISUALIZE_FIELD" | "ACTION_VISUALIZE_GEO_FIELD" | "ACTION_VISUALIZE_LENS_FIELD" | "ACTION_GLOBAL_APPLY_FILTER" | "ACTION_SELECT_RANGE" | "ACTION_VALUE_CLICK" | "ACTION_CUSTOMIZE_PANEL" | "ACTION_ADD_PANEL" | "openInspector" | "deletePanel" | "editPanel">;
+ readonly registerAction: >(definition: A) => Action>;
// (undocumented)
readonly registerTrigger: (trigger: Trigger) => void;
// Warning: (ae-forgotten-export) The symbol "TriggerRegistry" needs to be exported by the entry point index.d.ts
@@ -314,12 +254,12 @@ export interface VisualizeFieldContext {
// Warning: (ae-missing-release-tag) "visualizeFieldTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const visualizeFieldTrigger: Trigger<'VISUALIZE_FIELD_TRIGGER'>;
+export const visualizeFieldTrigger: Trigger;
// Warning: (ae-missing-release-tag) "visualizeGeoFieldTrigger" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const visualizeGeoFieldTrigger: Trigger<'VISUALIZE_GEO_FIELD_TRIGGER'>;
+export const visualizeGeoFieldTrigger: Trigger;
// Warnings were encountered during analysis:
diff --git a/src/plugins/ui_actions/public/service/ui_actions_execution_service.ts b/src/plugins/ui_actions/public/service/ui_actions_execution_service.ts
index 59616dcf3f38..ea44448092a7 100644
--- a/src/plugins/ui_actions/public/service/ui_actions_execution_service.ts
+++ b/src/plugins/ui_actions/public/service/ui_actions_execution_service.ts
@@ -19,14 +19,13 @@
import { uniqBy } from 'lodash';
import { Action } from '../actions';
-import { BaseContext } from '../types';
import { defer as createDefer, Defer } from '../../../kibana_utils/public';
import { buildContextMenuForActions, openContextMenu } from '../context_menu';
import { Trigger } from '../triggers';
interface ExecuteActionTask {
action: Action;
- context: BaseContext;
+ context: object;
trigger: Trigger;
defer: Defer;
alwaysShowPopup?: boolean;
@@ -44,8 +43,8 @@ export class UiActionsExecutionService {
context,
trigger,
}: {
- action: Action;
- context: BaseContext;
+ action: Action;
+ context: object;
trigger: Trigger;
},
alwaysShowPopup?: boolean
diff --git a/src/plugins/ui_actions/public/service/ui_actions_service.test.ts b/src/plugins/ui_actions/public/service/ui_actions_service.test.ts
index 39502c3dd17f..137cfaeac4b6 100644
--- a/src/plugins/ui_actions/public/service/ui_actions_service.test.ts
+++ b/src/plugins/ui_actions/public/service/ui_actions_service.test.ts
@@ -20,19 +20,17 @@
import { UiActionsService } from './ui_actions_service';
import { Action, ActionInternal, createAction } from '../actions';
import { createHelloWorldAction } from '../tests/test_samples';
-import { TriggerRegistry, TriggerId, ActionType, ActionRegistry } from '../types';
+import { TriggerRegistry, ActionRegistry } from '../types';
import { Trigger } from '../triggers';
-// Casting to ActionType or TriggerId is a hack - in a real situation use
-// declare module and add this id to the appropriate context mapping.
-const FOO_TRIGGER: TriggerId = 'FOO_TRIGGER' as TriggerId;
-const BAR_TRIGGER: TriggerId = 'BAR_TRIGGER' as TriggerId;
-const MY_TRIGGER: TriggerId = 'MY_TRIGGER' as TriggerId;
+const FOO_TRIGGER = 'FOO_TRIGGER';
+const BAR_TRIGGER = 'BAR_TRIGGER';
+const MY_TRIGGER = 'MY_TRIGGER';
const testAction1: Action = {
id: 'action1',
order: 1,
- type: 'type1' as ActionType,
+ type: 'type1',
execute: async () => {},
getDisplayName: () => 'test1',
getIconType: () => '',
@@ -42,7 +40,7 @@ const testAction1: Action = {
const testAction2: Action = {
id: 'action2',
order: 2,
- type: 'type2' as ActionType,
+ type: 'type2',
execute: async () => {},
getDisplayName: () => 'test2',
getIconType: () => '',
@@ -99,7 +97,7 @@ describe('UiActionsService', () => {
getDisplayName: () => 'test',
getIconType: () => '',
isCompatible: async () => true,
- type: 'test' as ActionType,
+ type: 'test',
});
});
@@ -111,7 +109,7 @@ describe('UiActionsService', () => {
getDisplayName: () => 'test',
getIconType: () => '',
isCompatible: async () => true,
- type: 'test' as ActionType,
+ type: 'test',
});
expect(action).toBeInstanceOf(ActionInternal);
@@ -123,7 +121,7 @@ describe('UiActionsService', () => {
const action1: Action = {
id: 'action1',
order: 1,
- type: 'type1' as ActionType,
+ type: 'type1',
execute: async () => {},
getDisplayName: () => 'test',
getIconType: () => '',
@@ -132,7 +130,7 @@ describe('UiActionsService', () => {
const action2: Action = {
id: 'action2',
order: 2,
- type: 'type2' as ActionType,
+ type: 'type2',
execute: async () => {},
getDisplayName: () => 'test',
getIconType: () => '',
@@ -207,7 +205,8 @@ describe('UiActionsService', () => {
test('filters out actions not applicable based on the context', async () => {
const service = new UiActionsService();
const action = createAction({
- type: 'test' as ActionType,
+ id: 'test',
+ type: 'test',
isCompatible: ({ accept }: { accept: boolean }) => Promise.resolve(accept),
execute: () => Promise.resolve(),
});
@@ -238,16 +237,15 @@ describe('UiActionsService', () => {
test(`throws an error with an invalid trigger ID`, async () => {
const service = new UiActionsService();
- // Without the cast "as TriggerId" typescript will happily throw an error!
- await expect(
- service.getTriggerCompatibleActions('I do not exist' as TriggerId, {})
- ).rejects.toMatchObject(new Error('Trigger [triggerId = I do not exist] does not exist.'));
+ await expect(service.getTriggerCompatibleActions('I do not exist', {})).rejects.toMatchObject(
+ new Error('Trigger [triggerId = I do not exist] does not exist.')
+ );
});
test('returns empty list if trigger not attached to any action', async () => {
const service = new UiActionsService();
const testTrigger: Trigger = {
- id: '123' as TriggerId,
+ id: '123',
title: '123',
};
service.registerTrigger(testTrigger);
@@ -445,9 +443,7 @@ describe('UiActionsService', () => {
} as any;
service.registerAction(action);
- expect(() =>
- service.detachAction('i do not exist' as TriggerId, ACTION_HELLO_WORLD)
- ).toThrowError(
+ expect(() => service.detachAction('i do not exist', ACTION_HELLO_WORLD)).toThrowError(
'No trigger [triggerId = i do not exist] exists, for detaching action [actionId = ACTION_HELLO_WORLD].'
);
});
@@ -461,7 +457,7 @@ describe('UiActionsService', () => {
} as any;
service.registerAction(action);
- expect(() => service.addTriggerAction('i do not exist' as TriggerId, action)).toThrowError(
+ expect(() => service.addTriggerAction('i do not exist', action)).toThrowError(
'No trigger [triggerId = i do not exist] exists, for attaching action [actionId = ACTION_HELLO_WORLD].'
);
});
diff --git a/src/plugins/ui_actions/public/service/ui_actions_service.ts b/src/plugins/ui_actions/public/service/ui_actions_service.ts
index ec5f3afa19c9..456341d98c5b 100644
--- a/src/plugins/ui_actions/public/service/ui_actions_service.ts
+++ b/src/plugins/ui_actions/public/service/ui_actions_service.ts
@@ -17,15 +17,9 @@
* under the License.
*/
-import {
- TriggerRegistry,
- ActionRegistry,
- TriggerToActionsRegistry,
- TriggerId,
- TriggerContextMapping,
-} from '../types';
+import { TriggerRegistry, ActionRegistry, TriggerToActionsRegistry } from '../types';
import { ActionInternal, Action, ActionDefinition, ActionContext } from '../actions';
-import { Trigger, TriggerContext } from '../triggers/trigger';
+import { Trigger } from '../triggers/trigger';
import { TriggerInternal } from '../triggers/trigger_internal';
import { TriggerContract } from '../triggers/trigger_contract';
import { UiActionsExecutionService } from './ui_actions_execution_service';
@@ -67,7 +61,7 @@ export class UiActionsService {
this.triggerToActions.set(trigger.id, []);
};
- public readonly getTrigger = (triggerId: T): TriggerContract => {
+ public readonly getTrigger = (triggerId: string): TriggerContract => {
const trigger = this.triggers.get(triggerId);
if (!trigger) {
@@ -103,7 +97,7 @@ export class UiActionsService {
return this.actions.has(actionId);
};
- public readonly attachAction = (triggerId: T, actionId: string): void => {
+ public readonly attachAction = (triggerId: string, actionId: string): void => {
const trigger = this.triggers.get(triggerId);
if (!trigger) {
@@ -119,7 +113,7 @@ export class UiActionsService {
}
};
- public readonly detachAction = (triggerId: TriggerId, actionId: string) => {
+ public readonly detachAction = (triggerId: string, actionId: string) => {
const trigger = this.triggers.get(triggerId);
if (!trigger) {
@@ -139,14 +133,10 @@ export class UiActionsService {
/**
* `addTriggerAction` is similar to `attachAction` as it attaches action to a
* trigger, but it also registers the action, if it has not been registered, yet.
- *
- * `addTriggerAction` also infers better typing of the `action` argument.
*/
- public readonly addTriggerAction = (
- triggerId: T,
- // The action can accept partial or no context, but if it needs context not provided
- // by this type of trigger, typescript will complain. yay!
- action: ActionDefinition | Action // TODO: remove `Action` https://github.com/elastic/kibana/issues/74501
+ public readonly addTriggerAction = (
+ triggerId: string,
+ action: ActionDefinition // TODO: remove `Action` https://github.com/elastic/kibana/issues/74501
): void => {
if (!this.actions.has(action.id)) this.registerAction(action);
this.attachAction(triggerId, action.id);
@@ -162,9 +152,7 @@ export class UiActionsService {
return this.actions.get(id) as ActionInternal;
};
- public readonly getTriggerActions = (
- triggerId: T
- ): Array> => {
+ public readonly getTriggerActions = (triggerId: string): Action[] => {
// This line checks if trigger exists, otherwise throws.
this.getTrigger!(triggerId);
@@ -174,13 +162,13 @@ export class UiActionsService {
.map((actionId) => this.actions.get(actionId) as ActionInternal)
.filter(Boolean);
- return actions as Array>>;
+ return actions as Action[];
};
- public readonly getTriggerCompatibleActions = async (
- triggerId: T,
- context: TriggerContextMapping[T]
- ): Promise>> => {
+ public readonly getTriggerCompatibleActions = async (
+ triggerId: string,
+ context: object
+ ): Promise => {
const actions = this.getTriggerActions!(triggerId);
const isCompatibles = await Promise.all(
actions.map((action) =>
@@ -191,8 +179,7 @@ export class UiActionsService {
)
);
return actions.reduce(
- (acc: Array>, action, i) =>
- isCompatibles[i] ? [...acc, action] : acc,
+ (acc: Action[], action, i) => (isCompatibles[i] ? [...acc, action] : acc),
[]
);
};
@@ -202,11 +189,8 @@ export class UiActionsService {
*
* Use `plugins.uiActions.getTrigger(triggerId).exec(params)` instead.
*/
- public readonly executeTriggerActions = async (
- triggerId: T,
- context: TriggerContext
- ) => {
- const trigger = this.getTrigger(triggerId);
+ public readonly executeTriggerActions = async (triggerId: string, context: object) => {
+ const trigger = this.getTrigger(triggerId);
await trigger.exec(context);
};
diff --git a/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts b/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts
index 51ba165ba730..6f8a45cc2e40 100644
--- a/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts
+++ b/src/plugins/ui_actions/public/tests/execute_trigger_actions.test.ts
@@ -21,7 +21,6 @@ import { Action, createAction } from '../actions';
import { openContextMenu } from '../context_menu';
import { uiActionsPluginMock } from '../mocks';
import { Trigger } from '../triggers';
-import { TriggerId, ActionType } from '../types';
import { waitFor } from '@testing-library/dom';
jest.mock('../context_menu');
@@ -31,17 +30,13 @@ const openContextMenuSpy = (openContextMenu as any) as jest.SpyInstance;
const CONTACT_USER_TRIGGER = 'CONTACT_USER_TRIGGER';
-// Casting to ActionType is a hack - in a real situation use
-// declare module and add this id to ActionContextMapping.
-const TEST_ACTION_TYPE = 'TEST_ACTION_TYPE' as ActionType;
-
function createTestAction(
type: string,
checkCompatibility: (context: C) => boolean,
autoExecutable = false
): Action