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

[Navigation] Register all plugins to NavGroups #1926

Merged
merged 32 commits into from
Jul 19, 2024

Conversation

TackAdam
Copy link
Collaborator

@TackAdam TackAdam commented Jun 27, 2024

Description

Demo.mov.zip

Screenshot 2024-07-18 at 4 46 03 PM Screenshot 2024-07-18 at 4 46 13 PM

This change adds a function that registers all the plugins to their corresponding NavGroups and NavCategories:

Plug-in Group Category
Notebooks Observability Dashboards and report
Notebooks Security Analytics Dashboards and report
Notebooks Analytics Dashboards and report
Integrations Observability Dashboards and report
Integrations Security Analytics Dashboards and report
Integrations Analytics Dashboards and report
Metrics Observability Investigate
Applications Observability Dashboards and report
Traces Observability Investigate

Issues Resolved

opensearch-project/OpenSearch-Dashboards#7029

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@joshuali925
Copy link
Member

joshuali925 commented Jun 27, 2024

should this be done inside each plugin? rather than in observability nvm i just realized Discover is log explore, not OSD Discover

@@ -58,7 +58,7 @@ export const observabilityNotebookTitle = 'Notebooks';
export const observabilityNotebookPluginOrder = 5094;

export const observabilityPanelsID = 'observability-dashboards';
export const observabilityPanelsTitle = 'Dashboards';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't change this here as it also changes in the name existing side-nav

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Signed-off-by: Adam Tackett <[email protected]>
@@ -58,7 +58,7 @@ export const observabilityNotebookTitle = 'Notebooks';
export const observabilityNotebookPluginOrder = 5094;

export const observabilityPanelsID = 'observability-dashboards';
export const observabilityPanelsTitle = 'Dashboards';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

order: observabilityPanelsPluginOrder,
mount: appMountWithStartPage('dashboards'),
});
if (core.chrome.navGroup.getNavGroupEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my knowledge, is this like a feature flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the navigation change can be toggled, and the UI plan currently list regular dashboards as going into the same category. Until it is depreciated the idea was to rename ours for clarity while using the new navigation.

@@ -364,6 +366,7 @@ export const Home = (props: HomeProps) => {
/>
)}
/>
<Route path="/" render={() => <Redirect to={defaultRoute} />} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to remove in-app navigation when the new navigation is enabled. In such case, different apps registered to new left navigation will have difference landing pages.

Adam Tackett and others added 4 commits July 10, 2024 11:36
Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
TackAdam and others added 9 commits July 17, 2024 22:28
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
…s while new navigation is active

Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
href: '#/',
},
]);
const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to account for Logs being removed in the new navigation.

render={(_routerProps) => (
<TraceSideBar>
render={(_routerProps) =>
!isNavGroupEnabled ? (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevents in app navigation from rendering while the new left hand navigation is enabled

@ps48 ps48 merged commit 09090a6 into opensearch-project:main Jul 19, 2024
12 of 19 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-observability/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-observability/backport-2.x
# Create a new branch
git switch --create backport/backport-1926-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 09090a6d5ec0dc968de7493e6c8371b2dbbaa9cf
# Push it to GitHub
git push --set-upstream origin backport/backport-1926-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-observability/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1926-to-2.x.

TackAdam added a commit to TackAdam/dashboards-observability that referenced this pull request Jul 19, 2024
* Add a function to register all plugin Nav groups and categories

Signed-off-by: Adam Tackett <[email protected]>

* Updated addNavLinkGroups path rename dashboards

Signed-off-by: Adam Tackett <[email protected]>

* Fixing Naming

Signed-off-by: Adam Tackett <[email protected]>

* feat: enable default route

Signed-off-by: SuZhou-Joe <[email protected]>

* Update breadcrumb for Trace to default to service page

Signed-off-by: Adam Tackett <[email protected]>

* Update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add some features to all use case

Signed-off-by: SuZhou-Joe <[email protected]>

* Depreciated logs, application. Dashboards/Traces adjusted

Signed-off-by: Adam Tackett <[email protected]>

* Not registering logs/applications/dashboards when left nav used

Signed-off-by: Adam Tackett <[email protected]>

* Update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* fixing lint errors

Signed-off-by: Adam Tackett <[email protected]>

* Put applications back

Signed-off-by: Adam Tackett <[email protected]>

* update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Removed applications from new nav

Signed-off-by: Adam Tackett <[email protected]>

* Add applications back, remove in app nav for trace, remove breadcrumbs while new navigation is active

Signed-off-by: Adam Tackett <[email protected]>

* update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* Adjust order of metrics/traces/services/applications as per guidance from kevin

Signed-off-by: Adam Tackett <[email protected]>

* function for nav breadcrumbs added

Signed-off-by: Adam Tackett <[email protected]>

---------

Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Co-authored-by: Sumukh Swamy <[email protected]>
(cherry picked from commit 09090a6)
ps48 pushed a commit that referenced this pull request Jul 19, 2024
…1948)

* [Navigation] Register all plugins to NavGroups (#1926)

* Add a function to register all plugin Nav groups and categories

Signed-off-by: Adam Tackett <[email protected]>

* Updated addNavLinkGroups path rename dashboards

Signed-off-by: Adam Tackett <[email protected]>

* Fixing Naming

Signed-off-by: Adam Tackett <[email protected]>

* feat: enable default route

Signed-off-by: SuZhou-Joe <[email protected]>

* Update breadcrumb for Trace to default to service page

Signed-off-by: Adam Tackett <[email protected]>

* Update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add some features to all use case

Signed-off-by: SuZhou-Joe <[email protected]>

* Depreciated logs, application. Dashboards/Traces adjusted

Signed-off-by: Adam Tackett <[email protected]>

* Not registering logs/applications/dashboards when left nav used

Signed-off-by: Adam Tackett <[email protected]>

* Update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* fixing lint errors

Signed-off-by: Adam Tackett <[email protected]>

* Put applications back

Signed-off-by: Adam Tackett <[email protected]>

* update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin_nav.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Update public/plugin.tsx

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>

* Removed applications from new nav

Signed-off-by: Adam Tackett <[email protected]>

* Add applications back, remove in app nav for trace, remove breadcrumbs while new navigation is active

Signed-off-by: Adam Tackett <[email protected]>

* update snapshots

Signed-off-by: Adam Tackett <[email protected]>

* Adjust order of metrics/traces/services/applications as per guidance from kevin

Signed-off-by: Adam Tackett <[email protected]>

* function for nav breadcrumbs added

Signed-off-by: Adam Tackett <[email protected]>

---------

Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: Adam Tackett <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Co-authored-by: Sumukh Swamy <[email protected]>
(cherry picked from commit 09090a6)

* remove error

Signed-off-by: Adam Tackett <[email protected]>

---------

Signed-off-by: Adam Tackett <[email protected]>
Co-authored-by: Adam Tackett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants