@smartbit4all/ng-client 3.0.32 → 3.0.34

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.
@@ -2497,13 +2497,13 @@ class SmartViewContextDialogService {
2497
2497
  this.router = router;
2498
2498
  }
2499
2499
  createDialog(smartDialog, component) {
2500
- this.dialogData = smartDialog;
2501
- this.dialogRef = this.dialog.open(component, { data: this.dialogData });
2502
- this.dialogRef.afterClosed().subscribe((result) => {
2500
+ let dialogData = smartDialog;
2501
+ let dialogRef = this.dialog.open(component, { data: dialogData });
2502
+ dialogRef.afterClosed().subscribe((result) => {
2503
2503
  this.handleAfterClosed(result);
2504
- this.closeDialog();
2504
+ this.closeDialog(dialogRef, dialogData);
2505
2505
  });
2506
- return this.dialogRef;
2506
+ return dialogRef;
2507
2507
  }
2508
2508
  createDialogRef(smartDialog, component) {
2509
2509
  const dialogRef = this.dialog.open(component, { data: smartDialog });
@@ -2527,15 +2527,15 @@ class SmartViewContextDialogService {
2527
2527
  openDialog() {
2528
2528
  throw new Error('openDialog function is not implemented!');
2529
2529
  }
2530
- async closeDialog() {
2531
- if (this.dialogData?.outlets) {
2530
+ async closeDialog(dialogRef, dialogData) {
2531
+ if (dialogData?.outlets) {
2532
2532
  await this.router.navigate([
2533
2533
  {
2534
- outlets: this.dialogData.outlets,
2534
+ outlets: dialogData.outlets,
2535
2535
  },
2536
2536
  ]);
2537
2537
  }
2538
- this.dialogRef?.close();
2538
+ dialogRef?.close();
2539
2539
  }
2540
2540
  }
2541
2541
  SmartViewContextDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextDialogService, deps: [{ token: i1$2.MatDialog }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -2725,31 +2725,34 @@ class SmartViewContextService {
2725
2725
  if (!viewHandler.component) {
2726
2726
  throw new Error(`Component is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
2727
2727
  }
2728
- let dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
2729
- let dialogDisableClose = true;
2730
- try {
2731
- dialogDisableClose = this.inject.get(DIALOG_DISABLE_CLOSE);
2732
- }
2733
- catch {
2734
- console.error('Error during reading DIALOG_DISABLE_CLOSE');
2735
- }
2736
- dialogRef.disableClose = dialogDisableClose;
2737
- // if (view.viewName === this.messageDialogname) {
2738
- // if (view.message?.options && view.message.options.length) {
2739
- // }
2740
- // }
2741
- if (!dialogDisableClose) {
2742
- dialogRef
2743
- .afterClosed()
2744
- .pipe(takeUntil(this._destroy$))
2745
- .subscribe(() => {
2746
- this.performAction(view.uuid, { code: DefaultUiActionCode_CLOSE, params: {} });
2728
+ let refIsAlradyAdded = this.dialogRefs.some((ref) => ref.uuid === view.uuid);
2729
+ if (!refIsAlradyAdded) {
2730
+ let dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
2731
+ let dialogDisableClose = true;
2732
+ try {
2733
+ dialogDisableClose = this.inject.get(DIALOG_DISABLE_CLOSE);
2734
+ }
2735
+ catch {
2736
+ console.error('Error during reading DIALOG_DISABLE_CLOSE');
2737
+ }
2738
+ dialogRef.disableClose = dialogDisableClose;
2739
+ // if (view.viewName === this.messageDialogname) {
2740
+ // if (view.message?.options && view.message.options.length) {
2741
+ // }
2742
+ // }
2743
+ if (!dialogDisableClose) {
2744
+ dialogRef
2745
+ .afterClosed()
2746
+ .pipe(takeUntil(this._destroy$))
2747
+ .subscribe(() => {
2748
+ this.performAction(view.uuid, { code: DefaultUiActionCode_CLOSE, params: {} });
2749
+ });
2750
+ }
2751
+ this.dialogRefs.push({
2752
+ uuid: view.uuid,
2753
+ dialogRef,
2747
2754
  });
2748
2755
  }
2749
- this.dialogRefs.push({
2750
- uuid: view.uuid,
2751
- dialogRef,
2752
- });
2753
2756
  }
2754
2757
  else if (view.type === ViewType.Normal) {
2755
2758
  if (viewHandler.route === undefined) {