[ARVADOS-WORKBENCH2] updated: 1.2.0-221-ge602a12

Git user git at public.curoverse.com
Thu Aug 30 10:04:03 EDT 2018


Summary of changes:
 src/store/processes/process.ts           | 22 +++++++++++++---------
 src/store/processes/processes-actions.ts |  9 +++++----
 2 files changed, 18 insertions(+), 13 deletions(-)

       via  e602a1284fb49aa9f7e727e828e48638a657cebb (commit)
      from  18e651dbee6e598bd79576b178fb4d755cd7a424 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e602a1284fb49aa9f7e727e828e48638a657cebb
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Aug 30 16:03:48 2018 +0200

    Update subprocess actions and selectors
    
    Feature #14099
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/store/processes/process.ts b/src/store/processes/process.ts
index 46d8a25..0f12b3f 100644
--- a/src/store/processes/process.ts
+++ b/src/store/processes/process.ts
@@ -28,13 +28,17 @@ export const getProcess = (uuid: string) => (resources: ResourcesState): Process
 };
 
 export const getSubprocesses = (uuid: string) => (resources: ResourcesState) => {
-    const containerRequests = filterResources(isSubprocess(uuid))(resources) as ContainerRequestResource[];
-    return containerRequests.reduce((subprocesses, { uuid }) => {
-        const process = getProcess(uuid)(resources);
-        return process
-            ? [...subprocesses, process]
-            : subprocesses;
-    }, []);
+    const process = getProcess(uuid)(resources);
+    if (process && process.container) {
+        const containerRequests = filterResources(isSubprocess(process.container.uuid))(resources) as ContainerRequestResource[];
+        return containerRequests.reduce((subprocesses, { uuid }) => {
+            const process = getProcess(uuid)(resources);
+            return process
+                ? [...subprocesses, process]
+                : subprocesses;
+        }, []);
+    }
+    return [];
 };
 
 export const getProcessStatus = (process: Process) =>
@@ -42,6 +46,6 @@ export const getProcessStatus = (process: Process) =>
         ? process.container.state
         : process.containerRequest.state;
 
-const isSubprocess = (uuid: string) => (resource: Resource) =>
+const isSubprocess = (containerUuid: string) => (resource: Resource) =>
     resource.kind === ResourceKind.CONTAINER_REQUEST
-    && (resource as ContainerRequestResource).requestingContainerUuid === uuid;
+    && (resource as ContainerRequestResource).requestingContainerUuid === containerUuid;
diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index d667517..be9266b 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -9,20 +9,21 @@ import { updateResources } from '~/store/resources/resources-actions';
 import { FilterBuilder } from '~/common/api/filter-builder';
 import { ContainerRequestResource } from '../../models/container-request';
 
-export const loadProcess = (uuid: string) =>
+export const loadProcess = (containerRequestUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const containerRequest = await services.containerRequestService.get(uuid);
+        const containerRequest = await services.containerRequestService.get(containerRequestUuid);
         dispatch<any>(updateResources([containerRequest]));
         if (containerRequest.containerUuid) {
             const container = await services.containerService.get(containerRequest.containerUuid);
             dispatch<any>(updateResources([container]));
+            await dispatch<any>(loadSubprocesses(containerRequest.containerUuid));
         }
     };
 
-export const loadSubprocesses = (uuid: string) =>
+export const loadSubprocesses = (containerUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         const containerRequests = await dispatch<any>(loadContainerRequests(
-            new FilterBuilder().addEqual('requestingContainerUuid', uuid).getFilters()
+            new FilterBuilder().addEqual('requestingContainerUuid', containerUuid).getFilters()
         )) as ContainerRequestResource[];
 
         const containerUuids: string[] = containerRequests.reduce((uuids, { containerUuid }) =>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list