From 34f3eb257b2d25f9278ee549c97b8b3c1bde3e07 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 15 Jul 2024 10:47:58 +0800 Subject: [PATCH] [Navigation-next] Add all use case (#7235) * feat: add all use case Signed-off-by: SuZhou-Joe * Changeset file for PR #7235 created/updated --------- Signed-off-by: SuZhou-Joe Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/7235.yml | 2 ++ .../chrome/nav_group/nav_group_service.ts | 5 +++++ src/core/public/index.ts | 1 + src/core/utils/default_nav_groups.ts | 21 +++++++++++++++---- src/core/utils/index.ts | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/7235.yml diff --git a/changelogs/fragments/7235.yml b/changelogs/fragments/7235.yml new file mode 100644 index 000000000000..e1ef6b249df0 --- /dev/null +++ b/changelogs/fragments/7235.yml @@ -0,0 +1,2 @@ +feat: +- Add all use case ([#7235](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7235)) \ No newline at end of file diff --git a/src/core/public/chrome/nav_group/nav_group_service.ts b/src/core/public/chrome/nav_group/nav_group_service.ts index 72d8ef2deb07..bde7d0d9111a 100644 --- a/src/core/public/chrome/nav_group/nav_group_service.ts +++ b/src/core/public/chrome/nav_group/nav_group_service.ts @@ -29,6 +29,11 @@ export interface ChromeRegistrationNavLink { * link with parentNavLinkId field will be displayed as nested items in navigation. */ parentNavLinkId?: string; + + /** + * If the nav link should be shown in 'all' nav group + */ + showInAllNavGroup?: boolean; } export type NavGroupItemInMap = ChromeNavGroup & { diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 4566b1dd867b..92a3525e03de 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -104,6 +104,7 @@ export { WORKSPACE_TYPE, cleanWorkspaceId, DEFAULT_NAV_GROUPS, + ALL_USE_CASE_ID, } from '../utils'; export { AppCategory, diff --git a/src/core/utils/default_nav_groups.ts b/src/core/utils/default_nav_groups.ts index eda0a6c4f1a3..da2e3c46f9fb 100644 --- a/src/core/utils/default_nav_groups.ts +++ b/src/core/utils/default_nav_groups.ts @@ -6,6 +6,8 @@ import { i18n } from '@osd/i18n'; import { ChromeNavGroup, NavGroupType } from '../types'; +export const ALL_USE_CASE_ID = 'all'; + const defaultNavGroups = { dataAdministration: { id: 'dataAdministration', @@ -29,6 +31,17 @@ const defaultNavGroups = { order: 2000, type: NavGroupType.SYSTEM, }, + all: { + id: ALL_USE_CASE_ID, + title: i18n.translate('core.ui.group.all.title', { + defaultMessage: 'All use case', + }), + description: i18n.translate('core.ui.group.all.description', { + defaultMessage: 'This is a usse case contains all the features.', + }), + order: 3000, + type: NavGroupType.SYSTEM, + }, observability: { id: 'observability', title: i18n.translate('core.ui.group.observability.title', { @@ -38,7 +51,7 @@ const defaultNavGroups = { defaultMessage: 'Gain visibility into system health, performance, and reliability through monitoring and analysis of logs, metrics, and traces.', }), - order: 3000, + order: 4000, }, 'security-analytics': { id: 'security-analytics', @@ -49,7 +62,7 @@ const defaultNavGroups = { defaultMessage: 'Detect and investigate potential security threats and vulnerabilities across your systems and data.', }), - order: 4000, + order: 5000, }, analytics: { id: 'analytics', @@ -60,7 +73,7 @@ const defaultNavGroups = { defaultMessage: 'Analyze data to derive insights, identify patterns and trends, and make data-driven decisions.', }), - order: 5000, + order: 6000, }, search: { id: 'search', @@ -71,7 +84,7 @@ const defaultNavGroups = { defaultMessage: "Quickly find and explore relevant information across your organization's data sources.", }), - order: 6000, + order: 7000, }, } as const; diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts index d9294e30361f..46304c4bde3d 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -39,4 +39,4 @@ export { export { DEFAULT_APP_CATEGORIES } from './default_app_categories'; export { WORKSPACE_PATH_PREFIX, WORKSPACE_TYPE } from './constants'; export { getWorkspaceIdFromUrl, formatUrlWithWorkspaceId, cleanWorkspaceId } from './workspace'; -export { DEFAULT_NAV_GROUPS } from './default_nav_groups'; +export { DEFAULT_NAV_GROUPS, ALL_USE_CASE_ID } from './default_nav_groups';