Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui_actions service initial docs #78902

Merged
merged 2 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,16 @@ It also provides a stateful version of it on the start contract.
which also contains the timelion APIs and backend, look at the vis_type_timelion plugin.


|{kib-repo}blob/{branch}/src/plugins/ui_actions/README.md[uiActions]
|<<uiactions-plugin>>
|An API for:

- creating custom functionality (`actions`)
- creating custom user interaction events (`triggers`)
- attaching and detaching `actions` to `triggers`.
- emitting `trigger` events
- executing `actions` attached to a given `trigger`.
- exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.


|{kib-repo}blob/{branch}/src/plugins/url_forwarding/README.md[urlForwarding]
|This plugins contains helpers to redirect legacy URLs. It can be used to forward old URLs to their new counterparts.
Expand Down Expand Up @@ -524,5 +531,6 @@ in their infrastructure.

include::{kibana-root}/src/plugins/dashboard/README.asciidoc[leveloffset=+1]
include::{kibana-root}/src/plugins/expressions/README.asciidoc[leveloffset=+1]
include::{kibana-root}/src/plugins/ui_actions/README.asciidoc[leveloffset=+1]
include::{kibana-root}/x-pack/plugins/dashboard_enhanced/README.asciidoc[leveloffset=+1]
include::{kibana-root}/x-pack/plugins/embeddable_enhanced/README.asciidoc[leveloffset=+1]
12 changes: 12 additions & 0 deletions docs/development/plugins/ui_actions/public/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md)

## API Reference

## Packages

| Package | Description |
| --- | --- |
| [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [execute](./kibana-plugin-plugins-ui_actions-public.action.execute.md)

## Action.execute() method

Executes the action.

<b>Signature:</b>

```typescript
execute(context: ActionExecutionContext<Context>): Promise<void>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`Promise<void>`

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [getDisplayName](./kibana-plugin-plugins-ui_actions-public.action.getdisplayname.md)

## Action.getDisplayName() method

Returns a title to be displayed to the user.

<b>Signature:</b>

```typescript
getDisplayName(context: ActionExecutionContext<Context>): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`string`

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [getHref](./kibana-plugin-plugins-ui_actions-public.action.gethref.md)

## Action.getHref() method

This method should return a link if this item can be clicked on. The link is used to navigate user if user middle-clicks it or Ctrl + clicks or right-clicks and selects "Open in new tab".

<b>Signature:</b>

```typescript
getHref?(context: ActionExecutionContext<Context>): Promise<string | undefined>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`Promise<string | undefined>`

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [getIconType](./kibana-plugin-plugins-ui_actions-public.action.geticontype.md)

## Action.getIconType() method

Optional EUI icon type that can be displayed along with the title.

<b>Signature:</b>

```typescript
getIconType(context: ActionExecutionContext<Context>): string | undefined;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`string | undefined`

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [id](./kibana-plugin-plugins-ui_actions-public.action.id.md)

## Action.id property

A unique identifier for this action instance.

<b>Signature:</b>

```typescript
id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [isCompatible](./kibana-plugin-plugins-ui_actions-public.action.iscompatible.md)

## Action.isCompatible() method

Returns a promise that resolves to true if this action is compatible given the context, otherwise resolves to false.

<b>Signature:</b>

```typescript
isCompatible(context: ActionExecutionContext<Context>): Promise<boolean>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`Promise<boolean>`

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md)

## Action interface

<b>Signature:</b>

```typescript
export interface Action<Context extends BaseContext = {}, T = ActionType> extends Partial<Presentable<ActionExecutionContext<Context>>>
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [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. |

## Methods

| Method | Description |
| --- | --- |
| [execute(context)](./kibana-plugin-plugins-ui_actions-public.action.execute.md) | Executes the action. |
| [getDisplayName(context)](./kibana-plugin-plugins-ui_actions-public.action.getdisplayname.md) | Returns a title to be displayed to the user. |
| [getHref(context)](./kibana-plugin-plugins-ui_actions-public.action.gethref.md) | This method should return a link if this item can be clicked on. The link is used to navigate user if user middle-clicks it or Ctrl + clicks or right-clicks and selects "Open in new tab". |
| [getIconType(context)](./kibana-plugin-plugins-ui_actions-public.action.geticontype.md) | Optional EUI icon type that can be displayed along with the title. |
| [isCompatible(context)](./kibana-plugin-plugins-ui_actions-public.action.iscompatible.md) | Returns a promise that resolves to true if this action is compatible given the context, otherwise resolves to false. |
| [shouldAutoExecute(context)](./kibana-plugin-plugins-ui_actions-public.action.shouldautoexecute.md) | Determines if action should be executed automatically, without first showing up in context menu. false by default. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [MenuItem](./kibana-plugin-plugins-ui_actions-public.action.menuitem.md)

## Action.MenuItem property

`UiComponent` to render when displaying this action as a context menu item. If not provided, `getDisplayName` will be used instead.

<b>Signature:</b>

```typescript
MenuItem?: UiComponent<{
context: ActionExecutionContext<Context>;
}>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [order](./kibana-plugin-plugins-ui_actions-public.action.order.md)

## Action.order property

Determined the order when there is more than one action matched to a trigger. Higher numbers are displayed first.

<b>Signature:</b>

```typescript
order?: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [shouldAutoExecute](./kibana-plugin-plugins-ui_actions-public.action.shouldautoexecute.md)

## Action.shouldAutoExecute() method

Determines if action should be executed automatically, without first showing up in context menu. false by default.

<b>Signature:</b>

```typescript
shouldAutoExecute?(context: ActionExecutionContext<Context>): Promise<boolean>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| context | <code>ActionExecutionContext&lt;Context&gt;</code> | |

<b>Returns:</b>

`Promise<boolean>`

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [Action](./kibana-plugin-plugins-ui_actions-public.action.md) &gt; [type](./kibana-plugin-plugins-ui_actions-public.action.type.md)

## Action.type property

The action type is what determines the context shape.

<b>Signature:</b>

```typescript
readonly type: T;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ACTION\_VISUALIZE\_FIELD](./kibana-plugin-plugins-ui_actions-public.action_visualize_field.md)

## ACTION\_VISUALIZE\_FIELD variable

<b>Signature:</b>

```typescript
ACTION_VISUALIZE_FIELD = "ACTION_VISUALIZE_FIELD"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ACTION\_VISUALIZE\_GEO\_FIELD](./kibana-plugin-plugins-ui_actions-public.action_visualize_geo_field.md)

## ACTION\_VISUALIZE\_GEO\_FIELD variable

<b>Signature:</b>

```typescript
ACTION_VISUALIZE_GEO_FIELD = "ACTION_VISUALIZE_GEO_FIELD"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionByType](./kibana-plugin-plugins-ui_actions-public.actionbytype.md)

## ActionByType type

<b>Signature:</b>

```typescript
export declare type ActionByType<T extends ActionType> = Action<ActionContextMapping[T], T>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) &gt; [""](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md)

## ActionContextMapping."" property

<b>Signature:</b>

```typescript
[DEFAULT_ACTION]: BaseContext;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) &gt; [ACTION\_VISUALIZE\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md)

## ActionContextMapping.ACTION\_VISUALIZE\_FIELD property

<b>Signature:</b>

```typescript
[ACTION_VISUALIZE_FIELD]: VisualizeFieldContext;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md) &gt; [ACTION\_VISUALIZE\_GEO\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md)

## ActionContextMapping.ACTION\_VISUALIZE\_GEO\_FIELD property

<b>Signature:</b>

```typescript
[ACTION_VISUALIZE_GEO_FIELD]: VisualizeFieldContext;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionContextMapping](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md)

## ActionContextMapping interface

<b>Signature:</b>

```typescript
export interface ActionContextMapping
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [""](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.__.md) | <code>BaseContext</code> | |
| [ACTION\_VISUALIZE\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_field.md) | <code>VisualizeFieldContext</code> | |
| [ACTION\_VISUALIZE\_GEO\_FIELD](./kibana-plugin-plugins-ui_actions-public.actioncontextmapping.action_visualize_geo_field.md) | <code>VisualizeFieldContext</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionDefinitionByType](./kibana-plugin-plugins-ui_actions-public.actiondefinitionbytype.md)

## ActionDefinitionByType type

<b>Signature:</b>

```typescript
export declare type ActionDefinitionByType<T extends ActionType> = ActionDefinition<ActionContextMapping[T]>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-ui\_actions-public](./kibana-plugin-plugins-ui_actions-public.md) &gt; [ActionExecutionContext](./kibana-plugin-plugins-ui_actions-public.actionexecutioncontext.md)

## ActionExecutionContext type

Action methods are executed with Context from trigger + [ActionExecutionMeta](./kibana-plugin-plugins-ui_actions-public.actionexecutionmeta.md)

<b>Signature:</b>

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