Skip to content

Commit

Permalink
Feat (Advanced Settings): Make new "Appearance" category (#4845)
Browse files Browse the repository at this point in the history
* 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]>
(cherry picked from commit 3e1ef80)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
github-actions[bot] committed Sep 1, 2023
1 parent 993ebc0 commit 05fe5e8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
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 05fe5e8

Please sign in to comment.