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

feat: Add V9 Theme #7757

Merged
merged 5 commits into from
Aug 20, 2024
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
2 changes: 2 additions & 0 deletions changelogs/fragments/7757.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add v9 theme (preview) ([#7757](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7757))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$globalStyleConstant: 14;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$globalStyleConstant: 15;
8 changes: 6 additions & 2 deletions packages/osd-optimizer/src/common/theme_tags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ it('returns default tags when passed undefined', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
]
`);
});
Expand All @@ -48,6 +50,8 @@ it('returns all tags when passed *', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
]
`);
});
Expand Down Expand Up @@ -81,13 +85,13 @@ it('returns specific tags when passed an array', () => {

it('throws when an invalid tag is in the array', () => {
expect(() => parseThemeTags(['v8light', 'v7light', 'bar'])).toThrowErrorMatchingInlineSnapshot(
`"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light]"`
`"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});

it('throws when an invalid tags in comma separated list', () => {
expect(() => parseThemeTags('v8light ,v7light,bar,box ')).toThrowErrorMatchingInlineSnapshot(
`"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light]"`
`"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
bar.cache.refresh();
expect(bar.cache.getModuleCount()).toBe(
// code + styles + style/css-loader runtimes + public path updater
25
33
);

expect(bar.cache.getReferencedFiles()?.map(absolutePathSerializer.serialize).sort())
Expand All @@ -195,6 +195,8 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss",
"<absolute path>/packages/osd-optimizer/target/worker/entry_point_creator.js",
"<absolute path>/packages/osd-ui-shared-deps/public_path_module_creator.js",
]
Expand Down
2 changes: 2 additions & 0 deletions packages/osd-optimizer/src/optimizer/cache_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ describe('getOptimizerCacheKey()', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
],
},
}
Expand Down
2 changes: 2 additions & 0 deletions packages/osd-ui-framework/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ module.exports = function (grunt) {
uiFrameworkCompile('src/kui_dark.scss', 'dist/kui_dark.css'),
uiFrameworkCompile('src/kui_next_light.scss', 'dist/kui_next_light.css'),
uiFrameworkCompile('src/kui_next_dark.scss', 'dist/kui_next_dark.css'),
uiFrameworkCompile('src/kui_v9_light.scss', 'dist/kui_v9_light.css'),
uiFrameworkCompile('src/kui_v9_dark.scss', 'dist/kui_v9_dark.css'),
]).then(done);
});
};
Loading
Loading