@smartbit4all/ng-client 1.1.12 → 1.1.14
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.service.mjs +18 -20
- package/fesm2015/smartbit4all-ng-client.mjs +92 -88
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +17 -19
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/smart-view-context.service.d.ts +3 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.1.14.tgz +0 -0
- package/smartbit4all-ng-client-1.1.12.tgz +0 -0
|
@@ -2221,7 +2221,7 @@ class SmartViewContextService {
|
|
|
2221
2221
|
}
|
|
2222
2222
|
return this.viewContext;
|
|
2223
2223
|
}
|
|
2224
|
-
openView(view) {
|
|
2224
|
+
async openView(view) {
|
|
2225
2225
|
let viewHandler = this.viewHandlers.find((handler) => handler.name === view.viewName);
|
|
2226
2226
|
if (!viewHandler) {
|
|
2227
2227
|
throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
|
|
@@ -2255,7 +2255,7 @@ class SmartViewContextService {
|
|
|
2255
2255
|
this.openedViewData.push(view);
|
|
2256
2256
|
sessionStorage.setItem(view.viewName, view.uuid);
|
|
2257
2257
|
this.uuidOfPageHasBeenChanged.next(view.viewName);
|
|
2258
|
-
this.updateViewContext({
|
|
2258
|
+
await this.updateViewContext({
|
|
2259
2259
|
updates: [
|
|
2260
2260
|
{
|
|
2261
2261
|
state: ViewState.Opened,
|
|
@@ -2265,7 +2265,7 @@ class SmartViewContextService {
|
|
|
2265
2265
|
uuid: this.viewContext?.uuid,
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
|
-
closeView(view) {
|
|
2268
|
+
async closeView(view) {
|
|
2269
2269
|
let viewHandler = this.viewHandlers.find((handler) => handler.name === view.viewName);
|
|
2270
2270
|
if (!viewHandler) {
|
|
2271
2271
|
throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
|
|
@@ -2290,10 +2290,10 @@ class SmartViewContextService {
|
|
|
2290
2290
|
}
|
|
2291
2291
|
view.state = ViewState.Closed;
|
|
2292
2292
|
const index = this.openedViewUuids.indexOf(view.uuid);
|
|
2293
|
-
this.openedViewUuids.
|
|
2294
|
-
this.openedViewData.
|
|
2293
|
+
this.openedViewUuids.splice(index, 1);
|
|
2294
|
+
this.openedViewData.splice(index, 1);
|
|
2295
2295
|
sessionStorage.removeItem(view.viewName);
|
|
2296
|
-
this.updateViewContext({
|
|
2296
|
+
await this.updateViewContext({
|
|
2297
2297
|
updates: [
|
|
2298
2298
|
{
|
|
2299
2299
|
state: ViewState.Closed,
|
|
@@ -2311,26 +2311,24 @@ class SmartViewContextService {
|
|
|
2311
2311
|
this.openView(view);
|
|
2312
2312
|
});
|
|
2313
2313
|
}
|
|
2314
|
-
syncView() {
|
|
2315
|
-
this.viewContext?.views.map((view) => {
|
|
2314
|
+
async syncView() {
|
|
2315
|
+
this.viewContext?.views.map(async (view) => {
|
|
2316
2316
|
switch (view.state) {
|
|
2317
2317
|
case ViewState.ToOpen:
|
|
2318
|
-
this.openView(view);
|
|
2318
|
+
await this.openView(view);
|
|
2319
2319
|
break;
|
|
2320
2320
|
case ViewState.ToClose:
|
|
2321
|
-
this.closeView(view);
|
|
2321
|
+
await this.closeView(view);
|
|
2322
2322
|
break;
|
|
2323
2323
|
}
|
|
2324
2324
|
});
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
});
|
|
2333
|
-
}
|
|
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.map(async (viewData) => {
|
|
2330
|
+
await this.closeView(viewData);
|
|
2331
|
+
});
|
|
2334
2332
|
}
|
|
2335
2333
|
this.viewContextHasBeenSynced.next();
|
|
2336
2334
|
}
|