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

Fix issue with "Infinity" value not working #12980

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/core_plugins/kibana/ui_setting_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,26 @@ export function getUiSettingDefaults() {
'notifications:lifetime:banner': {
value: 3000000,
description: 'The time in milliseconds which a banner notification ' +
'will be displayed on-screen for. Setting to Infinity will disable.'
'will be displayed on-screen for. Setting to Infinity will disable the countdown.',
type: 'number',
},
'notifications:lifetime:error': {
value: 300000,
description: 'The time in milliseconds which an error notification ' +
'will be displayed on-screen for. Setting to Infinity will disable.'
'will be displayed on-screen for. Setting to Infinity will disable.',
type: 'number',
},
'notifications:lifetime:warning': {
value: 10000,
description: 'The time in milliseconds which a warning notification ' +
'will be displayed on-screen for. Setting to Infinity will disable.'
'will be displayed on-screen for. Setting to Infinity will disable.',
type: 'number',
},
'notifications:lifetime:info': {
value: 5000,
description: 'The time in milliseconds which an information notification ' +
'will be displayed on-screen for. Setting to Infinity will disable.'
'will be displayed on-screen for. Setting to Infinity will disable.',
type: 'number',
},
'metrics:max_buckets': {
value: 2000,
Expand Down
2 changes: 2 additions & 0 deletions src/ui/public/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ will set the initial value if one is not already set.`);
const currentValue = config.isDefault(key) ? defaultValue : userValue;
if (type === 'json') {
return JSON.parse(currentValue);
} else if (type === 'number') {
return parseFloat(currentValue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This was easier than I expected. Kudos on finding this part.

}
return currentValue;
}
Expand Down