From d4f7c819366cd75d0aab97e4a5b83fac17a7e995 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Mon, 28 Aug 2023 22:22:05 +0000 Subject: [PATCH 1/6] Feat (Advanced Settings): Make new "Appearance" category And remove "Accessibility". Give category panels IDs so they can be deep linked Signed-off-by: Josh Romero --- src/core/server/ui_settings/settings/accessibility.ts | 2 +- src/core/server/ui_settings/settings/navigation.ts | 1 + src/core/server/ui_settings/settings/theme.ts | 2 ++ .../public/management_app/components/form/form.tsx | 2 +- .../public/management_app/lib/get_category_name.ts | 3 +++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/server/ui_settings/settings/accessibility.ts b/src/core/server/ui_settings/settings/accessibility.ts index 1238ae58d922..56fef57de84b 100644 --- a/src/core/server/ui_settings/settings/accessibility.ts +++ b/src/core/server/ui_settings/settings/accessibility.ts @@ -43,7 +43,7 @@ export const getAccessibilitySettings = (): Record => defaultMessage: 'Turn off all unnecessary animations in the OpenSearch Dashboards UI. Refresh the page to apply the changes.', }), - category: ['accessibility'], + category: ['appearance'], requiresPageReload: true, schema: schema.boolean(), }, diff --git a/src/core/server/ui_settings/settings/navigation.ts b/src/core/server/ui_settings/settings/navigation.ts index 966e6a58127a..2ea04e180f03 100644 --- a/src/core/server/ui_settings/settings/navigation.ts +++ b/src/core/server/ui_settings/settings/navigation.ts @@ -77,6 +77,7 @@ export const getNavigationSettings = (): Record => { defaultMessage: 'Legacy', }), }, + category: ['appearance'], schema: schema.oneOf([schema.literal('modern'), schema.literal('legacy')]), }, }; diff --git a/src/core/server/ui_settings/settings/theme.ts b/src/core/server/ui_settings/settings/theme.ts index c09106f9676d..2667d5f37be7 100644 --- a/src/core/server/ui_settings/settings/theme.ts +++ b/src/core/server/ui_settings/settings/theme.ts @@ -43,6 +43,7 @@ export const getThemeSettings = (): Record => { defaultMessage: `Enable a dark mode for the OpenSearch Dashboards UI. A page refresh is required for the setting to be applied.`, }), requiresPageReload: true, + category: ['appearance'], schema: schema.boolean(), }, 'theme:version': { @@ -56,6 +57,7 @@ export const getThemeSettings = (): Record => { defaultMessage: `Switch between the theme used for the current and next version of OpenSearch Dashboards, A page refresh is required for the setting to be applied.`, }), requiresPageReload: true, + category: ['appearance'], schema: schema.oneOf([schema.literal('v7'), schema.literal('Next (preview)')]), }, }; diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx index a74199771d2a..adf27cd48ec4 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx @@ -257,7 +257,7 @@ export class Form extends PureComponent { renderCategory(category: Category, settings: FieldSetting[], totalSettings: number) { return ( - + diff --git a/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts b/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts index fbc473ffdbf5..301374747f8b 100644 --- a/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts +++ b/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts @@ -36,6 +36,9 @@ const names: Record = { general: i18n.translate('advancedSettings.categoryNames.generalLabel', { defaultMessage: 'General', }), + appearance: i18n.translate('advancedSettings.categoryNames.appearanceLabel', { + defaultMessage: 'Appearance', + }), timeline: i18n.translate('advancedSettings.categoryNames.timelineLabel', { defaultMessage: 'Timeline', }), From 0852294256e7b9b71ff37bf3fe5ce69e86c1fc73 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Tue, 29 Aug 2023 17:51:30 +0000 Subject: [PATCH 2/6] updated changelog Signed-off-by: Josh Romero --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 560f91aa1866..fd9d8e7e6531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove visualization editor sidebar background ([#4719](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4719)) - [Vis Colors] Remove customized colors from sample visualizations and dashboards ([#4741](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4741)) - [Decouple] Allow plugin manifest config to define semver compatible OpenSearch plugin and verify if it is installed on the cluster([#4612](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4612)) +- [Advanced Settings] Consolidate settings into new "Appearance" category and add category IDs ([#4845](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4845)) ### 🐛 Bug Fixes From 33633133b11a5807d3164b772b769da33adc2642 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Tue, 29 Aug 2023 21:17:07 +0000 Subject: [PATCH 3/6] Update theme description add link to forum Signed-off-by: Josh Romero --- src/core/server/ui_settings/settings/theme.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/server/ui_settings/settings/theme.ts b/src/core/server/ui_settings/settings/theme.ts index 2667d5f37be7..e329afdb41aa 100644 --- a/src/core/server/ui_settings/settings/theme.ts +++ b/src/core/server/ui_settings/settings/theme.ts @@ -54,7 +54,8 @@ export const getThemeSettings = (): Record => { type: 'select', options: ['v7', 'Next (preview)'], description: i18n.translate('core.ui_settings.params.themeVersionText', { - defaultMessage: `Switch between the theme used for the current and next version of OpenSearch Dashboards, A page refresh is required for the setting to be applied.`, + defaultMessage: `

Switch between the theme used for the current and next version of OpenSearch Dashboards. A page refresh is required for the setting to be applied.

{linkText}

`, + values: { href: 'https://forum.opensearch.org/', linkText: 'Theme feedback' }, }), requiresPageReload: true, category: ['appearance'], From f5768615f5eb86d9b4f8d7e396d02c9f88ca2eae Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Wed, 30 Aug 2023 17:11:32 +0000 Subject: [PATCH 4/6] Update snapshots Signed-off-by: Josh Romero --- .../components/form/__snapshots__/form.test.tsx.snap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/advanced_settings/public/management_app/components/form/__snapshots__/form.test.tsx.snap b/src/plugins/advanced_settings/public/management_app/components/form/__snapshots__/form.test.tsx.snap index 645cc92d443f..c00da923a871 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/__snapshots__/form.test.tsx.snap +++ b/src/plugins/advanced_settings/public/management_app/components/form/__snapshots__/form.test.tsx.snap @@ -4,6 +4,7 @@ exports[`Form should not render no settings message when instructed not to 1`] =
@@ -135,6 +136,7 @@ exports[`Form should not render no settings message when instructed not to 1`] = size="l" /> @@ -193,6 +195,7 @@ exports[`Form should render no settings message when there are no settings 1`] =
@@ -324,6 +327,7 @@ exports[`Form should render no settings message when there are no settings 1`] = size="l" /> @@ -382,6 +386,7 @@ exports[`Form should render normally 1`] = `
@@ -513,6 +518,7 @@ exports[`Form should render normally 1`] = ` size="l" /> @@ -571,6 +577,7 @@ exports[`Form should render read-only when saving is disabled 1`] = `
@@ -702,6 +709,7 @@ exports[`Form should render read-only when saving is disabled 1`] = ` size="l" /> From 7a835a9d59e477ae39c26f177202c5e5f8bb7073 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Thu, 31 Aug 2023 17:26:47 +0000 Subject: [PATCH 5/6] update forum link Signed-off-by: Josh Romero --- src/core/server/ui_settings/settings/theme.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/server/ui_settings/settings/theme.ts b/src/core/server/ui_settings/settings/theme.ts index e329afdb41aa..97a41dbd0e64 100644 --- a/src/core/server/ui_settings/settings/theme.ts +++ b/src/core/server/ui_settings/settings/theme.ts @@ -55,7 +55,10 @@ export const getThemeSettings = (): Record => { options: ['v7', 'Next (preview)'], description: i18n.translate('core.ui_settings.params.themeVersionText', { defaultMessage: `

Switch between the theme used for the current and next version of OpenSearch Dashboards. A page refresh is required for the setting to be applied.

{linkText}

`, - values: { href: 'https://forum.opensearch.org/', linkText: 'Theme feedback' }, + values: { + href: 'https://forum.opensearch.org/t/feedback-on-dark-mode-experience/15725', + linkText: 'Theme feedback', + }, }), requiresPageReload: true, category: ['appearance'], From 9957efa8be129e54fde7645a992c9276cf403e93 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Fri, 1 Sep 2023 08:27:31 -0700 Subject: [PATCH 6/6] Update src/core/server/ui_settings/settings/theme.ts Co-authored-by: Miki Signed-off-by: Josh Romero --- src/core/server/ui_settings/settings/theme.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/server/ui_settings/settings/theme.ts b/src/core/server/ui_settings/settings/theme.ts index 97a41dbd0e64..c1fb6adaca33 100644 --- a/src/core/server/ui_settings/settings/theme.ts +++ b/src/core/server/ui_settings/settings/theme.ts @@ -54,7 +54,7 @@ export const getThemeSettings = (): Record => { type: 'select', options: ['v7', 'Next (preview)'], description: i18n.translate('core.ui_settings.params.themeVersionText', { - defaultMessage: `

Switch between the theme used for the current and next version of OpenSearch Dashboards. A page refresh is required for the setting to be applied.

{linkText}

`, + defaultMessage: `

Switch between the themes used for the current and next versions of OpenSearch Dashboards. A page refresh is required for the setting to be applied.

{linkText}

`, values: { href: 'https://forum.opensearch.org/t/feedback-on-dark-mode-experience/15725', linkText: 'Theme feedback',