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

[Feature] Dashboards-List integrations #151

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e3db068
Observability - Dashboard Lists Integration
Oct 24, 2022
d655d4b
Added missing component file
Jan 4, 2023
1293b1b
Add Observability module links to OSD Left-Nav
Jan 4, 2023
929fd4e
Update Observability left-nav link names and Dashboard Creators link …
Jan 5, 2023
5734b97
Use custom icon for Left-Nav Observability Group
Jan 5, 2023
26d00cb
Change OpenSearch Observability left-nav group to No-Icon.
Jan 6, 2023
626eb60
WIP - fixing Observability Routing
Jan 10, 2023
46f2545
correct ppl leran more link (#154)
mengweieric Jan 5, 2023
6e0c5a3
Fix explorer dark mode issue and restructure scss (#157)
mengweieric Jan 5, 2023
b2cff40
Fix event analytics field blank margin (#174)
joshuali925 Jan 6, 2023
fa1d3dc
Fix show legend in bar charts (#175)
joshuali925 Jan 6, 2023
f72aa0f
Update 2.x to be the same as observability repo (#158) (#177)
opensearch-trigger-bot[bot] Jan 9, 2023
458d4ad
Updated MAINTAINERS.md to match recommended opensearch-project format…
dblock Jan 9, 2023
266cd70
Fixed PPL Error in containers & added tool tip to date picker (#179) …
opensearch-trigger-bot[bot] Jan 9, 2023
b9b5b07
Few fixes regarding issues for visualization rendering (#185)
mengweieric Jan 10, 2023
9413597
Observability - Dashboard Lists Integration
Oct 24, 2022
5e957c5
Use custom icon for Left-Nav Observability Group
Jan 5, 2023
ddcc4e6
Correct issues with Dashboard-List items, create, and Left-Nav
Jan 11, 2023
f483dba
Merge branch 'main' into feature-dash-obs/dashboad-list-integration.4
pjfitzgibbons Jan 11, 2023
69fbcc3
Remove console logging
Jan 11, 2023
3d9a34a
Updated DashboardList associated types
Jan 11, 2023
521ddb1
Update DashboardList registration for App Analytics
Jan 23, 2023
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
Prev Previous commit
Next Next commit
Updated DashboardList associated types
Disabled OperationalPanels/Notebooks create links (temporary commented)

Signed-off-by: Peter Fitzgibbons <pjfitz@amazon.com>
  • Loading branch information
Peter Fitzgibbons committed Jan 11, 2023
commit 3d9a34ac1f4741b9d7a5f5aba29ec8478a00521b
35 changes: 19 additions & 16 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

import './index.scss';

import { concat, from } from 'rxjs';
import { catchError, map, mergeMap } from 'rxjs/operators';
import {
AppMountParameters,
CoreSetup,
CoreStart,
Plugin,
PluginInitializerContext
PluginInitializerContext,
} from '../../../src/core/public';
import {
observabilityID,
Expand All @@ -25,15 +27,12 @@ import { AppPluginStartDependencies, ObservabilitySetup, ObservabilityStart } fr
import { convertLegacyNotebooksUrl } from './components/notebooks/components/helpers/legacy_route_helpers';
import { convertLegacyTraceAnalyticsUrl } from './components/trace_analytics/components/common/legacy_route_helpers';
import { uiSettingsService } from '../common/utils';
import { DashboardCreatorFn } from '../../../src/plugins/opensearch_dashboards_react/public/context/types';
import { DashboardCreatorFn, DashboardListItem } from './types';
import { fetchPanelsList } from './components/custom_panels/helpers/utils';
import { fetchAppsList } from './components/application_analytics/helpers/utils';
import { fetchNotebooksList } from './components/notebooks/components/helpers/utils';
import { QueryManager } from '../common/query_manager';
import { DashboardSetup } from '../../../src/plugins/dashboard/public';
import { DashboardListItem } from '../../../src/plugins/dashboard/common/types';
import { concat, from } from 'rxjs';
import { catchError, map, mergeMap } from 'rxjs/operators';

export class ObservabilityPlugin implements Plugin<ObservabilitySetup, ObservabilityStart> {
constructor(private initializerContext: PluginInitializerContext) {}
Expand Down Expand Up @@ -92,7 +91,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilitySetup, Observabi
title: item.name,
type: 'Observability Panel',
description: '...',
url: `observability-applications#/operational_panels/${item.id}`,
url: `observability-dashboards#/operational_panels/${item.id}`,
listType: 'observabiliity-panel',
};
};
Expand All @@ -103,7 +102,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilitySetup, Observabi
title: item.name,
type: 'Observability Application',
description: item.description,
url: `observability-applications#/application_analytics/${item.id}`,
url: `observability-dashboards#/application_analytics/${item.id}`,
listType: 'observability-application',
};
};
Expand All @@ -114,7 +113,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilitySetup, Observabi
title: item.path,
type: 'Notebook',
description: '...',
url: `observability-applications#/notebooks/${item.id}`,
url: `observability-dashboards#/notebooks/${item.id}`,
listType: 'observability-notebook',
};
};
Expand All @@ -124,13 +123,19 @@ export class ObservabilityPlugin implements Plugin<ObservabilitySetup, Observabi
const dashboardAppAnalytics = fetchApplicationAnalytics();
const dashboardObservabilityPanels = fetchObservabilityPanels();
const dashboardNotebooks = fetchNotebooks();
const combinedDashboardList = concat(dashboardAppAnalytics, dashboardObservabilityPanels, dashboardNotebooks);

const createAppAnalytics: DashboardCreatorFn = () => {
window.location = core.http.basePath.prepend(
'/app/observability-dashboards#/application_analytics/create'
);
const combinedDashboardList = concat(
dashboardAppAnalytics,
dashboardObservabilityPanels,
dashboardNotebooks
);

const createAppAnalytics: DashboardCreatorFn = (_history) => {
return (event: MouseEvent) =>
(window.location.href = core.http.basePath.prepend(
'/app/observability-dashboards#/application_analytics/create'
));
};

//
// const createNotebook: DashboardCreatorFn = () => {
// window.location = core.http.basePath.prepend(
Expand Down Expand Up @@ -194,8 +199,6 @@ export class ObservabilityPlugin implements Plugin<ObservabilitySetup, Observabi
},
});



// Return methods that should be available to other plugins
return {};
}
Expand Down
34 changes: 32 additions & 2 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Observable } from 'rxjs';
import { DashboardStart } from '../../../src/plugins/dashboard/public';
import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';

Expand All @@ -11,6 +12,35 @@ export interface AppPluginStartDependencies {
dashboard: DashboardStart;
}

export interface ObservabilitySetup {}
export interface DashboardListSource {
name: string;
listProviderFn: () => Observable<DashboardListItem>;
}

export type DashboardListSources = DashboardListSource[];

export type DashboardCreators = DashboardCreator[];

export interface ObservabilityStart {}
export type DashboardCreatorFn = (history: any) => (event: MouseEvent) => void;

export interface DashboardCreator {
id: string; // key identifier for creator plugin/module
defaultText: string; // display name for create link
creatorFn: DashboardCreatorFn; // onClick call this
}

export interface DashboardListItem {
id: string; // plugin identifier
title: string; // item title
type: string; // item type display string
description: string; // item description
url: string; // redirect url to item detail
listType: string; // item type key
}

export type DashboardListItems = DashboardListItem[];
export type DashboardListProviderFn = () => Observable<DashboardListItem>;
export interface DashboardDisplay {
hits: DashboardListItems;
total: number;
}