* Support deprecating label in advanced settings
mark courier:batchSearches as deprecated
* jest update
* Add deprecation to UiSettingsParams type
Translate click aria label
Use docLinks service
* Rename doc link
* Remove url option from DeprecationSettings
* Simplify code
* Updated docs
* Revert "Updated docs"
This reverts commit c9512ced1f
.
* snapshots
* docs
This commit is contained in:
parent
c38ed9bfff
commit
1ccd5705b1
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) > [deprecation](./kibana-plugin-server.uisettingsparams.deprecation.md)
|
||||
|
||||
## UiSettingsParams.deprecation property
|
||||
|
||||
optional deprecation information. Used to generate a deprecation warning.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
deprecation?: DeprecationSettings;
|
||||
```
|
|
@ -17,6 +17,7 @@ export interface UiSettingsParams
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [category](./kibana-plugin-server.uisettingsparams.category.md) | <code>string[]</code> | used to group the configured setting in the UI |
|
||||
| [deprecation](./kibana-plugin-server.uisettingsparams.deprecation.md) | <code>DeprecationSettings</code> | optional deprecation information. Used to generate a deprecation warning. |
|
||||
| [description](./kibana-plugin-server.uisettingsparams.description.md) | <code>string</code> | description provided to a user in UI |
|
||||
| [name](./kibana-plugin-server.uisettingsparams.name.md) | <code>string</code> | title in the UI |
|
||||
| [optionLabels](./kibana-plugin-server.uisettingsparams.optionlabels.md) | <code>Record<string, string></code> | text labels for 'select' type UI element |
|
||||
|
|
|
@ -115,6 +115,9 @@ export class DocLinksService {
|
|||
date: {
|
||||
dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`,
|
||||
},
|
||||
management: {
|
||||
kibanaSearchSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1928,6 +1928,8 @@ export type SharedGlobalConfig = RecursiveReadonly_2<{
|
|||
// @public
|
||||
export interface UiSettingsParams {
|
||||
category?: string[];
|
||||
// Warning: (ae-forgotten-export) The symbol "DeprecationSettings" needs to be exported by the entry point index.d.ts
|
||||
deprecation?: DeprecationSettings;
|
||||
description?: string;
|
||||
name?: string;
|
||||
optionLabels?: Record<string, string>;
|
||||
|
|
|
@ -73,6 +73,15 @@ export interface UserProvidedValues<T = any> {
|
|||
isOverridden?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* UiSettings deprecation field options.
|
||||
* @public
|
||||
* */
|
||||
export interface DeprecationSettings {
|
||||
message: string;
|
||||
docLinksKey: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* UI element type to represent the settings.
|
||||
* @public
|
||||
|
@ -102,6 +111,8 @@ export interface UiSettingsParams {
|
|||
readonly?: boolean;
|
||||
/** defines a type of UI element {@link UiSettingsType} */
|
||||
type?: UiSettingsType;
|
||||
/** optional deprecation information. Used to generate a deprecation warning. */
|
||||
deprecation?: DeprecationSettings;
|
||||
/*
|
||||
* Allows defining a custom validation applicable to value change on the client.
|
||||
* @deprecated
|
||||
|
|
|
@ -60,6 +60,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"defVal": Array [
|
||||
"default_value",
|
||||
],
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test array setting",
|
||||
"displayName": "Test array setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -79,6 +80,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"elasticsearch",
|
||||
],
|
||||
"defVal": true,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test boolean setting",
|
||||
"displayName": "Test boolean setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -100,6 +102,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test custom string setting",
|
||||
"displayName": "Test custom string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -119,6 +122,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test image setting",
|
||||
"displayName": "Test image setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -140,6 +144,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"defVal": "{
|
||||
\\"foo\\": \\"bar\\"
|
||||
}",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden json",
|
||||
"displayName": "An overridden json",
|
||||
"isCustom": undefined,
|
||||
|
@ -159,6 +164,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": 1234,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden number",
|
||||
"displayName": "An overridden number",
|
||||
"isCustom": undefined,
|
||||
|
@ -178,6 +184,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "orange",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden select setting",
|
||||
"displayName": "Test overridden select setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -201,6 +208,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "foo",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden string",
|
||||
"displayName": "An overridden string",
|
||||
"isCustom": undefined,
|
||||
|
@ -220,6 +228,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "{\\"foo\\": \\"bar\\"}",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test json setting",
|
||||
"displayName": "Test json setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -239,6 +248,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test markdown setting",
|
||||
"displayName": "Test markdown setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -258,6 +268,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": 5,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test number setting",
|
||||
"displayName": "Test number setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -277,6 +288,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "orange",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test select setting",
|
||||
"displayName": "Test select setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -300,6 +312,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -345,6 +358,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"defVal": Array [
|
||||
"default_value",
|
||||
],
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test array setting",
|
||||
"displayName": "Test array setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -364,6 +378,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"elasticsearch",
|
||||
],
|
||||
"defVal": true,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test boolean setting",
|
||||
"displayName": "Test boolean setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -385,6 +400,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test custom string setting",
|
||||
"displayName": "Test custom string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -404,6 +420,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test image setting",
|
||||
"displayName": "Test image setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -425,6 +442,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"defVal": "{
|
||||
\\"foo\\": \\"bar\\"
|
||||
}",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden json",
|
||||
"displayName": "An overridden json",
|
||||
"isCustom": undefined,
|
||||
|
@ -444,6 +462,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": 1234,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden number",
|
||||
"displayName": "An overridden number",
|
||||
"isCustom": undefined,
|
||||
|
@ -463,6 +482,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "orange",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden select setting",
|
||||
"displayName": "Test overridden select setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -486,6 +506,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "foo",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for overridden string",
|
||||
"displayName": "An overridden string",
|
||||
"isCustom": undefined,
|
||||
|
@ -505,6 +526,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "{\\"foo\\": \\"bar\\"}",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test json setting",
|
||||
"displayName": "Test json setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -524,6 +546,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test markdown setting",
|
||||
"displayName": "Test markdown setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -543,6 +566,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": 5,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test number setting",
|
||||
"displayName": "Test number setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -562,6 +586,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": "orange",
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test select setting",
|
||||
"displayName": "Test select setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -585,6 +610,7 @@ exports[`AdvancedSettings should render normally 1`] = `
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -705,6 +731,7 @@ exports[`AdvancedSettings should render read-only when saving is disabled 1`] =
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -748,6 +775,7 @@ exports[`AdvancedSettings should render read-only when saving is disabled 1`] =
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -886,6 +914,7 @@ exports[`AdvancedSettings should render specific setting if given setting key 1`
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
@ -929,6 +958,7 @@ exports[`AdvancedSettings should render specific setting if given setting key 1`
|
|||
"general",
|
||||
],
|
||||
"defVal": null,
|
||||
"deprecation": undefined,
|
||||
"description": "Description for Test string setting",
|
||||
"displayName": "Test string setting",
|
||||
"isCustom": undefined,
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
|
||||
import 'brace/theme/textmate';
|
||||
import 'brace/mode/markdown';
|
||||
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
import {
|
||||
EuiBadge,
|
||||
EuiButton,
|
||||
EuiButtonEmpty,
|
||||
EuiCode,
|
||||
|
@ -41,6 +43,7 @@ import {
|
|||
EuiImage,
|
||||
EuiLink,
|
||||
EuiSpacer,
|
||||
EuiToolTip,
|
||||
EuiText,
|
||||
EuiSelect,
|
||||
EuiSwitch,
|
||||
|
@ -565,6 +568,36 @@ export class Field extends PureComponent {
|
|||
|
||||
renderDescription(setting) {
|
||||
let description;
|
||||
let deprecation;
|
||||
|
||||
if (setting.deprecation) {
|
||||
const { links } = npStart.core.docLinks;
|
||||
|
||||
deprecation = (
|
||||
<>
|
||||
<EuiToolTip content={setting.deprecation.message}>
|
||||
<EuiBadge
|
||||
color="warning"
|
||||
onClick={() => {
|
||||
window.open(links.management[setting.deprecation.docLinksKey], '_blank');
|
||||
}}
|
||||
onClickAriaLabel={i18n.translate(
|
||||
'kbn.management.settings.field.deprecationClickAreaLabel',
|
||||
{
|
||||
defaultMessage: 'Click to view deprecation documentation for {settingName}.',
|
||||
values: {
|
||||
settingName: setting.name,
|
||||
},
|
||||
}
|
||||
)}
|
||||
>
|
||||
Deprecated
|
||||
</EuiBadge>
|
||||
</EuiToolTip>
|
||||
<EuiSpacer size="s" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (React.isValidElement(setting.description)) {
|
||||
description = setting.description;
|
||||
|
@ -582,6 +615,7 @@ export class Field extends PureComponent {
|
|||
|
||||
return (
|
||||
<Fragment>
|
||||
{deprecation}
|
||||
{description}
|
||||
{this.renderDefaultValue(setting)}
|
||||
</Fragment>
|
||||
|
|
|
@ -43,6 +43,7 @@ export function toEditableConfig({ def, name, value, isCustom, isOverridden }) {
|
|||
defVal: def.value,
|
||||
type: getValType(def, value),
|
||||
description: def.description,
|
||||
deprecation: def.deprecation,
|
||||
validation:
|
||||
def.validation && def.validation.regexString
|
||||
? {
|
||||
|
|
|
@ -458,6 +458,12 @@ export function getUiSettingDefaults() {
|
|||
away or update the query. When enabled, dashboard panels will load together when all of the data is loaded, and
|
||||
searches will not terminate.`,
|
||||
}),
|
||||
deprecation: {
|
||||
message: i18n.translate('kbn.advancedSettings.courier.batchSearchesTextDeprecation', {
|
||||
defaultMessage: 'This setting is deprecated and will be removed in Kibana 8.0.',
|
||||
}),
|
||||
docLinksKey: 'kibanaSearchSettings',
|
||||
},
|
||||
category: ['search'],
|
||||
},
|
||||
'search:includeFrozen': {
|
||||
|
|
|
@ -170,6 +170,9 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -460,6 +463,9 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
|
|
@ -276,6 +276,9 @@ exports[`QueryStringInput Should disable autoFocus on EuiFieldText when disableA
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -896,6 +899,9 @@ exports[`QueryStringInput Should disable autoFocus on EuiFieldText when disableA
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -1504,6 +1510,9 @@ exports[`QueryStringInput Should pass the query language to the language switche
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -2121,6 +2130,9 @@ exports[`QueryStringInput Should pass the query language to the language switche
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -2729,6 +2741,9 @@ exports[`QueryStringInput Should render the given query 1`] = `
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
@ -3346,6 +3361,9 @@ exports[`QueryStringInput Should render the given query 1`] = `
|
|||
"logstash": Object {
|
||||
"base": "https://www.elastic.co/guide/en/logstash/mocked-test-branch",
|
||||
},
|
||||
"management": Object {
|
||||
"kibanaSearchSettings": "https://www.elastic.co/guide/en/kibana/mocked-test-branch/advanced-options.html#kibana-search-settings",
|
||||
},
|
||||
"metricbeat": Object {
|
||||
"base": "https://www.elastic.co/guide/en/beats/metricbeat/mocked-test-branch",
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue