Skip to content

Commit edec3bd

Browse files
authored
register plugin with workspace template (opensearch-project#16)
Signed-off-by: Hailong Cui <ihailong@amazon.com>
1 parent 28da567 commit edec3bd

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/plugins/dashboard/public/plugin.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ export class DashboardPlugin
367367
defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`,
368368
updater$: this.appStateUpdater,
369369
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
370-
workspaceTemplate: [DEFAULT_WORKSPACE_TEMPLATES.search],
370+
workspaceTemplate: [
371+
DEFAULT_WORKSPACE_TEMPLATES.search,
372+
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
373+
DEFAULT_WORKSPACE_TEMPLATES.observability,
374+
DEFAULT_WORKSPACE_TEMPLATES.security_analytics,
375+
],
371376
mount: async (params: AppMountParameters) => {
372377
const [coreStart, pluginsStart, dashboardStart] = await core.getStartServices();
373378
this.currentHistory = params.history;

src/plugins/discover/public/plugin.ts

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
AppUpdater,
3939
CoreSetup,
4040
CoreStart,
41+
DEFAULT_WORKSPACE_TEMPLATES,
4142
Plugin,
4243
PluginInitializerContext,
4344
} from 'opensearch-dashboards/public';
@@ -315,6 +316,10 @@ export class DiscoverPlugin
315316
euiIconType: 'inputOutput',
316317
defaultPath: '#/',
317318
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
319+
workspaceTemplate: [
320+
DEFAULT_WORKSPACE_TEMPLATES.search,
321+
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
322+
],
318323
mount: async (params: AppMountParameters) => {
319324
if (!this.initializeServices) {
320325
throw Error('Discover plugin method initializeServices is undefined');

src/plugins/visualize/public/plugin.ts

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
AppUpdater,
3838
CoreSetup,
3939
CoreStart,
40+
DEFAULT_WORKSPACE_TEMPLATES,
4041
Plugin,
4142
PluginInitializerContext,
4243
ScopedHistory,
@@ -155,6 +156,10 @@ export class VisualizePlugin
155156
euiIconType: 'inputOutput',
156157
defaultPath: '#/',
157158
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
159+
workspaceTemplate: [
160+
DEFAULT_WORKSPACE_TEMPLATES.search,
161+
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
162+
],
158163
updater$: this.appStateUpdater.asObservable(),
159164
// remove all references to visualize
160165
mount: async (params: AppMountParameters) => {

0 commit comments

Comments
 (0)