From: Ward Vandewege Date: Thu, 11 Mar 2021 17:37:39 +0000 (-0500) Subject: 17119: the "Move to" dialog should not show filter groups as a potential X-Git-Tag: 2.1.2.1~7^2~12 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/d9ca0c62cb1d45df5c27dee5b9d896a3a9c423b3 17119: the "Move to" dialog should not show filter groups as a potential destination. Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- 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,