Skip to content

Commit

Permalink
register plugin with workspace template (#16)
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am authored and SuZhou-Joe committed Jul 19, 2023
1 parent 12160f0 commit 1fe0c59
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,12 @@ export class DashboardPlugin
defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`,
updater$: this.appStateUpdater,
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
workspaceTemplate: [DEFAULT_WORKSPACE_TEMPLATES.search],
workspaceTemplate: [
DEFAULT_WORKSPACE_TEMPLATES.search,
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
DEFAULT_WORKSPACE_TEMPLATES.observability,
DEFAULT_WORKSPACE_TEMPLATES.security_analytics,
],
mount: async (params: AppMountParameters) => {
const [coreStart, pluginsStart, dashboardStart] = await core.getStartServices();
this.currentHistory = params.history;
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/discover/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
AppUpdater,
CoreSetup,
CoreStart,
DEFAULT_WORKSPACE_TEMPLATES,
Plugin,
PluginInitializerContext,
} from 'opensearch-dashboards/public';
Expand Down Expand Up @@ -315,6 +316,10 @@ export class DiscoverPlugin
euiIconType: 'inputOutput',
defaultPath: '#/',
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
workspaceTemplate: [
DEFAULT_WORKSPACE_TEMPLATES.search,
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
],
mount: async (params: AppMountParameters) => {
if (!this.initializeServices) {
throw Error('Discover plugin method initializeServices is undefined');
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
AppUpdater,
CoreSetup,
CoreStart,
DEFAULT_WORKSPACE_TEMPLATES,
Plugin,
PluginInitializerContext,
ScopedHistory,
Expand Down Expand Up @@ -157,6 +158,10 @@ export class VisualizePlugin
euiIconType: 'inputOutput',
defaultPath: '#/',
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
workspaceTemplate: [
DEFAULT_WORKSPACE_TEMPLATES.search,
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
],
updater$: this.appStateUpdater.asObservable(),
// remove all references to visualize
mount: async (params: AppMountParameters) => {
Expand Down

0 comments on commit 1fe0c59

Please sign in to comment.