From d9ca0c62cb1d45df5c27dee5b9d896a3a9c423b3 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Thu, 11 Mar 2021 12:37:39 -0500 Subject: [PATCH] 17119: the "Move to" dialog should not show filter groups as a potential destination. Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- src/store/tree-picker/tree-picker-actions.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts index d11f7527..5d12b419 100644 --- a/src/store/tree-picker/tree-picker-actions.ts +++ b/src/store/tree-picker/tree-picker-actions.ts @@ -21,7 +21,7 @@ import { mapTree } from '../../models/tree'; import { LinkResource, LinkClass } from "~/models/link"; import { mapTreeValues } from "~/models/tree"; import { sortFilesTree } from "~/services/collection-service/collection-service-files-response"; -import { GroupResource } from "~/models/group"; +import { GroupClass, GroupResource } from "~/models/group"; export const treePickerActions = unionize({ LOAD_TREE_PICKER_NODE: ofType<{ id: string, pickerId: string }>(), @@ -101,11 +101,12 @@ interface LoadProjectParams { pickerId: string; includeCollections?: boolean; includeFiles?: boolean; + includeFilterGroups?: boolean; loadShared?: boolean; } export const loadProject = (params: LoadProjectParams) => async (dispatch: Dispatch, _: () => RootState, services: ServiceRepository) => { - const { id, pickerId, includeCollections = false, includeFiles = false, loadShared = false } = params; + const { id, pickerId, includeCollections = false, includeFiles = false, includeFilterGroups = false, loadShared = false } = params; dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id, pickerId })); @@ -121,7 +122,12 @@ export const loadProject = (params: LoadProjectParams) => dispatch(receiveTreePickerData({ id, pickerId, - data: items, + data: items.filter((item) => { + if (!includeFilterGroups && (item as GroupResource).groupClass && (item as GroupResource).groupClass === GroupClass.FILTER) { + return false; + } + return true; + }), extractNodeData: item => ({ id: item.uuid, value: item, -- 2.30.2