Skip to content

Commit

Permalink
Fix advanced settings category sorting (#83394)
Browse files Browse the repository at this point in the history
In the advanced settings categories, "Observability" and "Machine Learning" were using uppercase letters in their keys while everything else was using lowercase

This caused them both to show up before the rest of the options in the dropdown and in the sorting in the advanced settings UI.

Add keys for them to the get_category_name module in the advanced settings plugin and use those keys in the plugins that apply these categories.

This also makes it so i18n keys are available for these items.

Fixes #81974.
  • Loading branch information
smith authored Nov 16, 2020
1 parent 3ba7758 commit 3f51bf5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const names: Record<string, string> = {
general: i18n.translate('advancedSettings.categoryNames.generalLabel', {
defaultMessage: 'General',
}),
machineLearning: i18n.translate('advancedSettings.categoryNames.machineLearningLabel', {
defaultMessage: 'Machine Learning',
}),
observability: i18n.translate('advancedSettings.categoryNames.observabilityLabel', {
defaultMessage: 'Observability',
}),
timelion: i18n.translate('advancedSettings.categoryNames.timelionLabel', {
defaultMessage: 'Timelion',
}),
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
*/
export const uiSettings: Record<string, UiSettingsParams<boolean>> = {
[enableCorrelations]: {
category: ['Observability'],
category: ['observability'],
name: i18n.translate('xpack.apm.enableCorrelationsExperimentName', {
defaultMessage: 'APM Correlations',
}),
Expand All @@ -32,7 +32,7 @@ export const uiSettings: Record<string, UiSettingsParams<boolean>> = {
schema: schema.boolean(),
},
[enableServiceOverview]: {
category: ['Observability'],
category: ['observability'],
name: i18n.translate('xpack.apm.enableServiceOverviewExperimentName', {
defaultMessage: 'APM Service overview',
}),
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/ml/server/lib/register_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
defaultMessage:
'Sets the file size limit when importing data in the File Data Visualizer. The highest supported value for this setting is 1GB.',
}),
category: ['Machine Learning'],
category: ['machineLearning'],
schema: schema.string(),
validation: {
regexString: '\\d+[mMgG][bB]',
Expand All @@ -49,7 +49,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
'Use the default time filter in the Single Metric Viewer and Anomaly Explorer. If not enabled, the results for the full time range of the job are displayed.',
}
),
category: ['Machine Learning'],
category: ['machineLearning'],
},
[ANOMALY_DETECTION_DEFAULT_TIME_RANGE]: {
name: i18n.translate('xpack.ml.advancedSettings.anomalyDetectionDefaultTimeRangeName', {
Expand All @@ -69,7 +69,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
to: schema.string(),
}),
requiresPageReload: true,
category: ['Machine Learning'],
category: ['machineLearning'],
},
});
}

0 comments on commit 3f51bf5

Please sign in to comment.