Skip to content

Commit 1b10e50

Browse files
Remove theme update modal (#9776)
* remove theme modal Signed-off-by: abbyhu2000 <[email protected]> * Changeset file for PR #9776 created/updated --------- Signed-off-by: abbyhu2000 <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent 5e18b54 commit 1b10e50

File tree

9 files changed

+4
-241
lines changed

9 files changed

+4
-241
lines changed

changelogs/fragments/9776.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feat:
2+
- Remove theme update modal ([#9776](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9776))

config/opensearch_dashboards.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
# Set the value to true to disable the welcome screen
4747
#home.disableWelcomeScreen: false
4848

49-
# Set the value to true to disable the new theme introduction modal
50-
#home.disableNewThemeModal: false
51-
5249
# Setting for an optimized healthcheck that only uses the local OpenSearch node to do Dashboards healthcheck.
5350
# This settings should be used for large clusters or for clusters with ingest heavy nodes.
5451
# It allows Dashboards to only healthcheck using the local OpenSearch node rather than fan out requests across all nodes.

src/plugins/home/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { schema, TypeOf } from '@osd/config-schema';
3232

3333
export const configSchema = schema.object({
3434
disableWelcomeScreen: schema.boolean({ defaultValue: false }),
35-
disableNewThemeModal: schema.boolean({ defaultValue: false }),
3635
});
3736

3837
export type ConfigSchema = TypeOf<typeof configSchema>;

src/plugins/home/public/application/components/legacy/__snapshots__/home.test.js.snap

Lines changed: 0 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/home/public/application/components/legacy/home.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ import { FeatureCatalogueCategory } from '../../../services';
4242
import { getServices } from '../../opensearch_dashboards_services';
4343
import { AddData } from './add_data';
4444
import { ManageData } from './manage_data';
45-
import { NewThemeModal } from '../new_theme_modal';
4645
import { SolutionsSection } from './solutions_section';
4746
import { Welcome } from '../welcome';
4847

4948
const KEY_ENABLE_WELCOME = 'home:welcome:show';
50-
const KEY_ENABLE_NEW_THEME_MODAL = 'home:newThemeModal:show';
5149

5250
export class Home extends Component {
5351
constructor(props) {
@@ -58,12 +56,6 @@ export class Home extends Component {
5856
props.localStorage.getItem(KEY_ENABLE_WELCOME) === 'false'
5957
);
6058

61-
const isNewThemeModalEnabled = !(
62-
getServices().uiSettings.get('theme:version') === 'v7' ||
63-
getServices().homeConfig.disableNewThemeModal ||
64-
props.localStorage.getItem(KEY_ENABLE_NEW_THEME_MODAL) === 'false'
65-
);
66-
6759
const body = document.querySelector('body');
6860
body.classList.add('isHomPage');
6961

@@ -75,7 +67,6 @@ export class Home extends Component {
7567
isLoading: isWelcomeEnabled,
7668
isNewOpenSearchDashboardsInstance: false,
7769
isWelcomeEnabled,
78-
isNewThemeModalEnabled,
7970
};
8071
}
8172

@@ -131,15 +122,6 @@ export class Home extends Component {
131122
this._isMounted && this.setState({ isWelcomeEnabled: false });
132123
};
133124

134-
dismissNewThemeModal = () => {
135-
this.props.localStorage.setItem(KEY_ENABLE_NEW_THEME_MODAL, 'false');
136-
this._isMounted && this.setState({ isNewThemeModalEnabled: false });
137-
};
138-
139-
onCloseNewThemeModal = () => {
140-
this.dismissNewThemeModal();
141-
};
142-
143125
findDirectoryById = (id) => this.props.directories.find((directory) => directory.id === id);
144126

145127
getFeaturesByCategory = (category) =>
@@ -149,7 +131,6 @@ export class Home extends Component {
149131

150132
renderNormal() {
151133
const { addBasePath, solutions, directories } = this.props;
152-
const { isNewThemeModalEnabled } = this.state;
153134

154135
const devTools = this.findDirectoryById('console');
155136
const addDataFeatures = this.getFeaturesByCategory(FeatureCatalogueCategory.DATA);
@@ -204,10 +185,6 @@ export class Home extends Component {
204185

205186
<EuiHorizontalRule margin="xl" aria-hidden="true" />
206187

207-
{isNewThemeModalEnabled && (
208-
<NewThemeModal addBasePath={addBasePath} onClose={this.onCloseNewThemeModal} />
209-
)}
210-
211188
<OverviewPageFooter addBasePath={addBasePath} path={HOME_APP_BASE_PATH} />
212189
</div>
213190
</main>

src/plugins/home/public/application/components/legacy/home.test.js

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import React from 'react';
3232
import sinon from 'sinon';
3333
import { shallow } from 'enzyme';
3434
import { Home } from './home';
35-
import { NewThemeModal } from '../new_theme_modal';
3635

3736
import { FeatureCatalogueCategory } from '../../../services';
3837

@@ -88,7 +87,7 @@ describe('home', () => {
8887
},
8988
localStorage: {
9089
getItem: sinon.spy((path) => {
91-
expect(path).toMatch(/home:(welcome|newThemeModal):show/);
90+
expect(path).toMatch(/home:(welcome):show/);
9291
return 'false';
9392
}),
9493
setItem: sinon.mock(),
@@ -105,7 +104,7 @@ describe('home', () => {
105104
if (homeConfig) {
106105
mockHomeConfig.mockReturnValue(homeConfig);
107106
} else {
108-
mockHomeConfig.mockReturnValue({ disableWelcomeScreen: false, disableNewThemeModal: false });
107+
mockHomeConfig.mockReturnValue({ disableWelcomeScreen: false });
109108
}
110109
if (uiSettings) {
111110
mockUiSettings.mockReturnValue(uiSettings);
@@ -368,50 +367,4 @@ describe('home', () => {
368367
expect(component).toMatchSnapshot();
369368
});
370369
});
371-
372-
describe('new theme modal', () => {
373-
test('should show the new theme modal if not previously dismissed', async () => {
374-
defaultProps.localStorage.getItem = sinon.spy(() => undefined);
375-
376-
const component = await renderHome();
377-
378-
sinon.assert.calledWith(defaultProps.localStorage.getItem, 'home:newThemeModal:show');
379-
380-
expect(component.find(NewThemeModal).exists()).toBeTruthy();
381-
expect(component).toMatchSnapshot();
382-
});
383-
test('should not show the new theme modal if v7 theme in use', async () => {
384-
defaultProps.localStorage.getItem = sinon.spy(() => undefined);
385-
386-
const component = await renderHome({}, undefined, 'v7');
387-
388-
sinon.assert.neverCalledWith(defaultProps.localStorage.getItem, 'home:newThemeModal:show');
389-
390-
expect(component.find(NewThemeModal).exists()).toBeFalsy();
391-
});
392-
test('should not show the new theme modal if disabled in config', async () => {
393-
defaultProps.localStorage.getItem = sinon.spy(() => undefined);
394-
395-
const component = await renderHome(
396-
{},
397-
{
398-
disableWelcomeScreen: true,
399-
disableNewThemeModal: true,
400-
}
401-
);
402-
403-
sinon.assert.neverCalledWith(defaultProps.localStorage.getItem, 'home:newThemeModal:show');
404-
405-
expect(component.find(NewThemeModal).exists()).toBeFalsy();
406-
});
407-
test('should not show the new theme modal if previously dismissed', async () => {
408-
defaultProps.localStorage.getItem = sinon.spy(() => 'false');
409-
410-
const component = await renderHome();
411-
412-
sinon.assert.calledWith(defaultProps.localStorage.getItem, 'home:newThemeModal:show');
413-
414-
expect(component.find(NewThemeModal).exists()).toBeFalsy();
415-
});
416-
});
417370
});

src/plugins/home/public/application/components/new_theme_modal.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/plugins/home/server/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { configSchema, ConfigSchema } from '../config';
3838
export const config: PluginConfigDescriptor<ConfigSchema> = {
3939
exposeToBrowser: {
4040
disableWelcomeScreen: true,
41-
disableNewThemeModal: true,
4241
},
4342
schema: configSchema,
4443
deprecations: ({ renameFromRoot }) => [

test/common/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default function () {
5858
`--opensearch.username=${opensearchDashboardsServerTestUser.username}`,
5959
`--opensearch.password=${opensearchDashboardsServerTestUser.password}`,
6060
`--home.disableWelcomeScreen=false`,
61-
`--home.disableNewThemeModal=true`,
6261
// Needed for async search functional tests to introduce a delay
6362
`--data.search.aggs.shardDelay.enabled=true`,
6463
//`--security.showInsecureClusterWarning=false`,

0 commit comments

Comments
 (0)