import { ArvadosTheme } from 'common/custom-theme';
export interface ToplevelPickerProps {
+ currentUuids?: string[];
pickerId: string;
+ cascadeSelection: boolean;
includeCollections?: boolean;
+ includeDirectories?: boolean;
includeFiles?: boolean;
showSelection?: boolean;
options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
const { home, shared, favorites, publicFavorites, search } = getProjectsTreePickerIds(props.pickerId);
const params = {
includeCollections: props.includeCollections,
+ includeDirectories: props.includeDirectories,
includeFiles: props.includeFiles,
options: props.options
};
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
pickerHeight: {
- height: "70vh"
+ height: "100%",
+ display: "flex",
+ flexDirection: "column",
},
searchFlex: {
display: "flex",
paddingBottom: "1em"
},
scrolledBox: {
- height: "100%",
overflow: "scroll"
}
});
componentDidMount() {
const { home, shared, favorites, publicFavorites, search } = getProjectsTreePickerIds(this.props.pickerId);
- this.props.dispatch<any>(initProjectsTreePicker(this.props.pickerId));
+ 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<any>(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: "" }));
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,
showSelection: this.props.showSelection,
options: this.props.options,
};
return <div className={this.props.classes.pickerHeight} >
<span className={this.props.classes.searchFlex}>
- <SearchInput value="" label="Search all Projects" selfClearProp='' onSearch={onProjectSearch} debounce={200} />
+ <SearchInput value="" label="Search for a Project" selfClearProp='' onSearch={onProjectSearch} debounce={500} />
{this.props.includeCollections &&
- <SearchInput value="" label="Filter Collections inside Projects" selfClearProp='' onSearch={onCollectionFilter} debounce={200} />}
+ <SearchInput value="" label="Filter Collections list in Projects" selfClearProp='' onSearch={onCollectionFilter} debounce={500} />}
</span>
<div className={this.props.classes.scrolledBox}>