From 1fe0c598cc0adcfc01941919f6f8615d3b605884 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 16 Jun 2023 09:36:37 +0800 Subject: [PATCH] register plugin with workspace template (#16) Signed-off-by: Hailong Cui --- src/plugins/dashboard/public/plugin.tsx | 7 ++++++- src/plugins/discover/public/plugin.ts | 5 +++++ src/plugins/visualize/public/plugin.ts | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index e9e6de05d1dc..19264e43363c 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -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; diff --git a/src/plugins/discover/public/plugin.ts b/src/plugins/discover/public/plugin.ts index 62f6e6908ba1..a4c5bb78d649 100644 --- a/src/plugins/discover/public/plugin.ts +++ b/src/plugins/discover/public/plugin.ts @@ -38,6 +38,7 @@ import { AppUpdater, CoreSetup, CoreStart, + DEFAULT_WORKSPACE_TEMPLATES, Plugin, PluginInitializerContext, } from 'opensearch-dashboards/public'; @@ -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'); diff --git a/src/plugins/visualize/public/plugin.ts b/src/plugins/visualize/public/plugin.ts index c146efef1fab..dfb521961293 100644 --- a/src/plugins/visualize/public/plugin.ts +++ b/src/plugins/visualize/public/plugin.ts @@ -37,6 +37,7 @@ import { AppUpdater, CoreSetup, CoreStart, + DEFAULT_WORKSPACE_TEMPLATES, Plugin, PluginInitializerContext, ScopedHistory, @@ -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) => {