From 17b36b67affdcbef4457bf6fad41172edbfebc1d Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Fri, 28 Jun 2024 17:39:11 +0800 Subject: [PATCH] Remove options.workspaces drop behavior in conflict client wrapper Signed-off-by: Lin Wang --- ..._wrapper_for_check_workspace_conflict.test.ts | 16 ---------------- ...jects_wrapper_for_check_workspace_conflict.ts | 5 +---- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.test.ts b/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.test.ts index f5613550a541..118b7840ce3a 100644 --- a/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.test.ts +++ b/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.test.ts @@ -499,20 +499,4 @@ describe('WorkspaceConflictSavedObjectsClientWrapper', () => { ); }); }); - - describe('find', () => { - beforeEach(() => { - mockedClient.find.mockClear(); - }); - - it(`workspaces parameters should be removed when finding data sources`, async () => { - await wrapperClient.find({ - type: DATA_SOURCE_SAVED_OBJECT_TYPE, - workspaces: ['foo'], - }); - expect(mockedClient.find).toBeCalledWith({ - type: DATA_SOURCE_SAVED_OBJECT_TYPE, - }); - }); - }); }); diff --git a/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.ts b/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.ts index 0c4447e69e21..0fb6cfceebab 100644 --- a/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.ts +++ b/src/plugins/workspace/server/saved_objects/saved_objects_wrapper_for_check_workspace_conflict.ts @@ -412,10 +412,7 @@ export class WorkspaceConflictSavedObjectsClientWrapper { bulkCreate: bulkCreateWithWorkspaceConflictCheck, checkConflicts: checkConflictWithWorkspaceConflictCheck, delete: wrapperOptions.client.delete, - find: (options: SavedObjectsFindOptions) => - // TODO: The `formatFindParams` is a workaround for 2.14 to always list global data sources, - // should remove this workaround in the upcoming release once readonly share is available. - wrapperOptions.client.find(this.formatFindParams(options)), + find: wrapperOptions.client.find, bulkGet: wrapperOptions.client.bulkGet, get: wrapperOptions.client.get, update: wrapperOptions.client.update,