@smartbit4all/ng-client 1.1.8 → 1.1.11

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.
@@ -2085,6 +2085,7 @@ class SmartViewContextService {
2085
2085
  this.tabIdhttpHeaderName = 'viewContextUuid';
2086
2086
  this.viewHandlers = new Array();
2087
2087
  this.openedViewUuids = new Array();
2088
+ this.openedViewData = new Array();
2088
2089
  this.uuidOfPageHasBeenChanged = new Subject();
2089
2090
  this.viewContextHasBeenSynced = new Subject();
2090
2091
  this.openSmartLink = new Subject();
@@ -2251,6 +2252,7 @@ class SmartViewContextService {
2251
2252
  }
2252
2253
  view.state = ViewState.Opened;
2253
2254
  this.openedViewUuids.push(view.uuid);
2255
+ this.openedViewData.push(view);
2254
2256
  sessionStorage.setItem(view.viewName, view.uuid);
2255
2257
  this.uuidOfPageHasBeenChanged.next(view.viewName);
2256
2258
  this.updateViewContext({
@@ -2288,6 +2290,7 @@ class SmartViewContextService {
2288
2290
  }
2289
2291
  view.state = ViewState.Closed;
2290
2292
  this.openedViewUuids.slice(this.openedViewUuids.indexOf(view.uuid), 1);
2293
+ this.openedViewData.slice(this.openedViewData.indexOf(view), 1);
2291
2294
  sessionStorage.removeItem(view.viewName);
2292
2295
  this.updateViewContext({
2293
2296
  updates: [
@@ -2318,6 +2321,19 @@ class SmartViewContextService {
2318
2321
  break;
2319
2322
  }
2320
2323
  });
2324
+ // if (this.openedViewData.length !== this.viewContext?.views.length) {
2325
+ // const viewDataToClose = this.openedViewData.filter(
2326
+ // (viewData: ViewData) =>
2327
+ // !this.viewContext?.views
2328
+ // .flatMap((viewData: ViewData) => viewData.uuid)
2329
+ // .includes(viewData.uuid)
2330
+ // );
2331
+ // if (viewDataToClose?.length) {
2332
+ // viewDataToClose.forEach((viewData: ViewData) => {
2333
+ // this.closeView(viewData);
2334
+ // });
2335
+ // }
2336
+ // }
2321
2337
  this.viewContextHasBeenSynced.next();
2322
2338
  }
2323
2339
  getUuidOfPage(pageName) {
@@ -3138,36 +3154,41 @@ class SmartViewContextErrorDialogService extends SmartdialogService {
3138
3154
  constructor(dialog, router, viewContext) {
3139
3155
  super(dialog, router);
3140
3156
  this.viewContext = viewContext;
3157
+ this.dialogRefs = [];
3141
3158
  }
3142
3159
  handleAfterClosed(result) { }
3143
3160
  openDialog() {
3144
3161
  const dialogData = {
3145
3162
  content: {
3146
- title: "",
3163
+ title: '',
3147
3164
  },
3148
3165
  size: {},
3149
3166
  customComponent: SmartViewContextErrorDialogComponent,
3150
3167
  };
3151
- this.createDialog(dialogData, SmartViewContextErrorDialogComponent);
3168
+ this.dialogRefs.push(this.createDialogRef(dialogData, SmartViewContextErrorDialogComponent));
3169
+ }
3170
+ async closeDialog() {
3171
+ let dialogRef = this.dialogRefs.pop();
3172
+ dialogRef?.close();
3152
3173
  }
3153
3174
  getSmartViewContextApiError() {
3154
3175
  if (this.viewApiError?.code) {
3155
3176
  return this.viewContext.getSmartViewContextApiErrorByCode(this.viewApiError.code);
3156
3177
  }
3157
3178
  return {
3158
- code: this.viewApiError?.code ?? "",
3159
- message: this.viewApiError?.message ?? "An error has occured",
3160
- buttonLabel: "Ok",
3161
- dialogTitle: "Hiba",
3179
+ code: this.viewApiError?.code ?? '',
3180
+ message: this.viewApiError?.message ?? 'An error has occured',
3181
+ buttonLabel: 'Ok',
3182
+ dialogTitle: 'Hiba',
3162
3183
  };
3163
3184
  }
3164
3185
  }
3165
3186
  SmartViewContextErrorDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }, { token: SmartViewContextService }], target: i0.ɵɵFactoryTarget.Injectable });
3166
- SmartViewContextErrorDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, providedIn: "root" });
3187
+ SmartViewContextErrorDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, providedIn: 'root' });
3167
3188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, decorators: [{
3168
3189
  type: Injectable,
3169
3190
  args: [{
3170
- providedIn: "root",
3191
+ providedIn: 'root',
3171
3192
  }]
3172
3193
  }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }, { type: SmartViewContextService }]; } });
3173
3194