diff --git a/CHANGELOG.md b/CHANGELOG.md index 5772724d6eb6..44590087346a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove minimum constraint on opensearch hosts to allow empty host ([#4701](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4701)) - [Discover] Update styles to compatible with OUI `next` theme ([#4644](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4644)) - [Home] Add modal to introduce the `next` theme ([#4715](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4715)) +- [Home] Add new theme sample dashboard screenshots ([#4906](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4906)) - Remove visualization editor sidebar background ([#4719](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4719)) - [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)) diff --git a/src/plugins/home/public/application/components/new_theme_modal.tsx b/src/plugins/home/public/application/components/new_theme_modal.tsx index ca9f9c0ce523..e1520e3b67b1 100644 --- a/src/plugins/home/public/application/components/new_theme_modal.tsx +++ b/src/plugins/home/public/application/components/new_theme_modal.tsx @@ -36,7 +36,6 @@ export const NewThemeModal: FC = ({ addBasePath, onClose }) => { services: { application }, } = useOpenSearchDashboards(); - // TODO: Finalize copy return ( @@ -71,20 +70,18 @@ export const NewThemeModal: FC = ({ addBasePath, onClose }) => { - + - {/* TODO: Replace with actual next theme preview images. Using welcome graphics as placeholders */} - {/* TODO: Replace with actual next theme preview images. Using welcome graphics as placeholders */} { - return getServices().uiSettings.get('theme:darkMode') && sampleDataSet.darkPreviewImagePath - ? sampleDataSet.darkPreviewImagePath - : sampleDataSet.previewImagePath; + let imagePath = sampleDataSet.previewImagePath; + + if (sampleDataSet.darkPreviewImagePath && getServices().uiSettings.get('theme:darkMode')) { + imagePath = sampleDataSet.darkPreviewImagePath; + } + + // For `next` theme, append `_new` + if (sampleDataSet.hasNewThemeImages && getServices().uiSettings.get('theme:version') !== 'v7') { + imagePath = imagePath.replace(/.png/, '_new.png'); + } + + return imagePath; }; render() { diff --git a/src/plugins/home/public/assets/new_theme_dark.png b/src/plugins/home/public/assets/new_theme_dark.png new file mode 100644 index 000000000000..7ecfb8428eca Binary files /dev/null and b/src/plugins/home/public/assets/new_theme_dark.png differ diff --git a/src/plugins/home/public/assets/new_theme_light.png b/src/plugins/home/public/assets/new_theme_light.png new file mode 100644 index 000000000000..ac97006c92a8 Binary files /dev/null and b/src/plugins/home/public/assets/new_theme_light.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_dark_new.png b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_dark_new.png new file mode 100644 index 000000000000..ae396ca71a1f Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_dark_new.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_new.png b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_new.png new file mode 100644 index 000000000000..591843896f82 Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_new.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_dark_new.png b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_dark_new.png new file mode 100644 index 000000000000..359837a1adde Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_dark_new.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_new.png b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_new.png new file mode 100644 index 000000000000..214607738c8a Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_new.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_dark_new.png b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_dark_new.png new file mode 100644 index 000000000000..aea46ab5ae06 Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_dark_new.png differ diff --git a/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_new.png b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_new.png new file mode 100644 index 000000000000..7d1d5ce46319 Binary files /dev/null and b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_new.png differ diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts index f7c80c5e63a8..75e9ea50ff87 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts @@ -53,6 +53,7 @@ export const ecommerceSpecProvider = function (): SampleDatasetSchema { description: ecommerceDescription, previewImagePath: '/plugins/home/assets/sample_data_resources/ecommerce/dashboard.png', darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/ecommerce/dashboard_dark.png', + hasNewThemeImages: true, overviewDashboard: DASHBOARD_ID, getDataSourceIntegratedDashboard: appendDataSourceId(DASHBOARD_ID), appLinks: initialAppLinks, diff --git a/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts b/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts index d93fd4d052ee..415d98027c4f 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts @@ -53,6 +53,7 @@ export const flightsSpecProvider = function (): SampleDatasetSchema { description: flightsDescription, previewImagePath: '/plugins/home/assets/sample_data_resources/flights/dashboard.png', darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/flights/dashboard_dark.png', + hasNewThemeImages: true, overviewDashboard: DASHBOARD_ID, getDataSourceIntegratedDashboard: appendDataSourceId(DASHBOARD_ID), appLinks: initialAppLinks, diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts index 63013b63354e..0e8eaf99d411 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts @@ -53,6 +53,7 @@ export const logsSpecProvider = function (): SampleDatasetSchema { description: logsDescription, previewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard.png', darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard_dark.png', + hasNewThemeImages: true, overviewDashboard: DASHBOARD_ID, getDataSourceIntegratedDashboard: appendDataSourceId(DASHBOARD_ID), appLinks: initialAppLinks, diff --git a/src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts b/src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts index 3489b96bf751..5f6d036d6b39 100644 --- a/src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts +++ b/src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types.ts @@ -85,6 +85,7 @@ export interface SampleDatasetSchema { description: string; previewImagePath: string; darkPreviewImagePath: string; + hasNewThemeImages?: boolean; // saved object id of main dashboard for sample data set overviewDashboard: string; diff --git a/src/plugins/home/server/services/sample_data/lib/sample_dataset_schema.ts b/src/plugins/home/server/services/sample_data/lib/sample_dataset_schema.ts index d5963b7568b3..1e2951c596b9 100644 --- a/src/plugins/home/server/services/sample_data/lib/sample_dataset_schema.ts +++ b/src/plugins/home/server/services/sample_data/lib/sample_dataset_schema.ts @@ -71,6 +71,7 @@ export const sampleDataSchema = { description: Joi.string().required(), previewImagePath: Joi.string().required(), darkPreviewImagePath: Joi.string(), + hasNewThemeImages: Joi.boolean(), // saved object id of main dashboard for sample data set overviewDashboard: Joi.string().required(), diff --git a/src/plugins/home/server/services/sample_data/routes/list.ts b/src/plugins/home/server/services/sample_data/routes/list.ts index 0a42b073bde8..5d4b036a9ead 100644 --- a/src/plugins/home/server/services/sample_data/routes/list.ts +++ b/src/plugins/home/server/services/sample_data/routes/list.ts @@ -55,6 +55,7 @@ export const createListRoute = (router: IRouter, sampleDatasets: SampleDatasetSc description: sampleDataset.description, previewImagePath: sampleDataset.previewImagePath, darkPreviewImagePath: sampleDataset.darkPreviewImagePath, + hasNewThemeImages: sampleDataset.hasNewThemeImages, overviewDashboard: sampleDataset.getDataSourceIntegratedDashboard(dataSourceId), appLinks: sampleDataset.appLinks, defaultIndex: sampleDataset.getDataSourceIntegratedDefaultIndex(dataSourceId),