[ADF-2304] Add option to Content Node Selector to transform the breadcrumb folder node (#2952)

* [ADF-2304] Add option to Content Node Selector to transform the breadcrumb folder node

* [ADF-2304] update documentation with recent changes

* [ADF-2304] added example of using the breadcrumbTransform
This commit is contained in:
suzanadirla
2018-02-19 19:27:55 +02:00
committed by Eugenio Romano
parent 6b980edcf5
commit 6d0bab9278
7 changed files with 90 additions and 4 deletions

View File

@@ -70,6 +70,9 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
@Input()
isSelectionValid: ValidationFunction = defaultValidation;
@Input()
breadcrumbTransform: (node) => any;
@Output()
select: EventEmitter<MinimalNodeEntryEntity[]> = new EventEmitter<MinimalNodeEntryEntity[]>();
@@ -123,6 +126,8 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
ngOnInit() {
this.folderIdToShow = this.currentFolderId;
this.paginationStrategy = PaginationStrategy.Infinite;
this.breadcrumbTransform = this.breadcrumbTransform ? this.breadcrumbTransform : null ;
}
/**
@@ -159,11 +164,15 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
* Returns the actually selected|entered folder node or null in case of searching for the breadcrumb
*/
get breadcrumbFolderNode(): MinimalNodeEntryEntity | null {
let folderNode: MinimalNodeEntryEntity;
if (this.showingSearchResults && this.chosenNode) {
return this.chosenNode;
folderNode = this.chosenNode;
} else {
return this.documentList.folderNode;
folderNode = this.documentList.folderNode;
}
return this.breadcrumbTransform ? this.breadcrumbTransform(folderNode) : folderNode;
}
/**