[ADF-2061] Fix content node selector search (#2772)

* Fix content node selector search

* Fix tests
This commit is contained in:
Popovics András
2017-12-07 19:23:38 +00:00
committed by Eugenio Romano
parent 19b1507251
commit 3e52127b5c
3 changed files with 125 additions and 13 deletions

View File

@@ -373,6 +373,9 @@ describe('ContentNodeSelectorComponent', () => {
describe('Search functionality', () => {
function defaultSearchOptions(searchTerm, rootNodeId = undefined, skipCount = 0) {
const parentFiltering = rootNodeId ? [ { query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'` } ] : [];
let defaultSearchNode: any = {
query: {
query: searchTerm ? `${searchTerm}* OR name:${searchTerm}*` : searchTerm
@@ -384,13 +387,14 @@ describe('ContentNodeSelectorComponent', () => {
},
filterQueries: [
{ query: "TYPE:'cm:folder'" },
{ query: 'NOT cm:creator:System' }]
{ query: 'NOT cm:creator:System' },
...parentFiltering
],
scope: {
locations: ['nodes']
}
};
if (rootNodeId) {
defaultSearchNode.scope = rootNodeId;
}
return defaultSearchNode;
}