forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UiSettings validation & Kibana default route redirection (elastic…
…#59694) * add schema to ui settings params * add validation for defaults and overrides * validate in ui settings client * ui settings routes validation * clean up tests * use schema for defaultRoutes * move URL redirection to NP * fix spaces test * update docs * update kbn pm * fix karma test * fix tests * address comments * get rid of getDEfaultRoute * regen docs * fix tests * fix enter-spaces test * validate on relative url format * update i18n * fix enter-spoace test * move relative url validation to utils * add CoreApp containing application logic * extract public uiSettings params in a separate type * make schema required * update docs
- Loading branch information
Showing
63 changed files
with
1,311 additions
and
362 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.getall.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-core-public](./kibana-plugin-core-public.md) > [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) > [getAll](./kibana-plugin-core-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, PublicUiSettingsParams & UserProvidedValues>>; | ||
``` |
32 changes: 32 additions & 0 deletions
32
docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.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,32 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [IUiSettingsClient](./kibana-plugin-core-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-core-public.iuisettingsclient.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IUiSettingsClient | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [get](./kibana-plugin-core-public.iuisettingsclient.get.md) | <code><T = any>(key: string, defaultOverride?: T) => 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-core-public.iuisettingsclient.get_.md) | <code><T = any>(key: string, defaultOverride?: T) => Observable<T></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-core-public.iuisettingsclient.getall.md) | <code>() => Readonly<Record<string, PublicUiSettingsParams & UserProvidedValues>></code> | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. | | ||
| [getSaved$](./kibana-plugin-core-public.iuisettingsclient.getsaved_.md) | <code><T = any>() => Observable<{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }></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-core-public.iuisettingsclient.getupdate_.md) | <code><T = any>() => Observable<{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }></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-core-public.iuisettingsclient.getupdateerrors_.md) | <code>() => Observable<Error></code> | Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class. | | ||
| [isCustom](./kibana-plugin-core-public.iuisettingsclient.iscustom.md) | <code>(key: string) => 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-core-public.iuisettingsclient.isdeclared.md) | <code>(key: string) => 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-core-public.iuisettingsclient.isdefault.md) | <code>(key: string) => boolean</code> | Returns true if the setting has no user-defined value or is unknown | | ||
| [isOverridden](./kibana-plugin-core-public.iuisettingsclient.isoverridden.md) | <code>(key: string) => boolean</code> | Shows whether the uiSettings value set by the user. | | ||
| [overrideLocalDefault](./kibana-plugin-core-public.iuisettingsclient.overridelocaldefault.md) | <code>(key: string, newDefault: any) => 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-core-public.iuisettingsclient.remove.md) | <code>(key: string) => Promise<boolean></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-core-public.iuisettingsclient.set.md) | <code>(key: string, value: any) => Promise<boolean></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. | | ||
|
Oops, something went wrong.