Browse Source

Merge pull request #15512 from abpframework/auto-merge/rel-7-0/1685

Merge branch dev with rel-7.0
pull/15514/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
67edf1b056
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/en/Customizing-Application-Modules-Extending-Entities.md
  2. 13
      npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts

2
docs/en/Customizing-Application-Modules-Extending-Entities.md

@ -101,7 +101,7 @@ public class MyLocalIdentityUserChangeEventHandler :
````
* `EntityChangedEventData<T>` covers create, update and delete events for the given entity. If you need, you can subscribe to create, update and delete events individually (in the same class or different classes).
* This code will be executed **out of the local transaction**, because it listens the `EntityChanged` event. You can subscribe to the `EntityChangingEventData<T>` to perform your event handler in **the same local (in-process) transaction** if the current [unit of work](Unit-Of-Work.md) is transactional.
* This code will be executed in the **current unit of work**, the whole process becomes transactional.
> Reminder: This approach needs to change the `IdentityUser` entity in the same process contains the handler class. It perfectly works even for a clustered environment (when multiple instances of the same application are running on multiple servers).

13
npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts

@ -4,13 +4,13 @@ import {
EventEmitter,
Inject,
Input,
OnInit,
Optional,
Output,
TemplateRef,
ViewEncapsulation,
OnInit,
} from '@angular/core';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent } from 'ng-zorro-antd/tree';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/tree';
import { of } from 'rxjs';
import { TreeNodeTemplateDirective } from '../templates/tree-node-template.directive';
import { ExpandedIconTemplateDirective } from '../templates/expanded-icon-template.directive';
@ -77,11 +77,16 @@ export class TreeComponent implements OnInit {
this.subscriptionService.addOne(loaded$);
}
onSelectedNodeChange(node) {
onSelectedNodeChange(node: NzTreeNode) {
this.selectedNode = node.origin.entity;
if (this.changeCheckboxWithNode) {
let newVal;
if (node.isChecked) {
newVal = this.checkedKeys.filter(x => x !== node.key);
} else {
newVal = [...this.checkedKeys, node.key];
}
this.selectedNodeChange.emit(node);
const newVal = [...this.checkedKeys, node.key];
this.checkedKeys = newVal;
this.checkedKeysChange.emit(newVal);
} else {

Loading…
Cancel
Save