[AAE-2202] Not able to search for files (#5569)

* [AAE-2202] Not able to search for files

* * fixd test

* * fixed panel test

* * fixed files search options

* * added docs
This commit is contained in:
dhrn
2020-03-31 16:06:35 +05:30
committed by GitHub
parent 6564ef256e
commit e06f871d73
15 changed files with 78 additions and 19 deletions

View File

@@ -56,6 +56,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
private showSiteList = true;
private showSearchField = true;
private showFiles = false;
/** Node ID of the folder currently listed. */
@Input()
@@ -163,6 +164,14 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
return this.showSiteList;
}
/** Shows the files and folders in the search result */
@Input()
set showFilesInResult(value: boolean) {
if (value !== undefined && value !== null) {
this.showFiles = value;
}
}
/** Emitted when the user has chosen an item. */
@Output()
select: EventEmitter<Node[]> = new EventEmitter<Node[]>();
@@ -355,14 +364,14 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
if (this.customResourcesService.hasCorrespondingNodeIds(this.siteId)) {
this.customResourcesService.getCorrespondingNodeIds(this.siteId)
.subscribe((nodeIds) => {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.pagination.skipCount, this.pagination.maxItems, nodeIds)
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.pagination.skipCount, this.pagination.maxItems, nodeIds, this.showFiles)
.subscribe(this.showSearchResults.bind(this));
},
() => {
this.showSearchResults({ list: { entries: [] } });
});
} else {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.pagination.skipCount, this.pagination.maxItems)
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.pagination.skipCount, this.pagination.maxItems, [], this.showFiles)
.subscribe(this.showSearchResults.bind(this));
}
}