diff --git a/changelogs/fragments/8435.yml b/changelogs/fragments/8435.yml new file mode 100644 index 000000000000..959d3e9b9cf2 --- /dev/null +++ b/changelogs/fragments/8435.yml @@ -0,0 +1,2 @@ +fix: +- [Workspace]Remove what's new card in workspace overview page ([#8435](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8435)) \ No newline at end of file diff --git a/src/plugins/home/public/application/components/home_list_card.test.tsx b/src/plugins/home/public/application/components/home_list_card.test.tsx index 1492d82dc544..161bd66a8324 100644 --- a/src/plugins/home/public/application/components/home_list_card.test.tsx +++ b/src/plugins/home/public/application/components/home_list_card.test.tsx @@ -75,21 +75,9 @@ describe('Register HomeListCardToPages', () => { it('register to use case overview page', () => { registerHomeListCardToPage(contentManagementStartMock, docLinkMock); - expect(contentManagementStartMock.registerContentProvider).toHaveBeenCalledTimes(4); + expect(contentManagementStartMock.registerContentProvider).toHaveBeenCalledTimes(2); - let whatsNewCall = registerContentProviderFn.mock.calls[0]; - expect(whatsNewCall[0].getTargetArea()).toEqual('essentials_overview/service_cards'); - expect(whatsNewCall[0].getContent()).toMatchInlineSnapshot(` - Object { - "id": "whats_new", - "kind": "custom", - "order": 10, - "render": [Function], - "width": 24, - } - `); - - let learnOpenSearchCall = registerContentProviderFn.mock.calls[1]; + let learnOpenSearchCall = registerContentProviderFn.mock.calls[0]; expect(learnOpenSearchCall[0].getTargetArea()).toEqual('essentials_overview/service_cards'); expect(learnOpenSearchCall[0].getContent()).toMatchInlineSnapshot(` Object { @@ -97,23 +85,11 @@ describe('Register HomeListCardToPages', () => { "kind": "custom", "order": 20, "render": [Function], - "width": 24, - } - `); - - whatsNewCall = registerContentProviderFn.mock.calls[2]; - expect(whatsNewCall[0].getTargetArea()).toEqual('all_overview/service_cards'); - expect(whatsNewCall[0].getContent()).toMatchInlineSnapshot(` - Object { - "id": "whats_new", - "kind": "custom", - "order": 30, - "render": [Function], - "width": undefined, + "width": 48, } `); - learnOpenSearchCall = registerContentProviderFn.mock.calls[3]; + learnOpenSearchCall = registerContentProviderFn.mock.calls[1]; expect(learnOpenSearchCall[0].getTargetArea()).toEqual('all_overview/service_cards'); expect(learnOpenSearchCall[0].getContent()).toMatchInlineSnapshot(` Object { @@ -121,7 +97,7 @@ describe('Register HomeListCardToPages', () => { "kind": "custom", "order": 40, "render": [Function], - "width": undefined, + "width": 16, } `); }); diff --git a/src/plugins/home/public/application/components/home_list_card.tsx b/src/plugins/home/public/application/components/home_list_card.tsx index 745291dae6e7..7c7fbb3c725b 100644 --- a/src/plugins/home/public/application/components/home_list_card.tsx +++ b/src/plugins/home/public/application/components/home_list_card.tsx @@ -165,27 +165,12 @@ export const registerHomeListCardToPage = ( contentManagement: ContentManagementPluginStart, docLinks: DocLinksStart ) => { - registerHomeListCard(contentManagement, { - id: 'whats_new', - order: 10, - config: getWhatsNewConfig(docLinks), - target: ESSENTIAL_OVERVIEW_CONTENT_AREAS.SERVICE_CARDS, - width: 24, - }); - registerHomeListCard(contentManagement, { id: 'learn_opensearch_new', order: 20, config: getLearnOpenSearchConfig(docLinks), target: ESSENTIAL_OVERVIEW_CONTENT_AREAS.SERVICE_CARDS, - width: 24, - }); - - registerHomeListCard(contentManagement, { - id: 'whats_new', - order: 30, - config: getWhatsNewConfig(docLinks), - target: ANALYTICS_ALL_OVERVIEW_CONTENT_AREAS.SERVICE_CARDS, + width: 48, }); registerHomeListCard(contentManagement, { @@ -193,5 +178,6 @@ export const registerHomeListCardToPage = ( order: 40, config: getLearnOpenSearchConfig(docLinks), target: ANALYTICS_ALL_OVERVIEW_CONTENT_AREAS.SERVICE_CARDS, + width: 16, }); }; diff --git a/src/plugins/home/public/application/home_render.test.tsx b/src/plugins/home/public/application/home_render.test.tsx index 63cd57b3915d..8f3037d99097 100644 --- a/src/plugins/home/public/application/home_render.test.tsx +++ b/src/plugins/home/public/application/home_render.test.tsx @@ -130,22 +130,14 @@ describe('initHome', () => { }; initHome(contentManagementStartMock, core); - expect(registerHomeListCard).toHaveBeenCalledTimes(2); - - expect(registerHomeListCard).toHaveBeenCalledWith(contentManagementStartMock, { - id: 'whats_new', - order: 10, - config: getWhatsNewConfig(core.docLinks), - target: HOME_CONTENT_AREAS.SERVICE_CARDS, - width: 16, - }); + expect(registerHomeListCard).toHaveBeenCalledTimes(1); expect(registerHomeListCard).toHaveBeenCalledWith(contentManagementStartMock, { id: 'learn_opensearch_new', order: 11, config: getLearnOpenSearchConfig(core.docLinks), target: HOME_CONTENT_AREAS.SERVICE_CARDS, - width: 16, + width: 48, }); }); }); diff --git a/src/plugins/home/public/application/home_render.tsx b/src/plugins/home/public/application/home_render.tsx index d4d247ec1652..5f714a719481 100644 --- a/src/plugins/home/public/application/home_render.tsx +++ b/src/plugins/home/public/application/home_render.tsx @@ -16,11 +16,7 @@ import { OBSERVABILITY_OVERVIEW_PAGE_ID, SECURITY_ANALYTICS_OVERVIEW_PAGE_ID, } from '../../../../plugins/content_management/public'; -import { - getWhatsNewConfig, - getLearnOpenSearchConfig, - registerHomeListCard, -} from './components/home_list_card'; +import { getLearnOpenSearchConfig, registerHomeListCard } from './components/home_list_card'; import { registerUseCaseCard } from './components/use_case_card'; @@ -90,19 +86,11 @@ export const initHome = (contentManagement: ContentManagementPluginStart, core: }); } - registerHomeListCard(contentManagement, { - id: 'whats_new', - order: 10, - config: getWhatsNewConfig(core.docLinks), - target: HOME_CONTENT_AREAS.SERVICE_CARDS, - width: 16, - }); - registerHomeListCard(contentManagement, { id: 'learn_opensearch_new', order: 11, config: getLearnOpenSearchConfig(core.docLinks), target: HOME_CONTENT_AREAS.SERVICE_CARDS, - width: 16, + width: workspaceEnabled ? 32 : 48, }); };