[arvados-workbench2] created: 2.6.3-86-g2f6916cd

git repository hosting git at public.arvados.org
Tue Aug 22 15:21:05 UTC 2023


        at  2f6916cd8bbf45eaf4b35a7534c2e2b4433b6fb2 (commit)


commit 2f6916cd8bbf45eaf4b35a7534c2e2b4433b6fb2
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Aug 22 11:18:50 2023 -0400

    20617: Move shared-with-me filter additions to getParams
    
    Prevents accidentally overriding filters and fixes filters being ignored
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
index 56255860..2d89cccd 100644
--- a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
+++ b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
@@ -13,7 +13,6 @@ import { resourcesActions } from 'store/resources/resources-actions';
 import { FilterBuilder } from 'services/api/filter-builder';
 import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
 import { collectionsContentAddressActions } from './collections-content-address-panel-actions';
-import { navigateTo } from 'store/navigation/navigation-action';
 import { updateFavorites } from 'store/favorites/favorites-actions';
 import { updatePublicFavorites } from 'store/public-favorites/public-favorites-actions';
 import { setBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions';
diff --git a/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts b/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts
index a4197870..f2e40234 100644
--- a/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts
+++ b/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts
@@ -19,8 +19,9 @@ import { OrderBuilder, OrderDirection } from 'services/api/order-builder';
 import { ProjectResource } from 'models/project';
 import { getSortColumn } from "store/data-explorer/data-explorer-reducer";
 import { updatePublicFavorites } from 'store/public-favorites/public-favorites-actions';
-import { FilterBuilder } from 'services/api/filter-builder';
+import { FilterBuilder, joinFilters } from 'services/api/filter-builder';
 import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
+import { AuthState } from 'store/auth/auth-reducer';
 
 export class SharedWithMeMiddlewareService extends DataExplorerMiddlewareService {
     constructor(private services: ServiceRepository, id: string) {
@@ -33,11 +34,7 @@ export class SharedWithMeMiddlewareService extends DataExplorerMiddlewareService
         try {
             api.dispatch(progressIndicatorActions.START_WORKING(this.getId()));
             const response = await this.services.groupsService
-                .contents('', {
-                    ...getParams(dataExplorer),
-                    excludeHomeProject: true,
-                    filters: new FilterBuilder().addDistinct('uuid', `${state.auth.config.uuidPrefix}-j7d0g-publicfavorites`).getFilters()
-                });
+                .contents('', getParams(dataExplorer, state.auth));
             api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
             api.dispatch<any>(updatePublicFavorites(response.items.map(item => item.uuid)));
             api.dispatch(updateResources(response.items));
@@ -51,10 +48,14 @@ export class SharedWithMeMiddlewareService extends DataExplorerMiddlewareService
     }
 }
 
-export const getParams = (dataExplorer: DataExplorer) => ({
+export const getParams = (dataExplorer: DataExplorer, authState: AuthState) => ({
     ...dataExplorerToListParams(dataExplorer),
     order: getOrder(dataExplorer),
-    filters: getFilters(dataExplorer),
+    filters: joinFilters(
+        getFilters(dataExplorer),
+        new FilterBuilder().addDistinct('uuid', `${authState.config.uuidPrefix}-j7d0g-publicfavorites`).getFilters(),
+    ),
+    excludeHomeProject: true,
 });
 
 const getOrder = (dataExplorer: DataExplorer) => {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list