mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-5991] ESLint fixes and code quality improvements (#8893)
* prefer-optional-chain: core * prefer-optional-chain: content, fix typings * prefer-optional-chain: process, fix typings * prefer-optional-chain: process-cloud, fix typings, fix ts configs and eslint * [ci: force] sonar errors fixes, insights lib * [ci:force] fix security issues * [ci:force] fix metadata e2e bug, js assignment bugs * [ci:force] fix lint issue * [ci:force] fix tests
This commit is contained in:
@@ -27,9 +27,7 @@ import { NodeEntry } from '@alfresco/js-api';
|
||||
templateUrl: './tree-view.component.html',
|
||||
styleUrls: ['./tree-view.component.scss']
|
||||
})
|
||||
|
||||
export class TreeViewComponent implements OnChanges {
|
||||
|
||||
/** Identifier of the node to display. */
|
||||
@Input()
|
||||
nodeId: string;
|
||||
@@ -51,8 +49,7 @@ export class TreeViewComponent implements OnChanges {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['nodeId'] && changes['nodeId'].currentValue &&
|
||||
changes['nodeId'].currentValue !== changes['nodeId'].previousValue) {
|
||||
if (changes['nodeId']?.currentValue && changes['nodeId'].currentValue !== changes['nodeId'].previousValue) {
|
||||
this.loadTreeNode();
|
||||
} else {
|
||||
this.dataSource.data = [];
|
||||
@@ -70,12 +67,11 @@ export class TreeViewComponent implements OnChanges {
|
||||
hasChild = (_: number, nodeData: TreeBaseNode) => nodeData.expandable;
|
||||
|
||||
private loadTreeNode() {
|
||||
this.treeViewService.getTreeNodes(this.nodeId)
|
||||
.subscribe(
|
||||
(treeNode: TreeBaseNode[]) => {
|
||||
this.dataSource.data = treeNode;
|
||||
},
|
||||
(error) => this.error.emit(error)
|
||||
);
|
||||
this.treeViewService.getTreeNodes(this.nodeId).subscribe(
|
||||
(treeNode: TreeBaseNode[]) => {
|
||||
this.dataSource.data = treeNode;
|
||||
},
|
||||
(error) => this.error.emit(error)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user