Skip to content

Commit

Permalink
optimize the code
Browse files Browse the repository at this point in the history
Signed-off-by: yubonluo <yubonluo@amazon.com>
  • Loading branch information
yubonluo committed Sep 30, 2024
1 parent f35c204 commit c29ec21
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import {
WorkspaceAttribute,
OpenSearchDashboardsRequest,
SavedObjectsClientContract,
CURRENT_USER_PLACEHOLDER,
} from '../../../../core/server';
import { DEFAULT_WORKSPACE, WORKSPACE_UI_SETTINGS_CLIENT_WRAPPER_ID } from '../../common/constants';
import { WORKSPACE_UI_SETTINGS_CLIENT_WRAPPER_ID } from '../../common/constants';
import { Logger } from '../../../../core/server';
import { DEFAULT_DATA_SOURCE_UI_SETTINGS_ID } from '../../../data_source_management/common';

Expand Down Expand Up @@ -101,9 +102,9 @@ export class WorkspaceUiSettingsClientWrapper {
/**
* When updating ui settings within a workspace, it will update the workspace ui settings,
* the global ui settings will remain unchanged.
* When updating default workspace, it will update user level settings.
* Allow user to update user level settings.
*/
if (type === 'config' && requestWorkspaceId && !(DEFAULT_WORKSPACE in attributes)) {
if (type === 'config' && requestWorkspaceId && !id.startsWith(CURRENT_USER_PLACEHOLDER)) {
const configObject = await wrapperOptions.client.get<Record<string, any>>(
'config',
id,
Expand Down

0 comments on commit c29ec21

Please sign in to comment.