-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor] Move AttributeService from Dashboard to Embeddable plugin (#…
…79830) * [Refactor] Move AttributeService from Dashboard to Embeddable plugin * Fix wrong import * Fixing typescript errors * Make Dashboard a required dependency * Fixing circular dependency * Fix label namespace * Updating docs Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
356c017
commit 13059bd
Showing
42 changed files
with
335 additions
and
71 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...eddable/public/kibana-plugin-plugins-embeddable-public.attribute_service_key.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [ATTRIBUTE\_SERVICE\_KEY](./kibana-plugin-plugins-embeddable-public.attribute_service_key.md) | ||
|
||
## ATTRIBUTE\_SERVICE\_KEY variable | ||
|
||
The attribute service is a shared, generic service that embeddables can use to provide the functionality required to fulfill the requirements of the ReferenceOrValueEmbeddable interface. The attribute\_service can also be used as a higher level wrapper to transform an embeddable input shape that references a saved object into an embeddable input shape that contains that saved object's attributes by value. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
ATTRIBUTE_SERVICE_KEY = "attributes" | ||
``` |
25 changes: 25 additions & 0 deletions
25
...ublic/kibana-plugin-plugins-embeddable-public.attributeservice._constructor_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [(constructor)](./kibana-plugin-plugins-embeddable-public.attributeservice._constructor_.md) | ||
|
||
## AttributeService.(constructor) | ||
|
||
Constructs a new instance of the `AttributeService` class | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
constructor(type: string, showSaveModal: (saveModal: React.ReactElement, I18nContext: I18nStart['Context']) => void, i18nContext: I18nStart['Context'], toasts: NotificationsStart['toasts'], options: AttributeServiceOptions<SavedObjectAttributes>, getEmbeddableFactory?: (embeddableFactoryId: string) => EmbeddableFactory); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| type | <code>string</code> | | | ||
| showSaveModal | <code>(saveModal: React.ReactElement, I18nContext: I18nStart['Context']) => void</code> | | | ||
| i18nContext | <code>I18nStart['Context']</code> | | | ||
| toasts | <code>NotificationsStart['toasts']</code> | | | ||
| options | <code>AttributeServiceOptions<SavedObjectAttributes></code> | | | ||
| getEmbeddableFactory | <code>(embeddableFactoryId: string) => EmbeddableFactory</code> | | | ||
|
22 changes: 22 additions & 0 deletions
22
...in-plugins-embeddable-public.attributeservice.getexplicitinputfromembeddable.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [getExplicitInputFromEmbeddable](./kibana-plugin-plugins-embeddable-public.attributeservice.getexplicitinputfromembeddable.md) | ||
|
||
## AttributeService.getExplicitInputFromEmbeddable() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getExplicitInputFromEmbeddable(embeddable: IEmbeddable): ValType | RefType; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| embeddable | <code>IEmbeddable</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`ValType | RefType` | ||
|
16 changes: 16 additions & 0 deletions
16
...c/kibana-plugin-plugins-embeddable-public.attributeservice.getinputasreftype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [getInputAsRefType](./kibana-plugin-plugins-embeddable-public.attributeservice.getinputasreftype.md) | ||
|
||
## AttributeService.getInputAsRefType property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getInputAsRefType: (input: ValType | RefType, saveOptions?: { | ||
showSaveModal: boolean; | ||
saveModalTitle?: string | undefined; | ||
} | { | ||
title: string; | ||
} | undefined) => Promise<RefType>; | ||
``` |
11 changes: 11 additions & 0 deletions
11
...kibana-plugin-plugins-embeddable-public.attributeservice.getinputasvaluetype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [getInputAsValueType](./kibana-plugin-plugins-embeddable-public.attributeservice.getinputasvaluetype.md) | ||
|
||
## AttributeService.getInputAsValueType property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getInputAsValueType: (input: ValType | RefType) => Promise<ValType>; | ||
``` |
11 changes: 11 additions & 0 deletions
11
...blic/kibana-plugin-plugins-embeddable-public.attributeservice.inputisreftype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [inputIsRefType](./kibana-plugin-plugins-embeddable-public.attributeservice.inputisreftype.md) | ||
|
||
## AttributeService.inputIsRefType property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
inputIsRefType: (input: ValType | RefType) => input is RefType; | ||
``` |
40 changes: 40 additions & 0 deletions
40
...s/embeddable/public/kibana-plugin-plugins-embeddable-public.attributeservice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) | ||
|
||
## AttributeService class | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare class AttributeService<SavedObjectAttributes extends { | ||
title: string; | ||
}, ValType extends EmbeddableInput & { | ||
[ATTRIBUTE_SERVICE_KEY]: SavedObjectAttributes; | ||
} = EmbeddableInput & { | ||
[ATTRIBUTE_SERVICE_KEY]: SavedObjectAttributes; | ||
}, RefType extends SavedObjectEmbeddableInput = SavedObjectEmbeddableInput> | ||
``` | ||
|
||
## Constructors | ||
|
||
| Constructor | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [(constructor)(type, showSaveModal, i18nContext, toasts, options, getEmbeddableFactory)](./kibana-plugin-plugins-embeddable-public.attributeservice._constructor_.md) | | Constructs a new instance of the <code>AttributeService</code> class | | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [getInputAsRefType](./kibana-plugin-plugins-embeddable-public.attributeservice.getinputasreftype.md) | | <code>(input: ValType | RefType, saveOptions?: {</code><br/><code> showSaveModal: boolean;</code><br/><code> saveModalTitle?: string | undefined;</code><br/><code> } | {</code><br/><code> title: string;</code><br/><code> } | undefined) => Promise<RefType></code> | | | ||
| [getInputAsValueType](./kibana-plugin-plugins-embeddable-public.attributeservice.getinputasvaluetype.md) | | <code>(input: ValType | RefType) => Promise<ValType></code> | | | ||
| [inputIsRefType](./kibana-plugin-plugins-embeddable-public.attributeservice.inputisreftype.md) | | <code>(input: ValType | RefType) => input is RefType</code> | | | ||
|
||
## Methods | ||
|
||
| Method | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [getExplicitInputFromEmbeddable(embeddable)](./kibana-plugin-plugins-embeddable-public.attributeservice.getexplicitinputfromembeddable.md) | | | | ||
| [unwrapAttributes(input)](./kibana-plugin-plugins-embeddable-public.attributeservice.unwrapattributes.md) | | | | ||
| [wrapAttributes(newAttributes, useRefType, input)](./kibana-plugin-plugins-embeddable-public.attributeservice.wrapattributes.md) | | | | ||
|
22 changes: 22 additions & 0 deletions
22
...ic/kibana-plugin-plugins-embeddable-public.attributeservice.unwrapattributes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [unwrapAttributes](./kibana-plugin-plugins-embeddable-public.attributeservice.unwrapattributes.md) | ||
|
||
## AttributeService.unwrapAttributes() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
unwrapAttributes(input: RefType | ValType): Promise<SavedObjectAttributes>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| input | <code>RefType | ValType</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`Promise<SavedObjectAttributes>` | ||
|
24 changes: 24 additions & 0 deletions
24
...blic/kibana-plugin-plugins-embeddable-public.attributeservice.wrapattributes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [AttributeService](./kibana-plugin-plugins-embeddable-public.attributeservice.md) > [wrapAttributes](./kibana-plugin-plugins-embeddable-public.attributeservice.wrapattributes.md) | ||
|
||
## AttributeService.wrapAttributes() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
wrapAttributes(newAttributes: SavedObjectAttributes, useRefType: boolean, input?: ValType | RefType): Promise<Omit<ValType | RefType, 'id'>>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| newAttributes | <code>SavedObjectAttributes</code> | | | ||
| useRefType | <code>boolean</code> | | | ||
| input | <code>ValType | RefType</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`Promise<Omit<ValType | RefType, 'id'>>` | ||
|
17 changes: 17 additions & 0 deletions
17
.../kibana-plugin-plugins-embeddable-public.embeddablestart.getattributeservice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) > [EmbeddableStart](./kibana-plugin-plugins-embeddable-public.embeddablestart.md) > [getAttributeService](./kibana-plugin-plugins-embeddable-public.embeddablestart.getattributeservice.md) | ||
|
||
## EmbeddableStart.getAttributeService property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getAttributeService: <A extends { | ||
title: string; | ||
}, V extends EmbeddableInput & { | ||
[ATTRIBUTE_SERVICE_KEY]: A; | ||
} = EmbeddableInput & { | ||
[ATTRIBUTE_SERVICE_KEY]: A; | ||
}, R extends SavedObjectEmbeddableInput = SavedObjectEmbeddableInput>(type: string, options: AttributeServiceOptions<A>) => AttributeService<A, V, R>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../kibana-plugin-plugins-embeddable-server.embeddablesetup.getattributeservice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) > [kibana-plugin-plugins-embeddable-server](./kibana-plugin-plugins-embeddable-server.md) > [EmbeddableSetup](./kibana-plugin-plugins-embeddable-server.embeddablesetup.md) > [getAttributeService](./kibana-plugin-plugins-embeddable-server.embeddablesetup.getattributeservice.md) | ||
|
||
## EmbeddableSetup.getAttributeService property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getAttributeService: any; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.