Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[theme] default to v8 theme #94370

Merged
merged 5 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/src/common/theme_tags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { parseThemeTags } from './theme_tags';
it('returns default tags when passed undefined', () => {
expect(parseThemeTags()).toMatchInlineSnapshot(`
Array [
"v7dark",
"v7light",
"v8dark",
"v8light",
]
`);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/common/theme_tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const isArrayOfStrings = (input: unknown): input is string[] =>

export type ThemeTags = readonly ThemeTag[];
export type ThemeTag = 'v7light' | 'v7dark' | 'v8light' | 'v8dark';
export const DEFAULT_THEMES = tags('v7light', 'v7dark');
export const DEFAULT_THEMES = tags('v8light', 'v8dark');
export const ALL_THEMES = tags('v7light', 'v7dark', 'v8light', 'v8dark');

export function parseThemeTags(input?: any): ThemeTags {
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 @@ -159,8 +159,8 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/_other_styles.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/styles.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7dark.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss,
<absolute path>/packages/kbn-optimizer/target/worker/entry_point_creator.js,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/src/optimizer/cache_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ describe('getOptimizerCacheKey()', () => {
"optimizerCacheKey": "♻",
"repoRoot": <absolute path>,
"themeTags": Array [
"v7dark",
"v7light",
"v8dark",
"v8light",
],
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('bootstrapRenderer', () => {

expect(getThemeTagMock).toHaveBeenCalledTimes(1);
expect(getThemeTagMock).toHaveBeenCalledWith({
themeVersion: 'v7',
themeVersion: 'v8',
darkMode: false,
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/rendering/bootstrap/bootstrap_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export const bootstrapRendererFactory: BootstrapRendererFactory = ({

return async function bootstrapRenderer({ uiSettingsClient, request }) {
let darkMode = false;
let themeVersion = 'v7';
let themeVersion = 'v8';

try {
const authenticated = isAuthenticated(request);
darkMode = authenticated ? await uiSettingsClient.get('theme:darkMode') : false;
themeVersion = authenticated ? await uiSettingsClient.get('theme:version') : 'v7';
themeVersion = authenticated ? await uiSettingsClient.get('theme:version') : 'v8';
} catch (e) {
// just use the default values in case of connectivity issues with ES
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/ui_settings/settings/theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ describe('theme settings', () => {

it('should only accept valid values', () => {
expect(() => validate('v7')).not.toThrow();
expect(() => validate('v8 (beta)')).not.toThrow();
expect(() => validate('v8')).not.toThrow();
expect(() => validate('v12')).toThrowErrorMatchingInlineSnapshot(`
"types that failed validation:
- [0]: expected value to equal [v7]
- [1]: expected value to equal [v8 (beta)]"
- [1]: expected value to equal [v8]"
`);
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/core/server/ui_settings/settings/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ export const getThemeSettings = (): Record<string, UiSettingsParams> => {
name: i18n.translate('core.ui_settings.params.themeVersionTitle', {
defaultMessage: 'Theme version',
}),
value: 'v7',
value: 'v8',
type: 'select',
options: ['v7', 'v8 (beta)'],
options: ['v7', 'v8'],
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.`,
}),
requiresPageReload: true,
schema: schema.oneOf([schema.literal('v7'), schema.literal('v8 (beta)')]),
schema: schema.oneOf([schema.literal('v7'), schema.literal('v8')]),
},
};
};
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/dashboard_saved_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await savedQueryManagementComponent.openSavedQueryManagementComponent();
const descriptionText = await testSubjects.getVisibleText('saved-query-management-popover');
expect(descriptionText).to.eql(
'SAVED QUERIES\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
'Saved Queries\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
);
});

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/discover/_saved_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await savedQueryManagementComponent.openSavedQueryManagementComponent();
const descriptionText = await testSubjects.getVisibleText('saved-query-management-popover');
expect(descriptionText).to.eql(
'SAVED QUERIES\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
'Saved Queries\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
);
});

Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/visual_builder_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
await comboBox.setElement(groupBy, 'Terms', { clickWithMouse: true });
await PageObjects.common.sleep(1000);
const byField = await testSubjects.find('groupByField');
await comboBox.setElement(byField, field, { clickWithMouse: true });
await comboBox.setElement(byField, field);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chatted with @stratoula about this fix

}

public async checkSelectedMetricsGroupByValue(value: string) {
Expand Down
Binary file modified test/functional/screenshots/baseline/area_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/functional/screenshots/baseline/tsvb_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default function ({ getService }: FtrProviderContext) {
{ key: '#F5F7FA', value: 2 },
{ key: '#D3DAE6', value: 1 },
// scatterplot circles
{ key: '#54B399', value: 1 },
{ key: '#54B39A', value: 1 },
{ key: '#69707D', value: 1 },
{ key: '#98A1B3', value: 1 },
],
scatterplotMatrixColorStatsResults: [
// background
Expand Down
Binary file modified x-pack/test/plugin_functional/screenshots/baseline/first_child.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified x-pack/test/plugin_functional/screenshots/baseline/origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified x-pack/test/plugin_functional/screenshots/baseline/second_child.png