@smartbit4all/ng-client 1.1.8 → 1.1.10
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.
- package/esm2020/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.mjs +17 -12
- package/esm2020/lib/view-context/smart-view-context.service.mjs +14 -1
- package/fesm2015/smartbit4all-ng-client.mjs +30 -9
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +26 -8
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.d.ts +8 -6
- package/lib/view-context/smart-view-context.service.d.ts +1 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.1.10.tgz +0 -0
- package/smartbit4all-ng-client-1.1.8.tgz +0 -0
|
@@ -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,16 @@ class SmartViewContextService {
|
|
|
2318
2321
|
break;
|
|
2319
2322
|
}
|
|
2320
2323
|
});
|
|
2324
|
+
if (this.openedViewData.length !== this.viewContext?.views.length) {
|
|
2325
|
+
const viewDataToClose = this.openedViewData.filter((viewData) => !this.viewContext?.views
|
|
2326
|
+
.flatMap((viewData) => viewData.uuid)
|
|
2327
|
+
.includes(viewData.uuid));
|
|
2328
|
+
if (viewDataToClose?.length) {
|
|
2329
|
+
viewDataToClose.forEach((viewData) => {
|
|
2330
|
+
this.closeView(viewData);
|
|
2331
|
+
});
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2321
2334
|
this.viewContextHasBeenSynced.next();
|
|
2322
2335
|
}
|
|
2323
2336
|
getUuidOfPage(pageName) {
|
|
@@ -3138,36 +3151,41 @@ class SmartViewContextErrorDialogService extends SmartdialogService {
|
|
|
3138
3151
|
constructor(dialog, router, viewContext) {
|
|
3139
3152
|
super(dialog, router);
|
|
3140
3153
|
this.viewContext = viewContext;
|
|
3154
|
+
this.dialogRefs = [];
|
|
3141
3155
|
}
|
|
3142
3156
|
handleAfterClosed(result) { }
|
|
3143
3157
|
openDialog() {
|
|
3144
3158
|
const dialogData = {
|
|
3145
3159
|
content: {
|
|
3146
|
-
title:
|
|
3160
|
+
title: '',
|
|
3147
3161
|
},
|
|
3148
3162
|
size: {},
|
|
3149
3163
|
customComponent: SmartViewContextErrorDialogComponent,
|
|
3150
3164
|
};
|
|
3151
|
-
this.
|
|
3165
|
+
this.dialogRefs.push(this.createDialogRef(dialogData, SmartViewContextErrorDialogComponent));
|
|
3166
|
+
}
|
|
3167
|
+
async closeDialog() {
|
|
3168
|
+
let dialogRef = this.dialogRefs.pop();
|
|
3169
|
+
dialogRef?.close();
|
|
3152
3170
|
}
|
|
3153
3171
|
getSmartViewContextApiError() {
|
|
3154
3172
|
if (this.viewApiError?.code) {
|
|
3155
3173
|
return this.viewContext.getSmartViewContextApiErrorByCode(this.viewApiError.code);
|
|
3156
3174
|
}
|
|
3157
3175
|
return {
|
|
3158
|
-
code: this.viewApiError?.code ??
|
|
3159
|
-
message: this.viewApiError?.message ??
|
|
3160
|
-
buttonLabel:
|
|
3161
|
-
dialogTitle:
|
|
3176
|
+
code: this.viewApiError?.code ?? '',
|
|
3177
|
+
message: this.viewApiError?.message ?? 'An error has occured',
|
|
3178
|
+
buttonLabel: 'Ok',
|
|
3179
|
+
dialogTitle: 'Hiba',
|
|
3162
3180
|
};
|
|
3163
3181
|
}
|
|
3164
3182
|
}
|
|
3165
3183
|
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:
|
|
3184
|
+
SmartViewContextErrorDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, providedIn: 'root' });
|
|
3167
3185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, decorators: [{
|
|
3168
3186
|
type: Injectable,
|
|
3169
3187
|
args: [{
|
|
3170
|
-
providedIn:
|
|
3188
|
+
providedIn: 'root',
|
|
3171
3189
|
}]
|
|
3172
3190
|
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }, { type: SmartViewContextService }]; } });
|
|
3173
3191
|
|