Skip to content

Commit

Permalink
[uiSettings/theme/version] override label to aid KBN_OPTIMIZER_THEMES…
Browse files Browse the repository at this point in the history
… discovery (#96069)

Co-authored-by: spalger <[email protected]>
Co-authored-by: cchaos <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
4 people authored Apr 8, 2021
1 parent 0fdb533 commit 3336db0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/core/server/ui_settings/settings/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const getThemeSettings = (
): Record<string, UiSettingsParams> => {
const { availableVersions, defaultDarkMode, defaultVersion } = getThemeInfo(options);

const onlyOneThemeAvailable = !options?.isDist && availableVersions.length === 1;

return {
'theme:darkMode': {
name: i18n.translate('core.ui_settings.params.darkModeTitle', {
Expand All @@ -68,10 +70,21 @@ export const getThemeSettings = (
type: 'select',
options: availableVersions,
description: i18n.translate('core.ui_settings.params.themeVersionText', {
defaultMessage: `Switch between the theme used for the current and next version of Kibana. A page refresh is required for the setting to be applied.`,
defaultMessage:
'Switch between the theme used for the current and next version of Kibana. A page refresh is required for the setting to be applied. {lessOptions}',
values: {
lessOptions: onlyOneThemeAvailable
? '<br><br> There is only one theme available, set <code>KBN_OPTIMIZER_THEMES=v7light,v7dark,v8light,v8dark</code> to get more options.'
: undefined,
},
}),
requiresPageReload: true,
schema: schema.oneOf(availableVersions.map((v) => schema.literal(v)) as [Type<string>]),
optionLabels: onlyOneThemeAvailable
? {
[availableVersions[0]]: `${availableVersions[0]} (only)`,
}
: undefined,
},
};
};
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@
"core.ui_settings.params.notifications.warningLifetimeTitle": "警告通知時間",
"core.ui_settings.params.storeUrlText": "URLが長くなりすぎるためブラウザーが対応できない場合があります。セッションストレージにURLの一部を保存することでこの問題に対処できるかどうかをテストしています。結果を教えてください!",
"core.ui_settings.params.storeUrlTitle": "セッションストレージにURLを格納",
"core.ui_settings.params.themeVersionText": "現在のバージョンと次のバージョンのKibanaで使用されるテーマを切り替えます。この設定を適用するにはページの更新が必要です。",
"core.ui_settings.params.themeVersionTitle": "テーマバージョン",
"core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "Elastic ホーム",
"core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle": "Elastic に確認する",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@
"core.ui_settings.params.notifications.warningLifetimeTitle": "警告通知生存时间",
"core.ui_settings.params.storeUrlText": "有时,URL 可能会变得过长,使某些浏览器无法进行处理。为此,我们将正测试在会话存储中存储 URL 的组成部分是否会有所帮助。请向我们反馈您的体验!",
"core.ui_settings.params.storeUrlTitle": "将 URL 存储在会话存储中",
"core.ui_settings.params.themeVersionText": "在用于当前版和下一版 Kibana 的主题之间切换。需要刷新页面,才能应用设置。",
"core.ui_settings.params.themeVersionTitle": "主题版本",
"core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "Elastic 主页",
"core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle": "问询 Elastic",
Expand Down

0 comments on commit 3336db0

Please sign in to comment.