X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2508b089d2369bf57811f9f96c14c2ee22dd664f..db70ee7d6c518bad725f4d84ea586a3e420733fe:/services/workbench2/src/views-components/projects-tree-picker/projects-tree-picker.tsx diff --git a/services/workbench2/src/views-components/projects-tree-picker/projects-tree-picker.tsx b/services/workbench2/src/views-components/projects-tree-picker/projects-tree-picker.tsx index 773230d351..16f6cceb71 100644 --- a/services/workbench2/src/views-components/projects-tree-picker/projects-tree-picker.tsx +++ b/services/workbench2/src/views-components/projects-tree-picker/projects-tree-picker.tsx @@ -23,8 +23,9 @@ import { withStyles, StyleRulesCallback, WithStyles } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; export interface ToplevelPickerProps { - currentUuid?: string; + currentUuids?: string[]; pickerId: string; + cascadeSelection: boolean; includeCollections?: boolean; includeDirectories?: boolean; includeFiles?: boolean; @@ -107,7 +108,13 @@ export const ProjectsTreePicker = connect(mapStateToProps, mapDispatchToProps)( componentDidMount() { const { home, shared, favorites, publicFavorites, search } = getProjectsTreePickerIds(this.props.pickerId); - this.props.dispatch(initProjectsTreePicker(this.props.pickerId, this.props.currentUuid)); + const preloadParams = this.props.currentUuids ? { + selectedItemUuids: this.props.currentUuids, + includeDirectories: !!this.props.includeDirectories, + includeFiles: !!this.props.includeFiles, + multi: !!this.props.showSelection, + } : undefined; + this.props.dispatch(initProjectsTreePicker(this.props.pickerId, preloadParams)); this.props.dispatch(treePickerSearchActions.SET_TREE_PICKER_PROJECT_SEARCH({ pickerId: search, projectSearchValue: "" })); this.props.dispatch(treePickerSearchActions.SET_TREE_PICKER_COLLECTION_FILTER({ pickerId: search, collectionFilterValue: "" })); @@ -135,6 +142,7 @@ export const ProjectsTreePicker = connect(mapStateToProps, mapDispatchToProps)( const { home, shared, favorites, publicFavorites, search } = getProjectsTreePickerIds(pickerId); const relatedTreePickers = getRelatedTreePickers(pickerId); const p = { + cascadeSelection: this.props.cascadeSelection, includeCollections: this.props.includeCollections, includeDirectories: this.props.includeDirectories, includeFiles: this.props.includeFiles,