diff --git a/changelogs/fragments/7873.yml b/changelogs/fragments/7873.yml new file mode 100644 index 000000000000..ebf0b9e814ed --- /dev/null +++ b/changelogs/fragments/7873.yml @@ -0,0 +1,2 @@ +feat: +- Align essentials use case id ([#7873](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7873)) \ No newline at end of file diff --git a/src/core/utils/default_nav_groups.ts b/src/core/utils/default_nav_groups.ts index 7b3820ccfbd3..7278734ae826 100644 --- a/src/core/utils/default_nav_groups.ts +++ b/src/core/utils/default_nav_groups.ts @@ -9,7 +9,7 @@ import { ChromeNavGroup, NavGroupType } from '../types'; export const ALL_USE_CASE_ID = 'all'; export const OBSERVABILITY_USE_CASE_ID = 'observability'; export const SECURITY_ANALYTICS_USE_CASE_ID = 'security-analytics'; -export const ESSENTIAL_USE_CASE_ID = 'analytics'; +export const ESSENTIAL_USE_CASE_ID = 'essentials'; export const SEARCH_USE_CASE_ID = 'search'; const defaultNavGroups = { 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 f5916e4b74e7..cbad31f15993 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 @@ -74,7 +74,7 @@ describe('Register HomeListCardToPages', () => { expect(contentManagementStartMock.registerContentProvider).toHaveBeenCalledTimes(4); let whatsNewCall = registerContentProviderFn.mock.calls[0]; - expect(whatsNewCall[0].getTargetArea()).toEqual('analytics_overview/service_cards'); + expect(whatsNewCall[0].getTargetArea()).toEqual('essentials_overview/service_cards'); expect(whatsNewCall[0].getContent()).toMatchInlineSnapshot(` Object { "id": "whats_new", @@ -86,7 +86,7 @@ describe('Register HomeListCardToPages', () => { `); let learnOpenSearchCall = registerContentProviderFn.mock.calls[1]; - expect(learnOpenSearchCall[0].getTargetArea()).toEqual('analytics_overview/service_cards'); + expect(learnOpenSearchCall[0].getTargetArea()).toEqual('essentials_overview/service_cards'); expect(learnOpenSearchCall[0].getContent()).toMatchInlineSnapshot(` Object { "id": "learn_opensearch_new", diff --git a/src/plugins/home/public/application/components/sample_data/sample_data_card.test.tsx b/src/plugins/home/public/application/components/sample_data/sample_data_card.test.tsx index 44d7a4b6f007..df93e5cd2a4b 100644 --- a/src/plugins/home/public/application/components/sample_data/sample_data_card.test.tsx +++ b/src/plugins/home/public/application/components/sample_data/sample_data_card.test.tsx @@ -19,7 +19,7 @@ describe('Sample data card', () => { it('should call the getTargetArea function with the correct arguments', () => { registerSampleDataCard(contentManagement, coreStart); const call = registerContentProviderMock.mock.calls[0]; - expect(call[0].getTargetArea()).toEqual(['analytics_overview/get_started']); + expect(call[0].getTargetArea()).toEqual(['essentials_overview/get_started']); expect(call[0].getContent()).toMatchInlineSnapshot(` Object { "cardProps": Object { diff --git a/src/plugins/workspace/README.md b/src/plugins/workspace/README.md index f79267de7e63..9bc8fc324fac 100644 --- a/src/plugins/workspace/README.md +++ b/src/plugins/workspace/README.md @@ -38,7 +38,7 @@ The above object defines a workspace with name `Observability team` that's creat 1. `use-case-observability` 2. `use-case-security-analytics` 3. `use-case-search` -4. `use-case-analytics` +4. `use-case-essentials` 5. `use-case-all` ## Associate saved objects with workspaces diff --git a/src/plugins/workspace/common/constants.ts b/src/plugins/workspace/common/constants.ts index 735c253fd0c0..d6009bed1482 100644 --- a/src/plugins/workspace/common/constants.ts +++ b/src/plugins/workspace/common/constants.ts @@ -97,7 +97,7 @@ export const WORKSPACE_USE_CASES = Object.freeze({ ] as string[], }, essentials: { - id: 'analytics', + id: 'essentials', title: i18n.translate('workspace.usecase.essentials.title', { defaultMessage: 'Essentials', }), diff --git a/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.test.tsx b/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.test.tsx index 914fa4751ff8..5fbadff102ca 100644 --- a/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.test.tsx +++ b/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.test.tsx @@ -47,7 +47,7 @@ describe('UseCaseFooter', () => { it('renders create workspace button for admin when no workspaces within use case exist', () => { const { getByTestId } = render( { it('renders create workspace button for non-admin when no workspaces within use case exist', () => { const { getByTestId } = render( { const call = registerPageMock.mock.calls[0]; expect(call[0]).toMatchInlineSnapshot(` Object { - "id": "analytics_overview", + "id": "essentials_overview", "sections": Array [ Object { "id": "service_cards", @@ -71,7 +71,7 @@ describe('Setup use case overview', () => { expect(calls.length).toBe(3); const firstCall = calls[0]; - expect(firstCall[0].getTargetArea()).toMatchInlineSnapshot(`"analytics_overview/get_started"`); + expect(firstCall[0].getTargetArea()).toMatchInlineSnapshot(`"essentials_overview/get_started"`); expect(firstCall[0].getContent()).toMatchInlineSnapshot(` Object { "cardProps": Object { @@ -99,7 +99,7 @@ describe('Setup use case overview', () => { const call = registerPageMock.mock.calls[0]; expect(call[0]).toMatchInlineSnapshot(` Object { - "id": "analytics_overview", + "id": "essentials_overview", "sections": Array [ Object { "id": "service_cards", diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_detail_form_details.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_detail_form_details.tsx index 3de52f3aabff..b72181ae1114 100644 --- a/src/plugins/workspace/public/components/workspace_form/workspace_detail_form_details.tsx +++ b/src/plugins/workspace/public/components/workspace_form/workspace_detail_form_details.tsx @@ -64,7 +64,11 @@ export const WorkspaceDetailFormDetails = ({ // Essential can be changed to other use cases; // Analytics (all) cannot be changed back to a single use case; // Other use cases can only be changed to Analytics (all) use case. - return currentUseCase === 'analytics' || id === 'all' || id === currentUseCase; + return ( + currentUseCase === DEFAULT_NAV_GROUPS.essentials.id || + id === DEFAULT_NAV_GROUPS.all.id || + id === currentUseCase + ); }) .map((useCase) => ({ value: useCase.id, diff --git a/src/plugins/workspace/public/plugin.test.ts b/src/plugins/workspace/public/plugin.test.ts index c6bc16e1c939..cf0f67f89829 100644 --- a/src/plugins/workspace/public/plugin.test.ts +++ b/src/plugins/workspace/public/plugin.test.ts @@ -284,7 +284,7 @@ describe('Workspace plugin', () => { expect(setupMock.application.register).toHaveBeenCalledWith( expect.objectContaining({ - id: 'analytics_overview', + id: 'essentials_overview', }) ); });