Skip to content

Commit

Permalink
Feat (Advanced Settings): Make new "Appearance" category (opensearch-…
Browse files Browse the repository at this point in the history
…project#4845)

* 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 <[email protected]>

* updated changelog

Signed-off-by: Josh Romero <[email protected]>

* Update theme description

add link to forum

Signed-off-by: Josh Romero <[email protected]>

* Update snapshots

Signed-off-by: Josh Romero <[email protected]>

* update forum link

Signed-off-by: Josh Romero <[email protected]>

* Update src/core/server/ui_settings/settings/theme.ts

Co-authored-by: Miki <[email protected]>
Signed-off-by: Josh Romero <[email protected]>

---------

Signed-off-by: Josh Romero <[email protected]>
Co-authored-by: Miki <[email protected]>
Co-authored-by: Miki <[email protected]>
  • Loading branch information
3 people authored Sep 1, 2023
1 parent c886b00 commit 3e1ef80
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Vis Colors] Remove customized colors from sample visualizations and dashboards ([#4741](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4741))
- [Vis Colors] Update color mapper to prioritize unique colors per visualization rather than across entire dashboard ([#4890](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4890))
- [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))
- Adds Data explorer framework and implements Discover using it ([#4806](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4806))
- [Theme] Make `next` theme the default ([#4854](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4854/))

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/ui_settings/settings/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const getAccessibilitySettings = (): Record<string, UiSettingsParams> =>
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(),
},
Expand Down
1 change: 1 addition & 0 deletions src/core/server/ui_settings/settings/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const getNavigationSettings = (): Record<string, UiSettingsParams> => {
defaultMessage: 'Legacy',
}),
},
category: ['appearance'],
schema: schema.oneOf([schema.literal('modern'), schema.literal('legacy')]),
},
};
Expand Down
8 changes: 7 additions & 1 deletion src/core/server/ui_settings/settings/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const getThemeSettings = (): Record<string, UiSettingsParams> => {
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': {
Expand All @@ -53,9 +54,14 @@ export const getThemeSettings = (): Record<string, UiSettingsParams> => {
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: `<p>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.</p><p><a href="{href}">{linkText}</a></p>`,
values: {
href: 'https://forum.opensearch.org/t/feedback-on-dark-mode-experience/15725',
linkText: 'Theme feedback',
},
}),
requiresPageReload: true,
category: ['appearance'],
schema: schema.oneOf([schema.literal('v7'), schema.literal('Next (preview)')]),
},
};
Expand Down

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 @@ -257,7 +257,7 @@ export class Form extends PureComponent<FormProps> {
renderCategory(category: Category, settings: FieldSetting[], totalSettings: number) {
return (
<Fragment key={category}>
<EuiPanel paddingSize="l">
<EuiPanel paddingSize="l" id={category}>
<EuiForm>
<EuiText>
<EuiFlexGroup alignItems="baseline">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const names: Record<string, string> = {
general: i18n.translate('advancedSettings.categoryNames.generalLabel', {
defaultMessage: 'General',
}),
appearance: i18n.translate('advancedSettings.categoryNames.appearanceLabel', {
defaultMessage: 'Appearance',
}),
timeline: i18n.translate('advancedSettings.categoryNames.timelineLabel', {
defaultMessage: 'Timeline',
}),
Expand Down

0 comments on commit 3e1ef80

Please sign in to comment.