[AAE-3113] Node selector - Be able to restrict the breadcrums to a specific root (#5912)

* Be able to restrict the breadcrums to a specific root

* Add unit test for breadcrumbs restriction

* Fix refresh
This commit is contained in:
Maurizio Vitale
2020-07-29 12:46:37 +01:00
committed by GitHub
parent 506f0dfbb1
commit c7237486df
7 changed files with 26 additions and 6 deletions

View File

@@ -60,9 +60,9 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
private showSearchField = true;
private showFiles = false;
/** If true will restrict the search to the currentFolderId */
/** If true will restrict the search and breadcrumbs to the currentFolderId */
@Input()
restrictSearchToCurrentFolderId: boolean = false;
restrictRootToCurrentFolderId: boolean = false;
/** Node ID of the folder currently listed. */
@Input()
@@ -198,6 +198,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
nodePaging: NodePaging | null = null;
siteId: null | string;
breadcrumbRootId: null | string;
searchTerm: string = '';
showingSearchResults: boolean = false;
loadingSearchResults: boolean = false;
@@ -252,7 +253,8 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
this.target = this.documentList;
this.folderIdToShow = this.currentFolderId;
if (this.currentFolderId) {
if (this.restrictSearchToCurrentFolderId) {
if (this.restrictRootToCurrentFolderId) {
this.breadcrumbRootId = this.currentFolderId;
this.siteId = this.currentFolderId;
} else {
this.getStartSite();