mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fixed parent changing for search header (#5975)
Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local>
This commit is contained in:
@@ -113,19 +113,12 @@ export class SearchHeaderComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
.subscribe((newNodePaging: NodePaging) => {
|
.subscribe((newNodePaging: NodePaging) => {
|
||||||
this.update.emit(newNodePaging);
|
this.update.emit(newNodePaging);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.searchHeaderQueryBuilder.isCustomSourceNode(this.currentFolderNodeId)) {
|
|
||||||
this.searchHeaderQueryBuilder.getNodeIdForCustomSource(this.currentFolderNodeId).subscribe((node: MinimalNode) => {
|
|
||||||
this.initSearchHeader(node.id);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.initSearchHeader(this.currentFolderNodeId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
if (changes['currentFolderNodeId'] && changes['currentFolderNodeId'].currentValue) {
|
if (changes['currentFolderNodeId'] && changes['currentFolderNodeId'].currentValue) {
|
||||||
this.clearHeader();
|
this.clearHeader();
|
||||||
|
this.configureSearchParent(changes['currentFolderNodeId'].currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changes['maxItems'] || changes['skipCount']) {
|
if (changes['maxItems'] || changes['skipCount']) {
|
||||||
@@ -200,6 +193,16 @@ export class SearchHeaderComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
return this.widgetContainer && this.widgetContainer.componentRef && this.widgetContainer.componentRef.instance.isActive;
|
return this.widgetContainer && this.widgetContainer.componentRef && this.widgetContainer.componentRef.instance.isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private configureSearchParent(currentFolderNodeId: string) {
|
||||||
|
if (this.searchHeaderQueryBuilder.isCustomSourceNode(currentFolderNodeId)) {
|
||||||
|
this.searchHeaderQueryBuilder.getNodeIdForCustomSource(currentFolderNodeId).subscribe((node: MinimalNode) => {
|
||||||
|
this.initSearchHeader(node.id);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.initSearchHeader(currentFolderNodeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private initSearchHeader(currentFolderId: string) {
|
private initSearchHeader(currentFolderId: string) {
|
||||||
this.searchHeaderQueryBuilder.setCurrentRootFolderId(currentFolderId);
|
this.searchHeaderQueryBuilder.setCurrentRootFolderId(currentFolderId);
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
|
Reference in New Issue
Block a user