[arvados-workbench2] updated: 2.5.0-45-gf75b0aa3

git repository hosting git at public.arvados.org
Fri Feb 10 19:59:23 UTC 2023


Summary of changes:
 cypress/integration/group-manage.spec.js           |  29 ++
 cypress/integration/process.spec.js                |  29 ++
 src/components/icon/icon.tsx                       |   5 +-
 src/models/container-request.ts                    |   2 +
 src/store/processes/process-copy-actions.test.ts   | 483 +++++++++++++++++++++
 src/store/processes/process-copy-actions.ts        |  49 ++-
 src/store/processes/processes-actions.ts           |  17 +-
 .../subprocess-panel-middleware-service.ts         |  21 +-
 src/store/workbench/workbench-actions.ts           |   1 +
 .../action-sets/process-resource-action-set.ts     |  20 +-
 .../{dialog-copy.tsx => dialog-process-rerun.tsx}  |   6 +-
 .../dialog-forms/copy-process-dialog.ts            |   4 +-
 .../projects-tree-picker/tree-picker-field.tsx     |   4 +-
 src/views/process-panel/process-details-card.tsx   |  27 +-
 src/views/process-panel/process-panel-root.tsx     |   2 +
 src/views/process-panel/process-panel.tsx          |   3 +-
 16 files changed, 658 insertions(+), 44 deletions(-)
 create mode 100644 src/store/processes/process-copy-actions.test.ts
 copy src/views-components/dialog-copy/{dialog-copy.tsx => dialog-process-rerun.tsx} (84%)

       via  f75b0aa3966895160535bad24b05c1a763665a5a (commit)
       via  79f55f622c5addb5351c9cc4d5976cf936fb7143 (commit)
       via  9da989ef41a759b7bb1b70f19086e5fa9db4ca7a (commit)
       via  224205c0f1a11158a9b46b4df20fe321a6a2c2f7 (commit)
       via  56529b81cf7b67cfea510652f07e1778cc82922e (commit)
       via  33a742eb6cc4c7a7f3c21e9fd91618a6012f68eb (commit)
       via  4fe775d9c7be35da39f86528296954518fca760e (commit)
       via  d8ca0a7e17696ed74b3da26323ef88254783c20c (commit)
       via  b6ade0ccdd981765e52b6bcd66a52cc228525fd0 (commit)
       via  b114600c55e53b4c16f091edbabdb2ebeba0f032 (commit)
       via  92e3372adb6408ace8fac8f3c78cdc1e20f4b26b (commit)
       via  78aad86df4f113422f97632dd81a3a192a1a30ca (commit)
       via  2cf3bd105cc73835f4c634a67ce73ede8adca597 (commit)
       via  2b6abd3b7dea25f9b19156bb06b2763b118a67b5 (commit)
      from  5d0a856e201bd7c317dfaa283fd83c1e319ee035 (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 f75b0aa3966895160535bad24b05c1a763665a5a
Merge: 5d0a856e 79f55f62
Author: Stephen Smith <stephen at curii.com>
Date:   Fri Feb 10 14:58:58 2023 -0500

    Merge branch '15557-rerun-workflow' into main. Closes #15557
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --cc src/store/processes/processes-actions.ts
index 305a4e7c,517e6451..815d6aec
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@@ -21,24 -21,16 +21,24 @@@ import { CommandInputParameter, getWork
  import { ProjectResource } from "models/project";
  import { UserResource } from "models/user";
  import { CommandOutputParameter } from "cwlts/mappings/v1.0/CommandOutputParameter";
 -import { ContainerRequestState } from "models/container-request";
 +import { ContainerResource } from "models/container";
- import { ContainerRequestResource } from "models/container-request";
++import { ContainerRequestResource, ContainerRequestState } from "models/container-request";
  
  export const loadProcess = (containerRequestUuid: string) =>
 -    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<Process> => {
 -        const containerRequest = await services.containerRequestService.get(containerRequestUuid);
 -        dispatch<any>(updateResources([containerRequest]));
 +    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<Process | undefined> => {
 +        let containerRequest: ContainerRequestResource | undefined = undefined;
 +        try {
 +            containerRequest = await services.containerRequestService.get(containerRequestUuid);
 +            dispatch<any>(updateResources([containerRequest]));
 +        } catch {
 +            return undefined;
 +        }
  
          if (containerRequest.outputUuid) {
 -            const collection = await services.collectionService.get(containerRequest.outputUuid);
 -            dispatch<any>(updateResources([collection]));
 +            try {
 +                const collection = await services.collectionService.get(containerRequest.outputUuid, false);
 +                dispatch<any>(updateResources([collection]));
 +            } catch {}
          }
  
          if (containerRequest.containerUuid) {
diff --cc src/store/workbench/workbench-actions.ts
index cf00ed18,da5b847b..1cf71706
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@@ -269,421 -269,420 +269,422 @@@ export const loadCollectionContentAddre
  );
  
  export const loadTrash = () =>
 -  handleFirstTimeLoad((dispatch: Dispatch) => {
 -    dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
 -    dispatch<any>(loadTrashPanel());
 -    dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
 -  });
 +    handleFirstTimeLoad((dispatch: Dispatch) => {
 +        dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
 +        dispatch<any>(loadTrashPanel());
 +        dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
 +    });
  
  export const loadAllProcesses = () =>
 -  handleFirstTimeLoad((dispatch: Dispatch) => {
 -    dispatch<any>(
 -      activateSidePanelTreeItem(SidePanelTreeCategory.ALL_PROCESSES)
 -    );
 -    dispatch<any>(loadAllProcessesPanel());
 -    dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.ALL_PROCESSES));
 -  });
 +    handleFirstTimeLoad((dispatch: Dispatch) => {
 +        dispatch<any>(
 +            activateSidePanelTreeItem(SidePanelTreeCategory.ALL_PROCESSES)
 +        );
 +        dispatch<any>(loadAllProcessesPanel());
 +        dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.ALL_PROCESSES));
 +    });
  
  export const loadProject = (uuid: string) =>
 -  handleFirstTimeLoad(
 -    async (
 -      dispatch: Dispatch<any>,
 -      getState: () => RootState,
 -      services: ServiceRepository
 -    ) => {
 -      const userUuid = getUserUuid(getState());
 -      dispatch(setIsProjectPanelTrashed(false));
 -      if (!userUuid) {
 -        return;
 -      }
 -      if (extractUuidKind(uuid) === ResourceKind.USER && userUuid !== uuid) {
 -        // Load another users home projects
 -        dispatch(finishLoadingProject(uuid));
 -      } else if (userUuid !== uuid) {
 -        await dispatch(finishLoadingProject(uuid));
 -        const match = await loadGroupContentsResource({
 -          uuid,
 -          userUuid,
 -          services,
 -        });
 -        match({
 -          OWNED: async () => {
 -            await dispatch(activateSidePanelTreeItem(uuid));
 -            dispatch<any>(setSidePanelBreadcrumbs(uuid));
 -          },
 -          SHARED: async () => {
 -            await dispatch(activateSidePanelTreeItem(uuid));
 -            dispatch<any>(setSharedWithMeBreadcrumbs(uuid));
 -          },
 -          TRASHED: async () => {
 -            await dispatch(
 -              activateSidePanelTreeItem(SidePanelTreeCategory.TRASH)
 -            );
 -            dispatch<any>(setTrashBreadcrumbs(uuid));
 -            dispatch(setIsProjectPanelTrashed(true));
 -          },
 -        });
 -      } else {
 -        await dispatch(finishLoadingProject(userUuid));
 -        await dispatch(activateSidePanelTreeItem(userUuid));
 -        dispatch<any>(setSidePanelBreadcrumbs(userUuid));
 -      }
 -    }
 -  );
 +    handleFirstTimeLoad(
 +        async (
 +            dispatch: Dispatch<any>,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            const userUuid = getUserUuid(getState());
 +            dispatch(setIsProjectPanelTrashed(false));
 +            if (!userUuid) {
 +                return;
 +            }
 +            if (extractUuidKind(uuid) === ResourceKind.USER && userUuid !== uuid) {
 +                // Load another users home projects
 +                dispatch(finishLoadingProject(uuid));
 +            } else if (userUuid !== uuid) {
 +                await dispatch(finishLoadingProject(uuid));
 +                const match = await loadGroupContentsResource({
 +                    uuid,
 +                    userUuid,
 +                    services,
 +                });
 +                match({
 +                    OWNED: async () => {
 +                        await dispatch(activateSidePanelTreeItem(uuid));
 +                        dispatch<any>(setSidePanelBreadcrumbs(uuid));
 +                    },
 +                    SHARED: async () => {
 +                        await dispatch(activateSidePanelTreeItem(uuid));
 +                        dispatch<any>(setSharedWithMeBreadcrumbs(uuid));
 +                    },
 +                    TRASHED: async () => {
 +                        await dispatch(
 +                            activateSidePanelTreeItem(SidePanelTreeCategory.TRASH)
 +                        );
 +                        dispatch<any>(setTrashBreadcrumbs(uuid));
 +                        dispatch(setIsProjectPanelTrashed(true));
 +                    },
 +                });
 +            } else {
 +                await dispatch(finishLoadingProject(userUuid));
 +                await dispatch(activateSidePanelTreeItem(userUuid));
 +                dispatch<any>(setSidePanelBreadcrumbs(userUuid));
 +            }
 +        }
 +    );
  
  export const createProject =
 -  (data: projectCreateActions.ProjectCreateFormDialogData) =>
 -  async (dispatch: Dispatch) => {
 -    const newProject = await dispatch<any>(
 -      projectCreateActions.createProject(data)
 -    );
 -    if (newProject) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Project has been successfully created.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -      await dispatch<any>(loadSidePanelTreeProjects(newProject.ownerUuid));
 -      dispatch<any>(navigateTo(newProject.uuid));
 -    }
 -  };
 +    (data: projectCreateActions.ProjectCreateFormDialogData) =>
 +        async (dispatch: Dispatch) => {
 +            const newProject = await dispatch<any>(
 +                projectCreateActions.createProject(data)
 +            );
 +            if (newProject) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Project has been successfully created.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +                await dispatch<any>(loadSidePanelTreeProjects(newProject.ownerUuid));
 +                dispatch<any>(navigateTo(newProject.uuid));
 +            }
 +        };
  
  export const moveProject =
 -  (data: MoveToFormDialogData) =>
 -  async (
 -    dispatch: Dispatch,
 -    getState: () => RootState,
 -    services: ServiceRepository
 -  ) => {
 -    try {
 -      const oldProject = getResource(data.uuid)(getState().resources);
 -      const oldOwnerUuid = oldProject ? oldProject.ownerUuid : '';
 -      const movedProject = await dispatch<any>(
 -        projectMoveActions.moveProject(data)
 -      );
 -      if (movedProject) {
 -        dispatch(
 -          snackbarActions.OPEN_SNACKBAR({
 -            message: 'Project has been moved',
 -            hideDuration: 2000,
 -            kind: SnackbarKind.SUCCESS,
 -          })
 -        );
 -        if (oldProject) {
 -          await dispatch<any>(loadSidePanelTreeProjects(oldProject.ownerUuid));
 -        }
 -        dispatch<any>(
 -          reloadProjectMatchingUuid([
 -            oldOwnerUuid,
 -            movedProject.ownerUuid,
 -            movedProject.uuid,
 -          ])
 -        );
 -      }
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: MoveToFormDialogData) =>
 +        async (
 +            dispatch: Dispatch,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            try {
 +                const oldProject = getResource(data.uuid)(getState().resources);
 +                const oldOwnerUuid = oldProject ? oldProject.ownerUuid : '';
 +                const movedProject = await dispatch<any>(
 +                    projectMoveActions.moveProject(data)
 +                );
 +                if (movedProject) {
 +                    dispatch(
 +                        snackbarActions.OPEN_SNACKBAR({
 +                            message: 'Project has been moved',
 +                            hideDuration: 2000,
 +                            kind: SnackbarKind.SUCCESS,
 +                        })
 +                    );
 +                    if (oldProject) {
 +                        await dispatch<any>(loadSidePanelTreeProjects(oldProject.ownerUuid));
 +                    }
 +                    dispatch<any>(
 +                        reloadProjectMatchingUuid([
 +                            oldOwnerUuid,
 +                            movedProject.ownerUuid,
 +                            movedProject.uuid,
 +                        ])
 +                    );
 +                }
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const updateProject =
 -  (data: projectUpdateActions.ProjectUpdateFormDialogData) =>
 -  async (dispatch: Dispatch) => {
 -    const updatedProject = await dispatch<any>(
 -      projectUpdateActions.updateProject(data)
 -    );
 -    if (updatedProject) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Project has been successfully updated.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -      await dispatch<any>(loadSidePanelTreeProjects(updatedProject.ownerUuid));
 -      dispatch<any>(
 -        reloadProjectMatchingUuid([
 -          updatedProject.ownerUuid,
 -          updatedProject.uuid,
 -        ])
 -      );
 -    }
 -  };
 +    (data: projectUpdateActions.ProjectUpdateFormDialogData) =>
 +        async (dispatch: Dispatch) => {
 +            const updatedProject = await dispatch<any>(
 +                projectUpdateActions.updateProject(data)
 +            );
 +            if (updatedProject) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Project has been successfully updated.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +                await dispatch<any>(loadSidePanelTreeProjects(updatedProject.ownerUuid));
 +                dispatch<any>(
 +                    reloadProjectMatchingUuid([
 +                        updatedProject.ownerUuid,
 +                        updatedProject.uuid,
 +                    ])
 +                );
 +            }
 +        };
  
  export const updateGroup =
 -  (data: projectUpdateActions.ProjectUpdateFormDialogData) =>
 -  async (dispatch: Dispatch) => {
 -    const updatedGroup = await dispatch<any>(
 -      groupPanelActions.updateGroup(data)
 -    );
 -    if (updatedGroup) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Group has been successfully updated.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -      await dispatch<any>(loadSidePanelTreeProjects(updatedGroup.ownerUuid));
 -      dispatch<any>(
 -        reloadProjectMatchingUuid([updatedGroup.ownerUuid, updatedGroup.uuid])
 -      );
 -    }
 -  };
 +    (data: projectUpdateActions.ProjectUpdateFormDialogData) =>
 +        async (dispatch: Dispatch) => {
 +            const updatedGroup = await dispatch<any>(
 +                groupPanelActions.updateGroup(data)
 +            );
 +            if (updatedGroup) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Group has been successfully updated.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +                await dispatch<any>(loadSidePanelTreeProjects(updatedGroup.ownerUuid));
 +                dispatch<any>(
 +                    reloadProjectMatchingUuid([updatedGroup.ownerUuid, updatedGroup.uuid])
 +                );
 +            }
 +        };
  
  export const loadCollection = (uuid: string) =>
 -  handleFirstTimeLoad(
 -    async (
 -      dispatch: Dispatch<any>,
 -      getState: () => RootState,
 -      services: ServiceRepository
 -    ) => {
 -      const userUuid = getUserUuid(getState());
 -      if (userUuid) {
 -        const match = await loadGroupContentsResource({
 -          uuid,
 -          userUuid,
 -          services,
 -        });
 -        match({
 -          OWNED: (collection) => {
 -            dispatch(
 -              collectionPanelActions.SET_COLLECTION(
 -                collection as CollectionResource
 -              )
 -            );
 -            dispatch(updateResources([collection]));
 -            dispatch(activateSidePanelTreeItem(collection.ownerUuid));
 -            dispatch(setSidePanelBreadcrumbs(collection.ownerUuid));
 -            dispatch(loadCollectionPanel(collection.uuid));
 -          },
 -          SHARED: (collection) => {
 -            dispatch(
 -              collectionPanelActions.SET_COLLECTION(
 -                collection as CollectionResource
 -              )
 -            );
 -            dispatch(updateResources([collection]));
 -            dispatch<any>(setSharedWithMeBreadcrumbs(collection.ownerUuid));
 -            dispatch(activateSidePanelTreeItem(collection.ownerUuid));
 -            dispatch(loadCollectionPanel(collection.uuid));
 -          },
 -          TRASHED: (collection) => {
 -            dispatch(
 -              collectionPanelActions.SET_COLLECTION(
 -                collection as CollectionResource
 -              )
 -            );
 -            dispatch(updateResources([collection]));
 -            dispatch(setTrashBreadcrumbs(''));
 -            dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
 -            dispatch(loadCollectionPanel(collection.uuid));
 -          },
 -        });
 -      }
 -    }
 -  );
 +    handleFirstTimeLoad(
 +        async (
 +            dispatch: Dispatch<any>,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            const userUuid = getUserUuid(getState());
 +            if (userUuid) {
 +                const match = await loadGroupContentsResource({
 +                    uuid,
 +                    userUuid,
 +                    services,
 +                });
 +                match({
 +                    OWNED: (collection) => {
 +                        dispatch(
 +                            collectionPanelActions.SET_COLLECTION(
 +                                collection as CollectionResource
 +                            )
 +                        );
 +                        dispatch(updateResources([collection]));
 +                        dispatch(activateSidePanelTreeItem(collection.ownerUuid));
 +                        dispatch(setSidePanelBreadcrumbs(collection.ownerUuid));
 +                        dispatch(loadCollectionPanel(collection.uuid));
 +                    },
 +                    SHARED: (collection) => {
 +                        dispatch(
 +                            collectionPanelActions.SET_COLLECTION(
 +                                collection as CollectionResource
 +                            )
 +                        );
 +                        dispatch(updateResources([collection]));
 +                        dispatch<any>(setSharedWithMeBreadcrumbs(collection.ownerUuid));
 +                        dispatch(activateSidePanelTreeItem(collection.ownerUuid));
 +                        dispatch(loadCollectionPanel(collection.uuid));
 +                    },
 +                    TRASHED: (collection) => {
 +                        dispatch(
 +                            collectionPanelActions.SET_COLLECTION(
 +                                collection as CollectionResource
 +                            )
 +                        );
 +                        dispatch(updateResources([collection]));
 +                        dispatch(setTrashBreadcrumbs(''));
 +                        dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
 +                        dispatch(loadCollectionPanel(collection.uuid));
 +                    },
 +                });
 +            }
 +        }
 +    );
  
  export const createCollection =
 -  (data: collectionCreateActions.CollectionCreateFormDialogData) =>
 -  async (dispatch: Dispatch) => {
 -    const collection = await dispatch<any>(
 -      collectionCreateActions.createCollection(data)
 -    );
 -    if (collection) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Collection has been successfully created.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -      dispatch<any>(updateResources([collection]));
 -      dispatch<any>(navigateTo(collection.uuid));
 -    }
 -  };
 +    (data: collectionCreateActions.CollectionCreateFormDialogData) =>
 +        async (dispatch: Dispatch) => {
 +            const collection = await dispatch<any>(
 +                collectionCreateActions.createCollection(data)
 +            );
 +            if (collection) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Collection has been successfully created.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +                dispatch<any>(updateResources([collection]));
 +                dispatch<any>(navigateTo(collection.uuid));
 +            }
 +        };
  
  export const copyCollection =
 -  (data: CopyFormDialogData) =>
 -  async (
 -    dispatch: Dispatch,
 -    getState: () => RootState,
 -    services: ServiceRepository
 -  ) => {
 -    try {
 -      const copyToProject = getResource(data.ownerUuid)(getState().resources);
 -      const collection = await dispatch<any>(
 -        collectionCopyActions.copyCollection(data)
 -      );
 -      if (copyToProject && collection) {
 -        dispatch<any>(reloadProjectMatchingUuid([copyToProject.uuid]));
 -        dispatch(
 -          snackbarActions.OPEN_SNACKBAR({
 -            message: 'Collection has been copied.',
 -            hideDuration: 3000,
 -            kind: SnackbarKind.SUCCESS,
 -            link: collection.ownerUuid,
 -          })
 -        );
 -      }
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: CopyFormDialogData) =>
 +        async (
 +            dispatch: Dispatch,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            try {
 +                const copyToProject = getResource(data.ownerUuid)(getState().resources);
 +                const collection = await dispatch<any>(
 +                    collectionCopyActions.copyCollection(data)
 +                );
 +                if (copyToProject && collection) {
 +                    dispatch<any>(reloadProjectMatchingUuid([copyToProject.uuid]));
 +                    dispatch(
 +                        snackbarActions.OPEN_SNACKBAR({
 +                            message: 'Collection has been copied.',
 +                            hideDuration: 3000,
 +                            kind: SnackbarKind.SUCCESS,
 +                            link: collection.ownerUuid,
 +                        })
 +                    );
 +                }
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const moveCollection =
 -  (data: MoveToFormDialogData) =>
 -  async (
 -    dispatch: Dispatch,
 -    getState: () => RootState,
 -    services: ServiceRepository
 -  ) => {
 -    try {
 -      const collection = await dispatch<any>(
 -        collectionMoveActions.moveCollection(data)
 -      );
 -      dispatch<any>(updateResources([collection]));
 -      dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Collection has been moved.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: MoveToFormDialogData) =>
 +        async (
 +            dispatch: Dispatch,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            try {
 +                const collection = await dispatch<any>(
 +                    collectionMoveActions.moveCollection(data)
 +                );
 +                dispatch<any>(updateResources([collection]));
 +                dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Collection has been moved.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const loadProcess = (uuid: string) =>
 -  handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState) => {
 -    dispatch<any>(loadProcessPanel(uuid));
 -    const process = await dispatch<any>(processesActions.loadProcess(uuid));
 -    await dispatch<any>(
 -      activateSidePanelTreeItem(process.containerRequest.ownerUuid)
 -    );
 -    dispatch<any>(setProcessBreadcrumbs(uuid));
 -    dispatch<any>(loadDetailsPanel(uuid));
 -  });
 +    handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState) => {
 +        dispatch<any>(loadProcessPanel(uuid));
 +        const process = await dispatch<any>(processesActions.loadProcess(uuid));
 +        if (process) {
 +            await dispatch<any>(
 +                activateSidePanelTreeItem(process.containerRequest.ownerUuid)
 +            );
 +            dispatch<any>(setProcessBreadcrumbs(uuid));
 +            dispatch<any>(loadDetailsPanel(uuid));
 +        }
 +    });
  
  export const updateProcess =
 -  (data: processUpdateActions.ProcessUpdateFormDialogData) =>
 -  async (dispatch: Dispatch) => {
 -    try {
 -      const process = await dispatch<any>(
 -        processUpdateActions.updateProcess(data)
 -      );
 -      if (process) {
 -        dispatch(
 -          snackbarActions.OPEN_SNACKBAR({
 -            message: 'Process has been successfully updated.',
 -            hideDuration: 2000,
 -            kind: SnackbarKind.SUCCESS,
 -          })
 -        );
 -        dispatch<any>(updateResources([process]));
 -        dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 -      }
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: processUpdateActions.ProcessUpdateFormDialogData) =>
 +        async (dispatch: Dispatch) => {
 +            try {
 +                const process = await dispatch<any>(
 +                    processUpdateActions.updateProcess(data)
 +                );
 +                if (process) {
 +                    dispatch(
 +                        snackbarActions.OPEN_SNACKBAR({
 +                            message: 'Process has been successfully updated.',
 +                            hideDuration: 2000,
 +                            kind: SnackbarKind.SUCCESS,
 +                        })
 +                    );
 +                    dispatch<any>(updateResources([process]));
 +                    dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 +                }
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const moveProcess =
 -  (data: MoveToFormDialogData) =>
 -  async (
 -    dispatch: Dispatch,
 -    getState: () => RootState,
 -    services: ServiceRepository
 -  ) => {
 -    try {
 -      const process = await dispatch<any>(processMoveActions.moveProcess(data));
 -      dispatch<any>(updateResources([process]));
 -      dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Process has been moved.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: MoveToFormDialogData) =>
 +        async (
 +            dispatch: Dispatch,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            try {
 +                const process = await dispatch<any>(processMoveActions.moveProcess(data));
 +                dispatch<any>(updateResources([process]));
 +                dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Process has been moved.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const copyProcess =
 -  (data: CopyFormDialogData) =>
 -  async (
 -    dispatch: Dispatch,
 -    getState: () => RootState,
 -    services: ServiceRepository
 -  ) => {
 -    try {
 -      const process = await dispatch<any>(processCopyActions.copyProcess(data));
 -      dispatch<any>(updateResources([process]));
 -      dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: 'Process has been copied.',
 -          hideDuration: 2000,
 -          kind: SnackbarKind.SUCCESS,
 -        })
 -      );
 -      dispatch<any>(navigateTo(process.uuid));
 -    } catch (e) {
 -      dispatch(
 -        snackbarActions.OPEN_SNACKBAR({
 -          message: e.message,
 -          hideDuration: 2000,
 -          kind: SnackbarKind.ERROR,
 -        })
 -      );
 -    }
 -  };
 +    (data: CopyFormDialogData) =>
 +        async (
 +            dispatch: Dispatch,
 +            getState: () => RootState,
 +            services: ServiceRepository
 +        ) => {
 +            try {
 +                const process = await dispatch<any>(processCopyActions.copyProcess(data));
 +                dispatch<any>(updateResources([process]));
 +                dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: 'Process has been copied.',
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.SUCCESS,
 +                    })
 +                );
++                dispatch<any>(navigateTo(process.uuid));
 +            } catch (e) {
 +                dispatch(
 +                    snackbarActions.OPEN_SNACKBAR({
 +                        message: e.message,
 +                        hideDuration: 2000,
 +                        kind: SnackbarKind.ERROR,
 +                    })
 +                );
 +            }
 +        };
  
  export const resourceIsNotLoaded = (uuid: string) =>
 -  snackbarActions.OPEN_SNACKBAR({
 -    message: `Resource identified by ${uuid} is not loaded.`,
 -    kind: SnackbarKind.ERROR,
 -  });
 +    snackbarActions.OPEN_SNACKBAR({
 +        message: `Resource identified by ${uuid} is not loaded.`,
 +        kind: SnackbarKind.ERROR,
 +    });
  
  export const userIsNotAuthenticated = snackbarActions.OPEN_SNACKBAR({
 -  message: 'User is not authenticated',
 -  kind: SnackbarKind.ERROR,
 +    message: 'User is not authenticated',
 +    kind: SnackbarKind.ERROR,
  });
  
  export const couldNotLoadUser = snackbarActions.OPEN_SNACKBAR({

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list