From 225f6f0566d3b33c97c03915ef2396cf35ce5199 Mon Sep 17 00:00:00 2001 From: Qxisylolo Date: Thu, 31 Oct 2024 15:11:52 +0800 Subject: [PATCH] use workspaceNameIdLookup Signed-off-by: Qxisylolo --- .../__snapshots__/saved_objects_table.test.tsx.snap | 2 +- .../management_section/objects_table/components/table.tsx | 2 +- .../objects_table/saved_objects_table.tsx | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap index d526e59b0153..edcfc62ddba9 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap @@ -1236,7 +1236,7 @@ exports[`SavedObjectsTable should render normally 1`] = ` } } totalItemCount={4} - workspaceIdNameMap={Map {}} + workspaceNameIdLookup={Map {}} /> diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx index f5a99c44d774..dc3cb7dab0c0 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx @@ -81,7 +81,7 @@ export interface TableProps { pageIndex: number; pageSize: number; items: SavedObjectWithMetadata[]; - workspaceIdNameMap: Map; + workspaceNameIdLookup: Map; itemId: string | (() => string); totalItemCount: number; onQueryChange: (query: any, filterFields: string[]) => void; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx index abee4fa2ccc6..41f932ff2f36 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx @@ -161,7 +161,6 @@ export interface SavedObjectsTableState { isIncludeReferencesDeepChecked: boolean; currentWorkspace?: WorkspaceObject; workspaceEnabled: boolean; - workspaceIdNameMap: Map; availableWorkspaces?: WorkspaceAttribute[]; isShowingDuplicateResultFlyout: boolean; failedCopies: SavedObjectsImportError[]; @@ -202,7 +201,6 @@ export class SavedObjectsTable extends Component(), currentWorkspace: this.props.workspaces.currentWorkspace$.getValue(), availableWorkspaces: this.props.workspaces.workspaceList$.getValue(), workspaceEnabled: this.props.applications.capabilities.workspaces.enabled, @@ -380,7 +378,6 @@ export class SavedObjectsTable extends Component { this.setState({ availableWorkspaces: workspaceList }); }); - this.setState({ workspaceIdNameMap: this.workspaceNameIdLookup }); }; unSubscribeWorkspace = () => { @@ -1090,7 +1087,6 @@ export class SavedObjectsTable extends Component