From 27a44ab748de60349c27ab751a68398099ac3563 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Wed, 3 Aug 2022 15:45:13 -0400 Subject: [PATCH] 19142: Unselect mounts when loading all process and project view Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- .../all-processes-panel-middleware-service.ts | 43 +++++++++++++++++- src/store/processes/processes-actions.ts | 45 ++++++++++++++++++- .../project-panel-middleware-service.ts | 3 +- 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/src/store/all-processes-panel/all-processes-panel-middleware-service.ts b/src/store/all-processes-panel/all-processes-panel-middleware-service.ts index 88b64e62..8881d72e 100644 --- a/src/store/all-processes-panel/all-processes-panel-middleware-service.ts +++ b/src/store/all-processes-panel/all-processes-panel-middleware-service.ts @@ -37,7 +37,11 @@ export class AllProcessesPanelMiddlewareService extends DataExplorerMiddlewareSe try { api.dispatch(progressIndicatorActions.START_WORKING(this.getId())); const processItems = await this.services.containerRequestService.list( - { ...getParams(dataExplorer) }); + { + ...getParams(dataExplorer), + // Omit mounts when viewing all process panel + select: containerRequestFieldsNoMounts, + }); api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId())); api.dispatch(resourcesActions.SET_RESOURCES(processItems.items)); @@ -62,6 +66,43 @@ export class AllProcessesPanelMiddlewareService extends DataExplorerMiddlewareSe } } +export const containerRequestFieldsNoMounts = [ + "command", + "container_count_max", + "container_count", + "container_image", + "container_uuid", + "created_at", + "cwd", + "description", + "environment", + "etag", + "expires_at", + "filters", + "href", + "kind", + "log_uuid", + "modified_at", + "modified_by_client_uuid", + "modified_by_user_uuid", + "name", + "output_name", + "output_path", + "output_properties", + "output_storage_classes", + "output_ttl", + "output_uuid", + "owner_uuid", + "priority", + "properties", + "requesting_container_uuid", + "runtime_constraints", + "scheduling_parameters", + "state", + "use_existing", + "uuid", +]; + const getParams = ( dataExplorer: DataExplorer ) => ({ ...dataExplorerToListParams(dataExplorer), order: getOrder(dataExplorer), diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts index 213e292b..9758ab65 100644 --- a/src/store/processes/processes-actions.ts +++ b/src/store/processes/processes-actions.ts @@ -34,13 +34,54 @@ export const loadProcess = (containerRequestUuid: string) => return { containerRequest }; }; -export const loadContainers = (filters: string) => +export const loadContainers = (filters: string, loadMounts: boolean = true) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const { items } = await services.containerService.list({ filters }); + let args: any = { filters }; + if (!loadMounts) { + args.select = containerFieldsNoMounts; + } + const { items } = await services.containerService.list(args); dispatch(updateResources(items)); return items; }; +const containerFieldsNoMounts = [ + "auth_uuid", + "command", + "container_image", + "created_at", + "cwd", + "environment", + "etag", + "exit_code", + "finished_at", + "gateway_address", + "href", + "interactive_session_started", + "kind", + "lock_count", + "locked_by_uuid", + "log", + "modified_at", + "modified_by_client_uuid", + "modified_by_user_uuid", + "output_path", + "output_properties", + "output_storage_classes", + "output", + "owner_uuid", + "priority", + "progress", + "runtime_auth_scopes", + "runtime_constraints", + "runtime_status", + "runtime_user_uuid", + "scheduling_parameters", + "started_at", + "state", + "uuid", +] + export const cancelRunningWorkflow = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { try { diff --git a/src/store/project-panel/project-panel-middleware-service.ts b/src/store/project-panel/project-panel-middleware-service.ts index ccfa4fff..d8a5d82d 100644 --- a/src/store/project-panel/project-panel-middleware-service.ts +++ b/src/store/project-panel/project-panel-middleware-service.ts @@ -89,7 +89,8 @@ export const loadMissingProcessesInformation = (resources: GroupContentsResource }, []); if (containerUuids.length > 0) { await dispatch(loadContainers( - new FilterBuilder().addIn('uuid', containerUuids).getFilters() + new FilterBuilder().addIn('uuid', containerUuids).getFilters(), + false )); } }; -- 2.30.2