Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into move-index-patter…
Browse files Browse the repository at this point in the history
…ns-to-new-plugins-2
  • Loading branch information
Avinar-24 committed Nov 29, 2019
2 parents 676f2be + d4dedbb commit f71ee5f
Show file tree
Hide file tree
Showing 209 changed files with 3,185 additions and 2,708 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,21 @@ module.exports = {
],
allowSameFolder: true,
},
{
target: ['src/core/**/*'],
from: ['x-pack/**/*'],
errorMessage: 'OSS cannot import x-pack files.',
},
{
target: ['src/core/**/*'],
from: [
'plugins/**/*',
'src/plugins/**/*',
'src/legacy/core_plugins/**/*',
'src/legacy/ui/**/*',
],
errorMessage: 'The core cannot depend on any plugins.',
},
{
from: ['src/legacy/ui/**/*', 'ui/**/*'],
target: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ core: {
i18n: I18nStart;
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
uiSettings: IUiSettingsClient;
injectedMetadata: {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface AppMountContext

| Property | Type | Description |
| --- | --- | --- |
| [core](./kibana-plugin-public.appmountcontext.core.md) | <code>{</code><br/><code> application: Pick&lt;ApplicationStart, 'capabilities' &#124; 'navigateToApp'&gt;;</code><br/><code> chrome: ChromeStart;</code><br/><code> docLinks: DocLinksStart;</code><br/><code> http: HttpStart;</code><br/><code> i18n: I18nStart;</code><br/><code> notifications: NotificationsStart;</code><br/><code> overlays: OverlayStart;</code><br/><code> uiSettings: UiSettingsClientContract;</code><br/><code> injectedMetadata: {</code><br/><code> getInjectedVar: (name: string, defaultValue?: any) =&gt; unknown;</code><br/><code> };</code><br/><code> }</code> | Core service APIs available to mounted applications. |
| [core](./kibana-plugin-public.appmountcontext.core.md) | <code>{</code><br/><code> application: Pick&lt;ApplicationStart, 'capabilities' &#124; 'navigateToApp'&gt;;</code><br/><code> chrome: ChromeStart;</code><br/><code> docLinks: DocLinksStart;</code><br/><code> http: HttpStart;</code><br/><code> i18n: I18nStart;</code><br/><code> notifications: NotificationsStart;</code><br/><code> overlays: OverlayStart;</code><br/><code> uiSettings: IUiSettingsClient;</code><br/><code> injectedMetadata: {</code><br/><code> getInjectedVar: (name: string, defaultValue?: any) =&gt; unknown;</code><br/><code> };</code><br/><code> }</code> | Core service APIs available to mounted applications. |

Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Say we're creating a plugin for rendering visualizations that allows new renderi
export interface VizRenderContext {
core: {
i18n: I18nStart;
uiSettings: UISettingsClientContract;
uiSettings: IUiSettingsClient;
}
[contextName: string]: unknown;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export interface CoreSetup
| [http](./kibana-plugin-public.coresetup.http.md) | <code>HttpSetup</code> | [HttpSetup](./kibana-plugin-public.httpsetup.md) |
| [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md) | <code>{</code><br/><code> getInjectedVar: (name: string, defaultValue?: any) =&gt; unknown;</code><br/><code> }</code> | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead. |
| [notifications](./kibana-plugin-public.coresetup.notifications.md) | <code>NotificationsSetup</code> | [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) |
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | <code>UiSettingsClientContract</code> | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | <code>IUiSettingsClient</code> | [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) |

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## CoreSetup.uiSettings property

[UiSettingsClient](./kibana-plugin-public.uisettingsclient.md)
[IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md)

<b>Signature:</b>

```typescript
uiSettings: UiSettingsClientContract;
uiSettings: IUiSettingsClient;
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export interface CoreStart
| [notifications](./kibana-plugin-public.corestart.notifications.md) | <code>NotificationsStart</code> | [NotificationsStart](./kibana-plugin-public.notificationsstart.md) |
| [overlays](./kibana-plugin-public.corestart.overlays.md) | <code>OverlayStart</code> | [OverlayStart](./kibana-plugin-public.overlaystart.md) |
| [savedObjects](./kibana-plugin-public.corestart.savedobjects.md) | <code>SavedObjectsStart</code> | [SavedObjectsStart](./kibana-plugin-public.savedobjectsstart.md) |
| [uiSettings](./kibana-plugin-public.corestart.uisettings.md) | <code>UiSettingsClientContract</code> | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
| [uiSettings](./kibana-plugin-public.corestart.uisettings.md) | <code>IUiSettingsClient</code> | [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) |

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## CoreStart.uiSettings property

[UiSettingsClient](./kibana-plugin-public.uisettingsclient.md)
[IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md)

<b>Signature:</b>

```typescript
uiSettings: UiSettingsClientContract;
uiSettings: IUiSettingsClient;
```
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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [get](./kibana-plugin-public.iuisettingsclient.get.md)

## IUiSettingsClient.get property

Gets the value for a specific uiSetting. If this setting has no user-defined value then the `defaultOverride` parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not registered by any plugin then an error is thrown, otherwise reads the default value defined by a plugin.

<b>Signature:</b>

```typescript
get: <T = any>(key: string, defaultOverride?: T) => 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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [get$](./kibana-plugin-public.iuisettingsclient.get_.md)

## IUiSettingsClient.get$ property

Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a `defaultOverride` argument behaves the same as it does in \#get()

<b>Signature:</b>

```typescript
get$: <T = any>(key: string, defaultOverride?: T) => Observable<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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [getAll](./kibana-plugin-public.iuisettingsclient.getall.md)

## IUiSettingsClient.getAll property

Gets the metadata about all uiSettings, including the type, default value, and user value for each key.

<b>Signature:</b>

```typescript
getAll: () => Readonly<Record<string, UiSettingsParams & UserProvidedValues>>;
```
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) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [getSaved$](./kibana-plugin-public.iuisettingsclient.getsaved_.md)

## IUiSettingsClient.getSaved$ property

Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed.

<b>Signature:</b>

```typescript
getSaved$: <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}>;
```
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) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [getUpdate$](./kibana-plugin-public.iuisettingsclient.getupdate_.md)

## IUiSettingsClient.getUpdate$ property

Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed.

<b>Signature:</b>

```typescript
getUpdate$: <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}>;
```
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) &gt; [getUpdateErrors$](./kibana-plugin-public.uisettingsclient.getupdateerrors_.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [getUpdateErrors$](./kibana-plugin-public.iuisettingsclient.getupdateerrors_.md)

## UiSettingsClient.getUpdateErrors$() method
## IUiSettingsClient.getUpdateErrors$ property

Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class.

<b>Signature:</b>

```typescript
getUpdateErrors$(): Rx.Observable<Error>;
getUpdateErrors$: () => Observable<Error>;
```
<b>Returns:</b>

`Rx.Observable<Error>`

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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [isCustom](./kibana-plugin-public.iuisettingsclient.iscustom.md)

## IUiSettingsClient.isCustom property

Returns true if the setting wasn't registered by any plugin, but was either added directly via `set()`<!-- -->, or is an unknown setting found in the uiSettings saved object

<b>Signature:</b>

```typescript
isCustom: (key: string) => 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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [isDeclared](./kibana-plugin-public.iuisettingsclient.isdeclared.md)

## IUiSettingsClient.isDeclared property

Returns true if the key is a "known" uiSetting, meaning it is either registered by any plugin or was previously added as a custom setting via the `set()` method.

<b>Signature:</b>

```typescript
isDeclared: (key: string) => 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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [isDefault](./kibana-plugin-public.iuisettingsclient.isdefault.md)

## IUiSettingsClient.isDefault property

Returns true if the setting has no user-defined value or is unknown

<b>Signature:</b>

```typescript
isDefault: (key: string) => 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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [isOverridden](./kibana-plugin-public.iuisettingsclient.isoverridden.md)

## IUiSettingsClient.isOverridden property

Shows whether the uiSettings value set by the user.

<b>Signature:</b>

```typescript
isOverridden: (key: string) => 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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md)

## IUiSettingsClient interface

Client-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md)

<b>Signature:</b>

```typescript
export interface IUiSettingsClient
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [get](./kibana-plugin-public.iuisettingsclient.get.md) | <code>&lt;T = any&gt;(key: string, defaultOverride?: T) =&gt; T</code> | Gets the value for a specific uiSetting. If this setting has no user-defined value then the <code>defaultOverride</code> parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not registered by any plugin then an error is thrown, otherwise reads the default value defined by a plugin. |
| [get$](./kibana-plugin-public.iuisettingsclient.get_.md) | <code>&lt;T = any&gt;(key: string, defaultOverride?: T) =&gt; Observable&lt;T&gt;</code> | Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a <code>defaultOverride</code> argument behaves the same as it does in \#get() |
| [getAll](./kibana-plugin-public.iuisettingsclient.getall.md) | <code>() =&gt; Readonly&lt;Record&lt;string, UiSettingsParams &amp; UserProvidedValues&gt;&gt;</code> | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. |
| [getSaved$](./kibana-plugin-public.iuisettingsclient.getsaved_.md) | <code>&lt;T = any&gt;() =&gt; Observable&lt;{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }&gt;</code> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
| [getUpdate$](./kibana-plugin-public.iuisettingsclient.getupdate_.md) | <code>&lt;T = any&gt;() =&gt; Observable&lt;{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }&gt;</code> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
| [getUpdateErrors$](./kibana-plugin-public.iuisettingsclient.getupdateerrors_.md) | <code>() =&gt; Observable&lt;Error&gt;</code> | Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class. |
| [isCustom](./kibana-plugin-public.iuisettingsclient.iscustom.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the setting wasn't registered by any plugin, but was either added directly via <code>set()</code>, or is an unknown setting found in the uiSettings saved object |
| [isDeclared](./kibana-plugin-public.iuisettingsclient.isdeclared.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the key is a "known" uiSetting, meaning it is either registered by any plugin or was previously added as a custom setting via the <code>set()</code> method. |
| [isDefault](./kibana-plugin-public.iuisettingsclient.isdefault.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the setting has no user-defined value or is unknown |
| [isOverridden](./kibana-plugin-public.iuisettingsclient.isoverridden.md) | <code>(key: string) =&gt; boolean</code> | Shows whether the uiSettings value set by the user. |
| [overrideLocalDefault](./kibana-plugin-public.iuisettingsclient.overridelocaldefault.md) | <code>(key: string, newDefault: any) =&gt; void</code> | Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost. |
| [remove](./kibana-plugin-public.iuisettingsclient.remove.md) | <code>(key: string) =&gt; Promise&lt;boolean&gt;</code> | Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling <code>set(key, null)</code>, including the synchronization, custom setting, and error behavior of that method. |
| [set](./kibana-plugin-public.iuisettingsclient.set.md) | <code>(key: string, value: any) =&gt; Promise&lt;boolean&gt;</code> | Sets the value for a uiSetting. If the setting is not registered by any plugin it will be stored as a custom setting. The new value will be synchronously available via the <code>get()</code> method and sent to the server in the background. If the request to the server fails then a updateErrors$ will be notified and the setting will be reverted to its value before <code>set()</code> was called. |

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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [overrideLocalDefault](./kibana-plugin-public.iuisettingsclient.overridelocaldefault.md)

## IUiSettingsClient.overrideLocalDefault property

Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost.

<b>Signature:</b>

```typescript
overrideLocalDefault: (key: string, newDefault: any) => void;
```
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) &gt; [remove](./kibana-plugin-public.uisettingsclient.remove.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [remove](./kibana-plugin-public.iuisettingsclient.remove.md)

## UiSettingsClient.remove() method
## IUiSettingsClient.remove property

Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling `set(key, null)`<!-- -->, including the synchronization, custom setting, and error behavior of that method.

<b>Signature:</b>

```typescript
remove(key: string): Promise<boolean>;
remove: (key: string) => Promise<boolean>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| key | <code>string</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-public](./kibana-plugin-public.md) &gt; [IUiSettingsClient](./kibana-plugin-public.iuisettingsclient.md) &gt; [set](./kibana-plugin-public.iuisettingsclient.set.md)

## IUiSettingsClient.set property

Sets the value for a uiSetting. If the setting is not registered by any plugin it will be stored as a custom setting. The new value will be synchronously available via the `get()` method and sent to the server in the background. If the request to the server fails then a updateErrors$ will be notified and the setting will be reverted to its value before `set()` was called.

<b>Signature:</b>

```typescript
set: (key: string, value: any) => Promise<boolean>;
```
Loading

0 comments on commit f71ee5f

Please sign in to comment.