@smartbit4all/ng-client 3.2.22 → 3.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9708,8 +9708,10 @@ class SmarttreeGenericService extends SmarttreeService {
9708
9708
  async initialize() {
9709
9709
  if (sessionStorage.getItem(this.viewContextName)) {
9710
9710
  await this.downloadTree().then((rootNodes) => {
9711
- this.treeFromBackend = rootNodes;
9712
- this.syncTree();
9711
+ if (!deepEqual(this.treeFromBackend, rootNodes)) {
9712
+ this.treeFromBackend = rootNodes;
9713
+ this.syncTree();
9714
+ }
9713
9715
  });
9714
9716
  }
9715
9717
  }
@@ -9865,18 +9867,36 @@ class SmarttreeGenericService extends SmarttreeService {
9865
9867
  return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
9866
9868
  }
9867
9869
  async cacheActionDesciptors(nodes) {
9868
- await Promise.all(nodes.map(async (node) => {
9869
- let newUiActions = node.actions?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code));
9870
- if (!newUiActions) {
9871
- return;
9872
- }
9873
- await Promise.all(newUiActions.map(async (uiAction) => {
9874
- if (!this.uiActionDescriptors.get(uiAction.code)) {
9875
- let descriptor = await this.uiActionDescriptorService.getActionDescriptor(uiAction);
9876
- this.uiActionDescriptors.set(uiAction.code, descriptor);
9877
- }
9878
- }));
9879
- }));
9870
+ let newUiActions = new Set();
9871
+ nodes.forEach((node) => {
9872
+ node.actions
9873
+ ?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
9874
+ .forEach((action) => newUiActions.add(action));
9875
+ });
9876
+ for (let action of newUiActions) {
9877
+ if (!this.uiActionDescriptors.get(action.code)) {
9878
+ let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
9879
+ this.uiActionDescriptors.set(action.code, descriptor);
9880
+ }
9881
+ }
9882
+ // await Promise.all(
9883
+ // nodes.map(async (node: SmartTreeNode) => {
9884
+ // let newUiActions = node.actions?.filter(
9885
+ // (uiAction: UiAction) => !this.uiActionDescriptors.get(uiAction.code!)
9886
+ // );
9887
+ // if (!newUiActions) {
9888
+ // return;
9889
+ // }
9890
+ // await Promise.all(
9891
+ // newUiActions!.map(async (uiAction: UiAction) => {
9892
+ // if (!this.uiActionDescriptors.get(uiAction.code!)) {
9893
+ // let descriptor = await this.uiActionDescriptorService.getActionDescriptor(uiAction);
9894
+ // this.uiActionDescriptors.set(uiAction.code!, descriptor);
9895
+ // }
9896
+ // })
9897
+ // );
9898
+ // })
9899
+ // );
9880
9900
  }
9881
9901
  getLabelByAction(action) {
9882
9902
  let desc = this.uiActionDescriptors.get(action.code);