From 7f6e94336dd0237e2d6e3b18bcde8a4bc335b594 Mon Sep 17 00:00:00 2001 From: SuZhoue-Joe Date: Mon, 19 Jun 2023 11:13:34 +0800 Subject: [PATCH] Revert "feat: extract management code" This reverts commit 9c765d23aeae8bb76ab35a897e4abef9cc9da860. --- .../objects_table/saved_objects_table.tsx | 2 ++ .../management_section/saved_objects_table_page.tsx | 1 + .../saved_objects_management/server/routes/find.ts | 10 ++++++++++ 3 files changed, 13 insertions(+) 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 fbbd885c1ff4..79edf9c63fc8 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 @@ -65,6 +65,7 @@ import { OverlayStart, NotificationsStart, ApplicationStart, + WorkspacesStart, } from 'src/core/public'; import { RedirectAppLinks } from '../../../../opensearch_dashboards_react/public'; import { IndexPatternsContract } from '../../../../data/public'; @@ -114,6 +115,7 @@ export interface SavedObjectsTableProps { goInspectObject: (obj: SavedObjectWithMetadata) => void; canGoInApp: (obj: SavedObjectWithMetadata) => boolean; dateFormat: string; + workspaces: WorkspacesStart; } export interface SavedObjectsTableState { diff --git a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx index 09937388ba57..bd1842c9945f 100644 --- a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx +++ b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx @@ -88,6 +88,7 @@ const SavedObjectsTablePage = ({ overlays={coreStart.overlays} notifications={coreStart.notifications} applications={coreStart.application} + workspaces={coreStart.workspaces} perPageConfig={itemsPerPage} goInspectObject={(savedObject) => { const { editUrl } = savedObject.meta; diff --git a/src/plugins/saved_objects_management/server/routes/find.ts b/src/plugins/saved_objects_management/server/routes/find.ts index dd49fc7575df..4708e3ae5b5b 100644 --- a/src/plugins/saved_objects_management/server/routes/find.ts +++ b/src/plugins/saved_objects_management/server/routes/find.ts @@ -94,6 +94,16 @@ export const registerFindRoute = ( ...req.query, fields: undefined, searchFields: [...searchFields], + namespaces: req.query.namespaces + ? Array.isArray(req.query.namespaces) + ? req.query.namespaces + : [req.query.namespaces] + : undefined, + workspaces: req.query.workspaces + ? Array.isArray(req.query.workspaces) + ? req.query.workspaces + : [req.query.workspaces] + : undefined, }); const savedObjects = await Promise.all(