return this.addCondition("properties." + field, "exists", false, "", "", resourcePrefix);
}
- public addFullTextSearch(value: string) {
+ public addFullTextSearch(value: string, table?: string) {
const regex = /"[^"]*"/;
const matches: any[] = [];
match = value.match(regex);
}
+ let searchIn = 'any';
+ if (table) {
+ searchIn = table + ".any";
+ }
+
const terms = value.trim().split(/(\s+)/).concat(matches);
terms.forEach(term => {
if (term !== " ") {
- this.addCondition("any", "ilike", term, "%", "%");
+ this.addCondition(searchIn, "ilike", term, "%", "%");
}
});
return this;
const state = getState();
if (state.treePickerSearch.collectionFilterValues[pickerId]) {
- filterB = filterB.addILike('collections.name', state.treePickerSearch.collectionFilterValues[pickerId]);
+ filterB = filterB.addFullTextSearch(state.treePickerSearch.collectionFilterValues[pickerId], 'collections');
} else {
filterB = filterB.addNotIn("collections.properties.type", ["intermediate", "log"]);
}
if (searchProjects && state.treePickerSearch.projectSearchValues[pickerId]) {
- filterB = filterB.addILike('groups.name', state.treePickerSearch.projectSearchValues[pickerId]);
+ filterB = filterB.addFullTextSearch(state.treePickerSearch.projectSearchValues[pickerId], 'groups');
}
const filters = filterB.getFilters();
- const { items, itemsAvailable } = await services.groupsService.contents((loadShared || searchProjects) ? '' : id, { filters, excludeHomeProject: loadShared || undefined, limit: 1000 });
+ const itemLimit = 200;
- if (itemsAvailable > 1000) {
+ const { items, itemsAvailable } = await services.groupsService.contents((loadShared || searchProjects) ? '' : id, { filters, excludeHomeProject: loadShared || undefined, limit: itemLimit });
+
+ if (itemsAvailable > itemLimit) {
items.push({
uuid: "more-items-available",
kind: ResourceKind.WORKFLOW,
- name: "*** Not all items were loaded (limit 1000 items) ***",
+ name: `*** Not all items listed (${items.length} out of ${itemsAvailable}), reduce item count with search or filter ***`,
description: "",
definition: "",
ownerUuid: "",
const node = getNode(id)(picker);
if (node && 'kind' in node.value && node.value.kind === ResourceKind.COLLECTION) {
- const files = await services.collectionService.files(node.value.portableDataHash);
+ const files = await services.collectionService.files(node.value.uuid);
const tree = createCollectionFilesTree(files);
const sorted = sortFilesTree(tree);
const filesTree = mapTreeValues(services.collectionService.extendFileURL)(sorted);
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
pickerHeight: {
- height: "70vh"
+ height: "calc(70vh - 100px)"
},
searchFlex: {
display: "flex",
paddingBottom: "1em"
},
scrolledBox: {
- height: "100%",
+ height: "calc(100% - 50px)",
overflow: "scroll"
}
});
};
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={200} />
{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={200} />}
</span>
<div className={this.props.classes.scrolledBox}>