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

Support "Deprecated" label in advanced settings #54539

Merged
merged 14 commits into from
Jan 13, 2020

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'brace/mode/markdown';

import { toastNotifications } from 'ui/notify';
import {
EuiBadge,
EuiButton,
EuiButtonEmpty,
EuiCode,
Expand All @@ -41,6 +42,7 @@ import {
EuiImage,
EuiLink,
EuiSpacer,
EuiToolTip,
EuiText,
EuiSelect,
EuiSwitch,
Expand Down Expand Up @@ -565,6 +567,26 @@ export class Field extends PureComponent {

renderDescription(setting) {
let description;
let deprecation;

if (setting.deprecation) {
deprecation = (
<>
<EuiToolTip content={setting.deprecation.message}>
<EuiBadge
color="warning"
onClick={() => {
window.open(setting.deprecation.url, '_blank');
lizozom marked this conversation as resolved.
Show resolved Hide resolved
}}
onClickAriaLabel="Click to view deprecation documentation for this setting."
lizozom marked this conversation as resolved.
Show resolved Hide resolved
>
Deprecated
</EuiBadge>
</EuiToolTip>
<EuiSpacer size="s" />
</>
);
}

if (React.isValidElement(setting.description)) {
description = setting.description;
Expand All @@ -582,6 +604,7 @@ export class Field extends PureComponent {

return (
<Fragment>
{deprecation}
{description}
{this.renderDefaultValue(setting)}
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
? {
regex: new RegExp(def.validation.regexString),
Expand Down
6 changes: 6 additions & 0 deletions src/legacy/core_plugins/kibana/ui_setting_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
lizozom marked this conversation as resolved.
Show resolved Hide resolved
message: i18n.translate('kbn.advancedSettings.courier.batchSearchesTextDeprecation', {
defaultMessage: 'This setting is deprecated and will be removed in Kibana 8.0.',
}),
url: 'https://www.elastic.co/guide/en/kibana/current/advanced-options.html',
lizozom marked this conversation as resolved.
Show resolved Hide resolved
},
category: ['search'],
},
'search:includeFrozen': {
Expand Down