[AAE-3114] Ability to restrict search to a root folder (#5890)

* Ability to restrict the search to a specific root in case there is no site concept

* Add unit test

* Initialize the siteId with root

* Fix unit test

* Reuse existing property and add boolean

* add new line before extect

* Rename to restrictSearchToCurrentFolderId

* Typo

* Rename property into doc
This commit is contained in:
Maurizio Vitale
2020-07-21 22:46:19 +01:00
committed by GitHub
parent 94c99574f8
commit 826bd32e60
3 changed files with 29 additions and 1 deletions

View File

@@ -60,6 +60,10 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
private showSearchField = true;
private showFiles = false;
/** If true will restrict the search to the currentFolderId */
@Input()
restrictSearchToCurrentFolderId: boolean = false;
/** Node ID of the folder currently listed. */
@Input()
currentFolderId: string = null;
@@ -248,7 +252,11 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
this.target = this.documentList;
this.folderIdToShow = this.currentFolderId;
if (this.currentFolderId) {
this.getStartSite();
if (this.restrictSearchToCurrentFolderId) {
this.siteId = this.currentFolderId;
} else {
this.getStartSite();
}
}
this.breadcrumbTransform = this.breadcrumbTransform ? this.breadcrumbTransform : null;