Skip to content

Commit

Permalink
Remove dynamic mapped types from UiActions (#87075)
Browse files Browse the repository at this point in the history
* Remove dynamic mapped types from UiActions

* Remove import between data <-> embeddables

* remove outdated comments, export action types from discover_enhanced

* fix notice.txt

Co-authored-by: restrry <[email protected]>
  • Loading branch information
joshdover and mshustov authored Jan 5, 2021
1 parent 1363a2a commit 0af8131
Show file tree
Hide file tree
Showing 167 changed files with 483 additions and 1,149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'>
contextMenuTrigger: Trigger
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<b>Signature:</b>

```typescript
supportedTriggers(): Array<keyof TriggerContextMapping>;
supportedTriggers(): string[];
```
<b>Returns:</b>

`Array<keyof TriggerContextMapping>`
`string[]`

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ List of triggers that this embeddable will execute.
<b>Signature:</b>

```typescript
supportedTriggers(): Array<keyof TriggerContextMapping>;
supportedTriggers(): string[];
```
<b>Returns:</b>

`Array<keyof TriggerContextMapping>`
`string[]`

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'>
panelBadgeTrigger: Trigger
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
panelNotificationTrigger: Trigger<'PANEL_NOTIFICATION_TRIGGER'>
panelNotificationTrigger: Trigger
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
export interface Action<Context extends BaseContext = {}, T = ActionType> extends Partial<Presentable<ActionExecutionContext<Context>>>
export interface Action<Context extends object = object> extends Partial<Presentable<ActionExecutionContext<Context>>>
```
## Properties
Expand All @@ -17,7 +17,7 @@ export interface Action<Context extends BaseContext = {}, T = ActionType> extend
| [id](./kibana-plugin-plugins-ui_actions-public.action.id.md) | <code>string</code> | A unique identifier for this action instance. |
| [MenuItem](./kibana-plugin-plugins-ui_actions-public.action.menuitem.md) | <code>UiComponent&lt;{</code><br/><code> context: ActionExecutionContext&lt;Context&gt;;</code><br/><code> }&gt;</code> | <code>UiComponent</code> to render when displaying this action as a context menu item. If not provided, <code>getDisplayName</code> will be used instead. |
| [order](./kibana-plugin-plugins-ui_actions-public.action.order.md) | <code>number</code> | 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) | <code>T</code> | The action type is what determines the context shape. |
| [type](./kibana-plugin-plugins-ui_actions-public.action.type.md) | <code>string</code> | The action type is what determines the context shape. |
## Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ The action type is what determines the context shape.
<b>Signature:</b>

```typescript
readonly type: T;
readonly type: string;
```

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Action methods are executed with Context from trigger + [ActionExecutionMeta](./
<b>Signature:</b>

```typescript
export declare type ActionExecutionContext<Context extends BaseContext = BaseContext> = Context & ActionExecutionMeta;
export declare type ActionExecutionContext<Context extends object = object> = Context & ActionExecutionMeta;
```

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<b>Signature:</b>

```typescript
export declare function createAction<T extends ActionType>(action: ActionDefinitionByType<T>): ActionByType<T>;
export declare function createAction<Context extends object = object>(action: ActionDefinition<Context>): Action<Context>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| action | <code>ActionDefinitionByType&lt;T&gt;</code> | |
| action | <code>ActionDefinition&lt;Context&gt;</code> | |

<b>Returns:</b>

`ActionByType<T>`
`Action<Context>`

Original file line number Diff line number Diff line change
Expand Up @@ -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\*.<code>Trigger</code> specifies a named anchor to which <code>Action</code> can be attached. When <code>Trigger</code> is being \*called\* it creates a <code>Context</code> object and passes it to the <code>execute</code> method of an <code>Action</code>.<!-- -->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) | |
Expand All @@ -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) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
rowClickTrigger: Trigger<'ROW_CLICK_TRIGGER'>
rowClickTrigger: Trigger
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Unique name of the trigger as identified in `ui_actions` plugin trigger registry
<b>Signature:</b>

```typescript
id: ID;
id: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ More than one action can be attached to a single trigger, in which case when tri
<b>Signature:</b>

```typescript
export interface Trigger<ID extends TriggerId = TriggerId>
export interface Trigger
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [description](./kibana-plugin-plugins-ui_actions-public.trigger.description.md) | <code>string</code> | A longer user friendly description of the trigger. |
| [id](./kibana-plugin-plugins-ui_actions-public.trigger.id.md) | <code>ID</code> | Unique name of the trigger as identified in <code>ui_actions</code> plugin trigger registry. |
| [id](./kibana-plugin-plugins-ui_actions-public.trigger.id.md) | <code>string</code> | Unique name of the trigger as identified in <code>ui_actions</code> plugin trigger registry. |
| [title](./kibana-plugin-plugins-ui_actions-public.trigger.title.md) | <code>string</code> | User friendly name of the trigger. |

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ A convenience interface used to register an action.
<b>Signature:</b>

```typescript
export interface ActionDefinition<Context extends BaseContext = {}> extends Partial<Presentable<ActionDefinitionContext<Context>>>
export interface ActionDefinition<Context extends object = object> extends Partial<Presentable<ActionDefinitionContext<Context>>>
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [id](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.id.md) | <code>string</code> | ID of the action that uniquely identifies this action in the actions registry. |
| [type](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md) | <code>ActionType</code> | ID of the factory for this action. Used to construct dynamic actions. |
| [type](./kibana-plugin-plugins-ui_actions-public.uiactionsactiondefinition.type.md) | <code>string</code> | ID of the factory for this action. Used to construct dynamic actions. |
## Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ ID of the factory for this action. Used to construct dynamic actions.
<b>Signature:</b>

```typescript
readonly type?: ActionType;
readonly type?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Represents something that can be displayed to user in UI.
<b>Signature:</b>

```typescript
export interface Presentable<Context extends object = object>
export interface Presentable<Context = unknown>
```

## Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
export declare type PresentableGrouping<Context extends object = object> = Array<PresentableGroup<Context>>;
export declare type PresentableGrouping<Context = unknown> = Array<PresentableGroup<Context>>;
```
Loading

0 comments on commit 0af8131

Please sign in to comment.