From d2348ff6c40ae333e8b7c5f39a0392e32fdaed08 Mon Sep 17 00:00:00 2001 From: tygao Date: Fri, 27 Oct 2023 12:06:50 +0800 Subject: [PATCH] use cleanWorkspaceId Signed-off-by: tygao --- src/core/public/index.ts | 1 + .../public/components/workspace_list/index.tsx | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 1f26a26de8ef..609bf53f0ba2 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -357,4 +357,5 @@ export { PUBLIC_WORKSPACE_ID, MANAGEMENT_WORKSPACE_ID, WORKSPACE_TYPE, + cleanWorkspaceId, } from '../utils'; diff --git a/src/plugins/workspace/public/components/workspace_list/index.tsx b/src/plugins/workspace/public/components/workspace_list/index.tsx index 58b5f467373e..201f1928b8fc 100644 --- a/src/plugins/workspace/public/components/workspace_list/index.tsx +++ b/src/plugins/workspace/public/components/workspace_list/index.tsx @@ -26,6 +26,8 @@ import { debounce } from '../utils/common'; import { WORKSPACE_CREATE_APP_ID } from '../../../common/constants'; +import { cleanWorkspaceId } from '../../../../../core/public'; + const WORKSPACE_LIST_PAGE_DESCRIPTIOIN = i18n.translate('workspace.list.description', { defaultMessage: 'Workspace allow you to save and organize library items, such as index patterns, visualizations, dashboards, saved searches, and share them with other OpenSearch Dashboards users. You can control which features are visible in each workspace, and which users and groups have read and write access to the library items in the workspace.', @@ -127,9 +129,12 @@ export const WorkspaceList = () => { if (!application || !http) { return ''; } - return application.getUrlForApp(WORKSPACE_CREATE_APP_ID, { - absolute: false, - }); + + return cleanWorkspaceId( + application.getUrlForApp(WORKSPACE_CREATE_APP_ID, { + absolute: false, + }) + ); }, [application, http]); const debouncedSetQueryInput = useMemo(() => {