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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
43ff505
Add a function to register all plugin Nav groups and categories
Jun 27, 2024
27641b5
Updated addNavLinkGroups path rename dashboards
Jul 2, 2024
bfa82c8
Fixing Naming
Jul 4, 2024
1519828
feat: enable default route
SuZhou-Joe Jul 5, 2024
f5e26f3
Merge pull request #1 from SuZhou-Joe/feature/enable_default_route
TackAdam Jul 5, 2024
6abb8ed
Update breadcrumb for Trace to default to service page
Jul 5, 2024
60ebb7c
Update snapshots
Jul 10, 2024
393815a
feat: update
SuZhou-Joe Jul 12, 2024
9b58c3a
feat: add some features to all use case
SuZhou-Joe Jul 17, 2024
1488866
Merge pull request #2 from SuZhou-Joe/poc/context-menu-navigation
TackAdam Jul 17, 2024
289451c
Depreciated logs, application. Dashboards/Traces adjusted
Jul 17, 2024
30e164a
Not registering logs/applications/dashboards when left nav used
Jul 17, 2024
080c17c
Update snapshots
Jul 17, 2024
ec684c5
fixing lint errors
Jul 17, 2024
493c16c
Put applications back
Jul 17, 2024
7825747
update snapshots
Jul 17, 2024
65fc08c
Merge branch 'main' into navObs
TackAdam Jul 17, 2024
f7a416d
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
6c821ed
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
8bdc12a
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
ef393c7
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
59e5500
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
2b92e6e
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
6fdc251
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
158c8a7
Update public/plugin_nav.tsx
TackAdam Jul 18, 2024
17994c2
Update public/plugin.tsx
TackAdam Jul 18, 2024
1917733
Removed applications from new nav
Jul 18, 2024
7396203
Add applications back, remove in app nav for trace, remove breadcrumb…
Jul 18, 2024
0bbc6d4
update snapshots
Jul 18, 2024
453f171
Adjust order of metrics/traces/services/applications as per guidance …
Jul 18, 2024
50d44d4
function for nav breadcrumbs added
Jul 19, 2024
4755904
Merge branch 'main' into navObs
sumukhswamy Jul 19, 2024
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: 1 addition & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

export const observabilityPanelsTitle = 'Observability-Dashboards';
export const observabilityPanelsPluginOrder = 5095;

export const observabilityIntegrationsID = 'integrations';
Expand Down
3 changes: 3 additions & 0 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ import {
SetupDependencies,
} from './types';
import { TablesFlyout } from './components/event_analytics/explorer/datasources/tables_flyout';
import { registerAllPluginNavGroups } from './plugin_nav';

interface PublicConfig {
query_assist: {
Expand Down Expand Up @@ -346,6 +347,8 @@ export class ObservabilityPlugin
mount: appMountWithStartPage('integrations'),
});

registerAllPluginNavGroups(core);

core.application.register({
id: observabilityDataConnectionsID,
title: observabilityDataConnectionsTitle,
Expand Down
127 changes: 127 additions & 0 deletions public/plugin_nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import {
observabilityApplicationsID,
observabilityIntegrationsID,
observabilityLogsID,
observabilityMetricsID,
observabilityNotebookID,
observabilityPanelsID,
observabilityTracesID,
} from '../common/constants/shared';
import { CoreSetup } from '../../../src/core/public';
import { AppPluginStartDependencies } from './types';
import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public';

export function registerAllPluginNavGroups(core: CoreSetup<AppPluginStartDependencies>) {
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
{
id: observabilityApplicationsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
Copy link
Member

Choose a reason for hiding this comment

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

OSD core has changed the category to visualizeAndReport but keep the dashboardAndReport to keep backward compatible. Could you please change to use visualizeAndReport?

},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityLogsID,
category: DEFAULT_APP_CATEGORIES.investigate,
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [
{
id: observabilityLogsID,
category: DEFAULT_APP_CATEGORIES.investigate,
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [
{
id: observabilityLogsID,
category: DEFAULT_APP_CATEGORIES.investigate,
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [
{
id: observabilityLogsID,
category: DEFAULT_APP_CATEGORIES.analyzeSearch,
},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityMetricsID,
category: DEFAULT_APP_CATEGORIES.investigate,
},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityTracesID,
category: DEFAULT_APP_CATEGORIES.investigate,
},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityNotebookID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [
{
id: observabilityNotebookID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [
{
id: observabilityNotebookID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityPanelsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [
{
id: observabilityPanelsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [
{
id: observabilityPanelsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
TackAdam marked this conversation as resolved.
Show resolved Hide resolved
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [
{
id: observabilityPanelsID,
category: DEFAULT_APP_CATEGORIES.analyzeSearch,
},
]);

core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [
{
id: observabilityIntegrationsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [
{
id: observabilityIntegrationsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
},
]);
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [
{
id: observabilityIntegrationsID,
category: DEFAULT_APP_CATEGORIES.dashboardAndReport,
},
]);
}
Loading