Skip to content

Commit

Permalink
feat: add feature flag check
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Mar 8, 2024
1 parent b6a1622 commit 64b3645
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/core/public/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ export class HttpService implements CoreService<HttpSetup, HttpStart> {
public setup({ injectedMetadata, fatalErrors }: HttpDeps): HttpSetup {
const opensearchDashboardsVersion = injectedMetadata.getOpenSearchDashboardsVersion();
let workspaceBasePath = '';
const workspaceId = getWorkspaceIdFromUrl(window.location.href);
if (workspaceId) {
workspaceBasePath = `${WORKSPACE_PATH_PREFIX}/${workspaceId}`;
const plugins = injectedMetadata.getPlugins();
const findWorkspaceConfig = plugins.find((plugin) => plugin.id === 'workspace');
// Only try to get workspace id from url when workspace feature is enabled
if (findWorkspaceConfig) {
const workspaceId = getWorkspaceIdFromUrl(window.location.href);
if (workspaceId) {
workspaceBasePath = `${WORKSPACE_PATH_PREFIX}/${workspaceId}`;
}
}
const basePath = new BasePath(
injectedMetadata.getBasePath(),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/workspace/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "workspace",
"version": "opensearchDashboards",
"server": true,
"ui": false,
"ui": true,
"requiredPlugins": [
"savedObjects"
],
Expand Down

0 comments on commit 64b3645

Please sign in to comment.