Skip to content

Commit d04ac61

Browse files
smithkibanamachine
andauthored
Fix advanced settings category sorting (#83394) (#83434)
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. Co-authored-by: Kibana Machine <[email protected]>
1 parent 2e9fa46 commit d04ac61

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const names: Record<string, string> = {
2525
general: i18n.translate('advancedSettings.categoryNames.generalLabel', {
2626
defaultMessage: 'General',
2727
}),
28+
machineLearning: i18n.translate('advancedSettings.categoryNames.machineLearningLabel', {
29+
defaultMessage: 'Machine Learning',
30+
}),
31+
observability: i18n.translate('advancedSettings.categoryNames.observabilityLabel', {
32+
defaultMessage: 'Observability',
33+
}),
2834
timelion: i18n.translate('advancedSettings.categoryNames.timelionLabel', {
2935
defaultMessage: 'Timelion',
3036
}),

x-pack/plugins/apm/server/ui_settings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
*/
1818
export const uiSettings: Record<string, UiSettingsParams<boolean>> = {
1919
[enableCorrelations]: {
20-
category: ['Observability'],
20+
category: ['observability'],
2121
name: i18n.translate('xpack.apm.enableCorrelationsExperimentName', {
2222
defaultMessage: 'APM Correlations',
2323
}),
@@ -32,7 +32,7 @@ export const uiSettings: Record<string, UiSettingsParams<boolean>> = {
3232
schema: schema.boolean(),
3333
},
3434
[enableServiceOverview]: {
35-
category: ['Observability'],
35+
category: ['observability'],
3636
name: i18n.translate('xpack.apm.enableServiceOverviewExperimentName', {
3737
defaultMessage: 'APM Service overview',
3838
}),

x-pack/plugins/ml/server/lib/register_settings.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
2727
defaultMessage:
2828
'Sets the file size limit when importing data in the File Data Visualizer. The highest supported value for this setting is 1GB.',
2929
}),
30-
category: ['Machine Learning'],
30+
category: ['machineLearning'],
3131
schema: schema.string(),
3232
validation: {
3333
regexString: '\\d+[mMgG][bB]',
@@ -49,7 +49,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
4949
'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.',
5050
}
5151
),
52-
category: ['Machine Learning'],
52+
category: ['machineLearning'],
5353
},
5454
[ANOMALY_DETECTION_DEFAULT_TIME_RANGE]: {
5555
name: i18n.translate('xpack.ml.advancedSettings.anomalyDetectionDefaultTimeRangeName', {
@@ -69,7 +69,7 @@ export function registerKibanaSettings(coreSetup: CoreSetup) {
6969
to: schema.string(),
7070
}),
7171
requiresPageReload: true,
72-
category: ['Machine Learning'],
72+
category: ['machineLearning'],
7373
},
7474
});
7575
}

0 commit comments

Comments
 (0)