mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2061] Fix content node selector search (#2772)
* Fix content node selector search * Fix tests
This commit is contained in:
committed by
Eugenio Romano
parent
19b1507251
commit
3e52127b5c
@@ -26,8 +26,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
@Injectable()
|
||||
export class ContentNodeSelectorService {
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
}
|
||||
constructor(private searchService: SearchService) {}
|
||||
|
||||
/**
|
||||
* Performs a search for content node selection
|
||||
@@ -37,7 +36,9 @@ export class ContentNodeSelectorService {
|
||||
* @param rootNodeId The root is to start the search from
|
||||
* @param maxItems How many items to load
|
||||
*/
|
||||
public search(searchTerm: string, rootNodeId: string, skipCount: number = 0, maxItems: number = 25): Observable<NodePaging> {
|
||||
public search(searchTerm: string, rootNodeId: string = null, skipCount: number = 0, maxItems: number = 25): Observable<NodePaging> {
|
||||
|
||||
const parentFiltering = rootNodeId ? [ { query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'` } ] : [];
|
||||
|
||||
let defaultSearchNode: any = {
|
||||
query: {
|
||||
@@ -50,13 +51,14 @@ export class ContentNodeSelectorService {
|
||||
},
|
||||
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 this.searchService.search(defaultSearchNode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user