mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-5354] Content node selector is not working properly for read-only folders (#6777)
* disable button when no permission * test * breadcrumb fallback when selection is not valid * test
This commit is contained in:
@@ -77,6 +77,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
|
||||
private showSiteList = true;
|
||||
private showSearchField = true;
|
||||
private breadcrumbFolderNodeFallback: Node ;
|
||||
|
||||
/** If true will restrict the search and breadcrumbs to the currentFolderId */
|
||||
@Input()
|
||||
@@ -445,7 +446,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
let folderNode: Node;
|
||||
|
||||
if (this.showingSearchResults && this.chosenNode) {
|
||||
folderNode = this.chosenNode[0];
|
||||
folderNode = this.chosenNode[0] || this.breadcrumbFolderNodeFallback;
|
||||
} else {
|
||||
folderNode = this.documentList.folderNode;
|
||||
}
|
||||
@@ -465,6 +466,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
this.loadingSearchResults = true;
|
||||
this.addCorrespondingNodeIdsQuery();
|
||||
this.resetChosenNode();
|
||||
this.breadcrumbFolderNodeFallback = null ;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,8 +608,12 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
* @param nodesEntries
|
||||
*/
|
||||
onCurrentSelection(nodesEntries: NodeEntry[]): void {
|
||||
this.breadcrumbFolderNodeFallback = null;
|
||||
const validNodesEntity = nodesEntries.filter((node) => this.isSelectionValid(node.entry));
|
||||
this.chosenNode = validNodesEntity.map((node) => node.entry);
|
||||
if (!this.chosenNode.length) {
|
||||
this.breadcrumbFolderNodeFallback = nodesEntries[0].entry;
|
||||
}
|
||||
}
|
||||
|
||||
setTitleIfCustomSite(site: SiteEntry) {
|
||||
|
Reference in New Issue
Block a user