[ARVADOS-WORKBENCH2] updated: 1.2.0-225-g3eeb63c

Git user git at public.curoverse.com
Sun Sep 2 14:55:46 EDT 2018


Summary of changes:
 src/store/trash/trash-actions.ts | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

       via  3eeb63ce55c9156f96f933a0cff5eab3dab86392 (commit)
      from  9cb78f72cfe7da0fd3e04609f13d5f930a76a2f1 (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 3eeb63ce55c9156f96f933a0cff5eab3dab86392
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Sun Sep 2 20:55:39 2018 +0200

    Fix calling correct actions after trash/untrash
    
    Feature #13828
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/trash/trash-actions.ts b/src/store/trash/trash-actions.ts
index d102f24..34d034a 100644
--- a/src/store/trash/trash-actions.ts
+++ b/src/store/trash/trash-actions.ts
@@ -7,18 +7,15 @@ import { RootState } from "~/store/store";
 import { ServiceRepository } from "~/services/services";
 import { snackbarActions } from "~/store/snackbar/snackbar-actions";
 import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
-import { reloadProjectMatchingUuid } from "~/store/workbench/workbench-actions";
+import { activateSidePanelTreeItem, loadSidePanelTreeProjects } from "~/store/side-panel-tree/side-panel-tree-actions";
+import { projectPanelActions } from "~/store/project-panel/project-panel-action";
 
 export const toggleProjectTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
-        dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
         if (resource.isTrashed) {
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash..." }));
             return services.groupsService.untrash(resource.uuid).then(() => {
-                dispatch<any>(reloadProjectMatchingUuid([resource.uuid]));
-                // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
-                //     dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
-                //     dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
-                // });
+                dispatch<any>(activateSidePanelTreeItem(resource.uuid));
                 dispatch(trashPanelActions.REQUEST_ITEMS());
                 dispatch(snackbarActions.CLOSE_SNACKBAR());
                 dispatch(snackbarActions.OPEN_SNACKBAR({
@@ -27,11 +24,9 @@ export const toggleProjectTrashed = (resource: { uuid: string; name: string, isT
                 }));
             });
         } else {
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash..." }));
             return services.groupsService.trash(resource.uuid).then(() => {
-                dispatch<any>(reloadProjectMatchingUuid([resource.uuid]));
-                // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
-                //     dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
-                // });
+                dispatch<any>(loadSidePanelTreeProjects(resource.ownerUuid!!));
                 dispatch(snackbarActions.CLOSE_SNACKBAR());
                 dispatch(snackbarActions.OPEN_SNACKBAR({
                     message: "Added to trash",
@@ -43,24 +38,19 @@ export const toggleProjectTrashed = (resource: { uuid: string; name: string, isT
 
 export const toggleCollectionTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
-        dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
         if (resource.isTrashed) {
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash..." }));
             return services.collectionService.untrash(resource.uuid).then(() => {
-                dispatch<any>(reloadProjectMatchingUuid([resource.uuid]));
-                // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
-                //     dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
-                //     dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
-                // });
                 dispatch(trashPanelActions.REQUEST_ITEMS());
-                dispatch(snackbarActions.CLOSE_SNACKBAR());
                 dispatch(snackbarActions.OPEN_SNACKBAR({
                     message: "Restored from trash",
                     hideDuration: 2000
                 }));
             });
         } else {
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash..." }));
             return services.collectionService.trash(resource.uuid).then(() => {
-                dispatch(snackbarActions.CLOSE_SNACKBAR());
+                dispatch(projectPanelActions.REQUEST_ITEMS());
                 dispatch(snackbarActions.OPEN_SNACKBAR({
                     message: "Added to trash",
                     hideDuration: 2000

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list