[arvados-workbench2] updated: 2.5.0-19-gda1b362f

git repository hosting git at public.arvados.org
Wed Feb 1 18:02:29 UTC 2023


Summary of changes:
 src/store/processes/processes-actions.ts | 38 +++++++++++++++++++++++---------
 src/store/workbench/workbench-actions.ts | 12 +++++-----
 2 files changed, 34 insertions(+), 16 deletions(-)

       via  da1b362fc33261ace42851f6900df7b96fde819e (commit)
       via  38db7657138744ed97b924bc3396a1ec00de9be3 (commit)
       via  153c4516226560081abd11aed9dea421971595b4 (commit)
       via  be74aae5535a64c58d408d0345b0aae94758f983 (commit)
      from  aa48015966dd61d462f43a1a336b1700c78624aa (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 da1b362fc33261ace42851f6900df7b96fde819e
Merge: aa480159 38db7657
Author: Stephen Smith <stephen at curii.com>
Date:   Wed Feb 1 13:02:01 2023 -0500

    Merge branch '19900-process-404-handling' into main. Closes #19900
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --cc src/store/workbench/workbench-actions.ts
index b2da727b,761ffb75..cf00ed18
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@@ -269,419 -269,421 +269,421 @@@ 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));
 -    if (process) {
 -      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));
-         await dispatch<any>(
-             activateSidePanelTreeItem(process.containerRequest.ownerUuid)
-         );
-         dispatch<any>(setProcessBreadcrumbs(uuid));
-         dispatch<any>(loadDetailsPanel(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,
 -        })
 -      );
 -    } 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,
 +                    })
 +                );
 +            } 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