[ARVADOS-WORKBENCH2] updated: 1.2.0-227-g7792c52

Git user git at public.curoverse.com
Mon Sep 3 07:06:25 EDT 2018


Summary of changes:
 .../trash-panel/trash-panel-middleware-service.ts  | 58 +++++++++++-----------
 1 file changed, 28 insertions(+), 30 deletions(-)

       via  7792c5200c3144fcc75e102f2aeaf4862252ec8e (commit)
      from  46f597da5c34d80250cc7efd87d2ce087528ed5f (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 7792c5200c3144fcc75e102f2aeaf4862252ec8e
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Mon Sep 3 13:06:22 2018 +0200

    CR fixes II
    
    Feature #13828
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/trash-panel/trash-panel-middleware-service.ts b/src/store/trash-panel/trash-panel-middleware-service.ts
index d81b1b0..90a8b19 100644
--- a/src/store/trash-panel/trash-panel-middleware-service.ts
+++ b/src/store/trash-panel/trash-panel-middleware-service.ts
@@ -14,13 +14,12 @@ import { FilterBuilder } from "~/common/api/filter-builder";
 import { trashPanelActions } from "./trash-panel-action";
 import { Dispatch, MiddlewareAPI } from "redux";
 import { OrderBuilder, OrderDirection } from "~/common/api/order-builder";
-import { GroupContentsResource, GroupContentsResourcePrefix } from "~/services/groups-service/groups-service";
+import { GroupContentsResourcePrefix } from "~/services/groups-service/groups-service";
 import { TrashPanelColumnNames, TrashPanelFilter } from "~/views/trash-panel/trash-panel";
 import { ProjectResource } from "~/models/project";
 import { ProjectPanelColumnNames } from "~/views/project-panel/project-panel";
 import { updateFavorites } from "~/store/favorites/favorites-actions";
 import { TrashResource } from "~/models/resource";
-import { ListResults } from "~/common/api/common-resource-service";
 import { snackbarActions } from "~/store/snackbar/snackbar-actions";
 import { updateResources } from "~/store/resources/resources-actions";
 
@@ -29,7 +28,7 @@ export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
         super(id);
     }
 
-    requestItems(api: MiddlewareAPI<Dispatch, RootState>) {
+    async requestItems(api: MiddlewareAPI<Dispatch, RootState>) {
         const dataExplorer = api.getState().dataExplorer[this.getId()];
         const columns = dataExplorer.columns as DataColumns<string, TrashPanelFilter>;
         const sortColumn = dataExplorer.columns.find(c => c.sortDirection !== SortDirection.NONE);
@@ -48,35 +47,34 @@ export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
                 .addOrder(sortDirection, columnName, GroupContentsResourcePrefix.PROJECT);
         }
 
-        const userUuid = this.services.authService.getUuid()!;
+        try {
+            const userUuid = this.services.authService.getUuid()!;
+            const listResults = await this.services.groupsService
+                .contents(userUuid, {
+                    ...dataExplorerToListParams(dataExplorer),
+                    order: order.getOrder(),
+                    filters: new FilterBuilder()
+                        .addIsA("uuid", typeFilters.map(f => f.type))
+                        .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.COLLECTION)
+                        .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROJECT)
+                        .getFilters(),
+                    recursive: true,
+                    includeTrash: true
+                });
 
-        this.services.groupsService
-            .contents(userUuid, {
-                ...dataExplorerToListParams(dataExplorer),
-                order: order.getOrder(),
-                filters: new FilterBuilder()
-                    .addIsA("uuid", typeFilters.map(f => f.type))
-                    .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.COLLECTION)
-                    .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROJECT)
-                    .getFilters(),
-                recursive: true,
-                includeTrash: true
-            })
-            .then((listResults: ListResults<GroupContentsResource>) => {
-                const items = listResults.items
-                    .filter(it => (it as TrashResource).isTrashed)
-                    .map(it => it.uuid);
+            const items = listResults.items
+                .filter(it => (it as TrashResource).isTrashed)
+                .map(it => it.uuid);
 
-                api.dispatch(trashPanelActions.SET_ITEMS({
-                    ...listResultsToDataExplorerItemsMeta(listResults),
-                    items
-                }));
-                api.dispatch<any>(updateFavorites(items));
-                api.dispatch(updateResources(listResults.items));
-            })
-            .catch(() => {
-                api.dispatch(couldNotFetchTrashContents());
-            });
+            api.dispatch(trashPanelActions.SET_ITEMS({
+                ...listResultsToDataExplorerItemsMeta(listResults),
+                items
+            }));
+            api.dispatch<any>(updateFavorites(items));
+            api.dispatch(updateResources(listResults.items));
+        } catch (e) {
+            api.dispatch(couldNotFetchTrashContents());
+        }
     }
 }
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list