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

[Workspace] Remove whats new in workspace overview page #8435

Merged
merged 3 commits into from
Oct 2, 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/8435.yml
Original file line number Diff line number Diff line change
@@ -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))
Original file line number Diff line number Diff line change
Expand Up @@ -75,53 +75,29 @@ 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 {
"id": "learn_opensearch_new",
"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 {
"id": "learn_opensearch_new",
"kind": "custom",
"order": 40,
"render": [Function],
"width": undefined,
"width": 16,
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,33 +165,19 @@ 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, {
id: 'learn_opensearch_new',
order: 40,
config: getLearnOpenSearchConfig(docLinks),
target: ANALYTICS_ALL_OVERVIEW_CONTENT_AREAS.SERVICE_CARDS,
width: 16,
});
};
12 changes: 2 additions & 10 deletions src/plugins/home/public/application/home_render.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});
16 changes: 2 additions & 14 deletions src/plugins/home/public/application/home_render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
});
};
Loading