From 902d073e6365b34f7fb6bb3a1f0a835bc50a9c73 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 16 Aug 2024 08:37:14 +0800 Subject: [PATCH] [navigation] Left navigation collective (#7655) * feat: change nav groups Signed-off-by: SuZhou-Joe * Changeset file for PR #7655 created/updated * feat: move visualizations to all use case Signed-off-by: SuZhou-Joe * feat: change the scrollable area Signed-off-by: SuZhou-Joe * feat: register manage workspace category when in a workspace Signed-off-by: SuZhou-Joe * feat: register index patterns to settings and setup Signed-off-by: SuZhou-Joe * feat: show correct icon in top Signed-off-by: SuZhou-Joe * feat: use gap to replace margin Signed-off-by: SuZhou-Joe * feat: make new left nav work in mobile mode Signed-off-by: SuZhou-Joe * fix: bootstrap error Signed-off-by: SuZhou-Joe * fix: unit test error Signed-off-by: SuZhou-Joe * feat: justify content Signed-off-by: SuZhou-Joe * fix: unit test Signed-off-by: SuZhou-Joe * fix: unit test Signed-off-by: SuZhou-Joe * feat: add descriptions to core features Signed-off-by: SuZhou-Joe * feat: add description to index pattern Signed-off-by: SuZhou-Joe * feat: use smaller font size in left nav Signed-off-by: SuZhou-Joe * feat: append navLinks inside second level to custom category if no entry for the nav group Signed-off-by: SuZhou-Joe * feat: some optimize Signed-off-by: SuZhou-Joe * feat: optimize code Signed-off-by: SuZhou-Joe * feat: fix unit test Signed-off-by: SuZhou-Joe * feat: filter all use case Signed-off-by: SuZhou-Joe * fix: unit test Signed-off-by: SuZhou-Joe --------- Signed-off-by: SuZhou-Joe Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 6877beaadd517207722c261181c1751bfa5bfb40) --- changelogs/fragments/7655.yml | 2 + src/core/public/chrome/chrome_service.tsx | 1 + ...ollapsible_nav_group_enabled.test.tsx.snap | 461 +++++++++--------- .../header/__snapshots__/header.test.tsx.snap | 55 +++ .../header/collapsible_nav_group_enabled.scss | 15 +- .../collapsible_nav_group_enabled.test.tsx | 119 +++-- .../header/collapsible_nav_group_enabled.tsx | 104 ++-- ...collapsible_nav_group_enabled_top.test.tsx | 132 ++--- .../collapsible_nav_group_enabled_top.tsx | 88 ++-- .../public/chrome/ui/header/header.test.tsx | 2 + src/core/public/chrome/ui/header/header.tsx | 4 +- src/core/utils/default_app_categories.ts | 7 + src/core/utils/default_nav_groups.ts | 1 - .../advanced_settings/public/plugin.ts | 3 + .../data_source_management/public/plugin.ts | 49 +- src/plugins/home/public/plugin.ts | 26 +- .../public/plugin.test.ts | 2 +- .../index_pattern_management/public/plugin.ts | 46 +- src/plugins/management/public/plugin.ts | 18 +- .../saved_objects_management/public/plugin.ts | 48 +- src/plugins/visualize/public/plugin.ts | 7 + src/plugins/workspace/public/plugin.test.ts | 9 +- src/plugins/workspace/public/plugin.ts | 15 +- .../public/services/use_case_service.ts | 85 +++- src/plugins/workspace/public/utils.ts | 2 +- 25 files changed, 703 insertions(+), 598 deletions(-) create mode 100644 changelogs/fragments/7655.yml diff --git a/changelogs/fragments/7655.yml b/changelogs/fragments/7655.yml new file mode 100644 index 000000000000..70a921f4e6df --- /dev/null +++ b/changelogs/fragments/7655.yml @@ -0,0 +1,2 @@ +feat: +- [navigation] Left navigation collective ([#7655](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7655)) \ No newline at end of file diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index ef6d606aa0a5..10ef3f3a4e19 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -386,6 +386,7 @@ export class ChromeService { navGroupsMap$={navGroup.getNavGroupsMap$()} setCurrentNavGroup={navGroup.setCurrentNavGroup} workspaceList$={workspaces.workspaceList$} + currentWorkspace$={workspaces.currentWorkspace$} useUpdatedHeader={this.useUpdatedHeader} /> ), diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap index 2c6835acdaeb..95e501650f08 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap @@ -11,232 +11,232 @@ exports[` should render correctly 1`] = ` class="eui-fullHeight left-navigation-wrapper" >
+ +
+
- -
-
+
-
- - - + Observability +
-
+ +
+
- - -
- + - -
+ +
+ +
-
- - - + Essentials +
-
+ +
+
- - -
- + - -
+ + - - + +
@@ -254,13 +254,8 @@ exports[` should render correctly 2`] = ` class="eui-fullHeight left-navigation-wrapper" >
-
-
+ class="flex-1-container" + />
@@ -283,62 +278,62 @@ exports[` should show all use case by default and class="eui-fullHeight left-navigation-wrapper" >
+ +
+
- -
-
- -
+
+

@@ -356,62 +351,62 @@ exports[` should show all use case when current na class="eui-fullHeight left-navigation-wrapper" >
+ +
+
- -
-
- -
+
+
@@ -424,7 +419,7 @@ exports[` should render correctly 1`] = ` class="euiFlexItem" >