Skip to content

Commit 5074400

Browse files
Hailong-amruanyl
authored andcommittedAug 3, 2023
register plugin with workspace template (opensearch-project#16)
Signed-off-by: Hailong Cui <ihailong@amazon.com>

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
@@ -372,7 +372,12 @@ export class DashboardPlugin
372372
defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`,
373373
updater$: this.appStateUpdater,
374374
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
375-
workspaceTemplate: [DEFAULT_WORKSPACE_TEMPLATES.search],
375+
workspaceTemplate: [
376+
DEFAULT_WORKSPACE_TEMPLATES.search,
377+
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
378+
DEFAULT_WORKSPACE_TEMPLATES.observability,
379+
DEFAULT_WORKSPACE_TEMPLATES.security_analytics,
380+
],
376381
mount: async (params: AppMountParameters) => {
377382
const [coreStart, pluginsStart, dashboardStart] = await core.getStartServices();
378383
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,
@@ -157,6 +158,10 @@ export class VisualizePlugin
157158
euiIconType: 'inputOutput',
158159
defaultPath: '#/',
159160
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
161+
workspaceTemplate: [
162+
DEFAULT_WORKSPACE_TEMPLATES.search,
163+
DEFAULT_WORKSPACE_TEMPLATES.general_analysis,
164+
],
160165
updater$: this.appStateUpdater.asObservable(),
161166
// remove all references to visualize
162167
mount: async (params: AppMountParameters) => {

0 commit comments

Comments
 (0)
Please sign in to comment.