diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index c7951a955fde..55ed9a02d24d 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -34,6 +34,9 @@ import { filter, map } from 'rxjs/operators'; import { i18n } from '@osd/i18n'; import { FormattedMessage } from '@osd/i18n/react'; +import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public'; +import { isEmpty } from 'lodash'; +import { createHashHistory } from 'history'; import { App, AppMountParameters, @@ -43,11 +46,9 @@ import { Plugin, PluginInitializerContext, SavedObjectsClientContract, + WorkspaceAvailability, ScopedHistory, -} from 'src/core/public'; -import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public'; -import { isEmpty } from 'lodash'; -import { createHashHistory } from 'history'; +} from '../../../../src/core/public'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { CONTEXT_MENU_TRIGGER, @@ -367,6 +368,7 @@ export class DashboardPlugin id: DashboardConstants.DASHBOARDS_ID, title: 'Dashboards', order: 2500, + workspaceAvailability: WorkspaceAvailability.insideWorkspace, euiIconType: 'inputOutput', defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`, updater$: this.appStateUpdater, diff --git a/src/plugins/visualize/public/plugin.ts b/src/plugins/visualize/public/plugin.ts index 6df26eb08d42..1b1d20803aef 100644 --- a/src/plugins/visualize/public/plugin.ts +++ b/src/plugins/visualize/public/plugin.ts @@ -42,6 +42,7 @@ import { ScopedHistory, } from 'opensearch-dashboards/public'; +import { WorkspaceAvailability } from '../../../../src/core/public'; import { Storage, createOsdUrlTracker, @@ -158,6 +159,7 @@ export class VisualizePlugin title: 'Visualize', order: 8000, euiIconType: 'inputOutput', + workspaceAvailability: WorkspaceAvailability.insideWorkspace, defaultPath: '#/', category: DEFAULT_APP_CATEGORIES.opensearchDashboards, updater$: this.appStateUpdater.asObservable(), diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index 0dbf5fe0bb02..35c1e730c287 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -162,6 +162,12 @@ export class WorkspacePlugin */ return { status: AppStatus.inaccessible }; }); + } else { + this.appUpdater$.next((app) => { + if (app.workspaceAvailability === WorkspaceAvailability.insideWorkspace) { + return { status: AppStatus.inaccessible }; + } + }); } });