[ARVADOS-WORKBENCH2] updated: 1.3.0-240-gbd89dd55

Git user git at public.curoverse.com
Fri Dec 28 03:47:24 EST 2018


Summary of changes:
 src/store/data-explorer/data-explorer-action.ts            |  6 +++---
 .../data-explorer/data-explorer-middleware-service.ts      |  2 +-
 src/store/data-explorer/data-explorer-middleware.ts        | 14 +++++++-------
 .../search-results-middleware-service.ts                   |  7 +++++--
 4 files changed, 16 insertions(+), 13 deletions(-)

       via  bd89dd55a334e00cc5b4ca590687d667b896f1a0 (commit)
      from  07dc691e4fecbf365d6edf26a569f3eaffca4a76 (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 bd89dd55a334e00cc5b4ca590687d667b896f1a0
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Fri Dec 28 09:47:21 2018 +0100

    Add criteria changed flag to request items
    
    Feature #14348
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/data-explorer/data-explorer-action.ts b/src/store/data-explorer/data-explorer-action.ts
index 5bed4ac1..546ec8f3 100644
--- a/src/store/data-explorer/data-explorer-action.ts
+++ b/src/store/data-explorer/data-explorer-action.ts
@@ -9,7 +9,7 @@ import { DataTableFilters } from '~/components/data-table-filters/data-table-fil
 export const dataExplorerActions = unionize({
     CLEAR: ofType<{ id: string }>(),
     RESET_PAGINATION: ofType<{ id: string }>(),
-    REQUEST_ITEMS: ofType<{ id: string }>(),
+    REQUEST_ITEMS: ofType<{ id: string, criteriaChanged?: boolean }>(),
     SET_FETCH_MODE: ofType<({ id: string, fetchMode: DataTableFetchMode })>(),
     SET_COLUMNS: ofType<{ id: string, columns: DataColumns<any> }>(),
     SET_FILTERS: ofType<{ id: string, columnName: string, filters: DataTableFilters }>(),
@@ -29,8 +29,8 @@ export const bindDataExplorerActions = (id: string) => ({
         dataExplorerActions.CLEAR({ id }),
     RESET_PAGINATION: () =>
         dataExplorerActions.RESET_PAGINATION({ id }),
-    REQUEST_ITEMS: () =>
-        dataExplorerActions.REQUEST_ITEMS({ id }),
+    REQUEST_ITEMS: (criteriaChanged?: boolean) =>
+        dataExplorerActions.REQUEST_ITEMS({ id, criteriaChanged }),
     SET_FETCH_MODE: (payload: { fetchMode: DataTableFetchMode }) =>
         dataExplorerActions.SET_FETCH_MODE({ ...payload, id }),
     SET_COLUMNS: (payload: { columns: DataColumns<any> }) =>
diff --git a/src/store/data-explorer/data-explorer-middleware-service.ts b/src/store/data-explorer/data-explorer-middleware-service.ts
index 82ba5b4b..57fd0b59 100644
--- a/src/store/data-explorer/data-explorer-middleware-service.ts
+++ b/src/store/data-explorer/data-explorer-middleware-service.ts
@@ -25,7 +25,7 @@ export abstract class DataExplorerMiddlewareService {
         return getDataExplorerColumnFilters(columns, columnName);
     }
 
-    abstract requestItems(api: MiddlewareAPI<Dispatch, RootState>): void;
+    abstract requestItems(api: MiddlewareAPI<Dispatch, RootState>, criteriaChanged?: boolean): void;
 }
 
 export const getDataExplorerColumnFilters = <T>(columns: DataColumns<T>, columnName: string): DataTableFilters => {
diff --git a/src/store/data-explorer/data-explorer-middleware.ts b/src/store/data-explorer/data-explorer-middleware.ts
index f90f9a6c..e377f341 100644
--- a/src/store/data-explorer/data-explorer-middleware.ts
+++ b/src/store/data-explorer/data-explorer-middleware.ts
@@ -20,24 +20,24 @@ export const dataExplorerMiddleware = (service: DataExplorerMiddlewareService):
             };
         dataExplorerActions.match(action, {
             SET_PAGE: handleAction(() => {
-                api.dispatch(actions.REQUEST_ITEMS());
+                api.dispatch(actions.REQUEST_ITEMS(false));
             }),
             SET_ROWS_PER_PAGE: handleAction(() => {
-                api.dispatch(actions.REQUEST_ITEMS());
+                api.dispatch(actions.REQUEST_ITEMS(true));
             }),
             SET_FILTERS: handleAction(() => {
                 api.dispatch(actions.RESET_PAGINATION());
-                api.dispatch(actions.REQUEST_ITEMS());
+                api.dispatch(actions.REQUEST_ITEMS(true));
             }),
             TOGGLE_SORT: handleAction(() => {
-                api.dispatch(actions.REQUEST_ITEMS());
+                api.dispatch(actions.REQUEST_ITEMS(true));
             }),
             SET_EXPLORER_SEARCH_VALUE: handleAction(() => {
                 api.dispatch(actions.RESET_PAGINATION());
-                api.dispatch(actions.REQUEST_ITEMS());
+                api.dispatch(actions.REQUEST_ITEMS(true));
             }),
-            REQUEST_ITEMS: handleAction(() => {
-                service.requestItems(api);
+            REQUEST_ITEMS: handleAction(({ criteriaChanged }) => {
+                service.requestItems(api, criteriaChanged);
             }),
             default: () => next(action)
         });
diff --git a/src/store/search-results-panel/search-results-middleware-service.ts b/src/store/search-results-panel/search-results-middleware-service.ts
index dd96a024..de325222 100644
--- a/src/store/search-results-panel/search-results-middleware-service.ts
+++ b/src/store/search-results-panel/search-results-middleware-service.ts
@@ -28,7 +28,7 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
         super(id);
     }
 
-    async requestItems(api: MiddlewareAPI<Dispatch, RootState>) {
+    async requestItems(api: MiddlewareAPI<Dispatch, RootState>, criteriaChanged?: boolean) {
         const state = api.getState();
         const userUuid = state.auth.user!.uuid;
         const dataExplorer = getDataExplorer(state.dataExplorer, this.getId());
@@ -61,7 +61,10 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
             };
 
             api.dispatch(updateResources(list.items));
-            api.dispatch(appendItems(list));
+            api.dispatch(criteriaChanged
+                ? setItems(list)
+                : appendItems(list)
+            );
 
         } catch {
             api.dispatch(couldNotFetchSearchResults());

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list