mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2242] Search on custom sources is not working. (#2904)
* [ADF-2242] Search on custom sources is not working. fix search on custom sources * [ADF-2242] added unit tests * [ADF-2242] reverted change * [ADF-2242] simplify code on search method and make extra call only when having custom dropdown defined
This commit is contained in:
committed by
Eugenio Romano
parent
5ee9b09a21
commit
78c6a68e51
@@ -32,13 +32,26 @@ export class ContentNodeSelectorService {
|
||||
* Performs a search for content node selection
|
||||
*
|
||||
* @param searchTerm The term to search for
|
||||
* @param skipCount From where to start the loading
|
||||
* @param rootNodeId The root is to start the search from
|
||||
* @param skipCount From where to start the loading
|
||||
* @param maxItems How many items to load
|
||||
* @param [extraNodeIds] List of extra node ids to search from. This last parameter is necessary when
|
||||
* the rootNodeId is one of the supported aliases (e.g. '-my-', '-root-', '-mysites-', etc.)
|
||||
* and search is not supported for that alias, but can be performed on its corresponding nodes.
|
||||
*/
|
||||
public search(searchTerm: string, rootNodeId: string = null, skipCount: number = 0, maxItems: number = 25): Observable<NodePaging> {
|
||||
public search(searchTerm: string, rootNodeId: string = null, skipCount: number = 0, maxItems: number = 25, extraNodeIds?: string[]): Observable<NodePaging> {
|
||||
|
||||
const parentFiltering = rootNodeId ? [ { query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'` } ] : [];
|
||||
let extraParentFiltering = '';
|
||||
|
||||
if (extraNodeIds && extraNodeIds.length) {
|
||||
extraNodeIds
|
||||
.filter(id => id !== rootNodeId)
|
||||
.forEach(extraId => {
|
||||
extraParentFiltering += ` OR ANCESTOR:'workspace://SpacesStore/${extraId}'`;
|
||||
});
|
||||
}
|
||||
|
||||
const parentFiltering = rootNodeId ? [ { query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'${extraParentFiltering}` } ] : [];
|
||||
|
||||
let defaultSearchNode: any = {
|
||||
query: {
|
||||
|
Reference in New Issue
Block a user