@smartbit4all/ng-client 1.1.21 → 1.1.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.
- package/esm2020/lib/session/smart-session.service.mjs +5 -10
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +2 -2
- package/esm2020/lib/view-context/smart-view-context.service.mjs +9 -14
- package/fesm2015/smartbit4all-ng-client.mjs +14 -24
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +13 -23
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/smart-view-context.service.d.ts +1 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.1.23.tgz +0 -0
- package/smartbit4all-ng-client-1.1.21.tgz +0 -0
|
@@ -706,8 +706,6 @@ class SmartSessionService {
|
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
addHeaderParam(headerParam) {
|
|
709
|
-
console.log('addHeaderParam called ');
|
|
710
|
-
console.log(headerParam);
|
|
711
709
|
if (this.headerParams.find((h) => h.headerName === headerParam.headerName)) {
|
|
712
710
|
let index = this.headerParams.findIndex((h) => h.headerName === headerParam.headerName);
|
|
713
711
|
this.headerParams[index].value = headerParam.value;
|
|
@@ -718,13 +716,10 @@ class SmartSessionService {
|
|
|
718
716
|
this.headersUpdated.next();
|
|
719
717
|
}
|
|
720
718
|
setUpTokenForSessionService() {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
else {
|
|
726
|
-
this.addHeaderParam({ headerName: 'Authorization', value: `Bearer ${this.token}` });
|
|
727
|
-
}
|
|
719
|
+
this.addHeaderParam({
|
|
720
|
+
headerName: 'Authorization',
|
|
721
|
+
value: `Bearer ${this.token}`,
|
|
722
|
+
});
|
|
728
723
|
}
|
|
729
724
|
setUrl(url) {
|
|
730
725
|
this.basePath = url;
|
|
@@ -2114,7 +2109,6 @@ class SmartViewContextService {
|
|
|
2114
2109
|
sessionStorage.clear();
|
|
2115
2110
|
}
|
|
2116
2111
|
setTabId(tabId) {
|
|
2117
|
-
console.log('setTabId ' + tabId);
|
|
2118
2112
|
sessionStorage.setItem(this.tabIdName, tabId);
|
|
2119
2113
|
this.session.addHeaderParam({
|
|
2120
2114
|
headerName: this.tabIdhttpHeaderName,
|
|
@@ -2123,7 +2117,6 @@ class SmartViewContextService {
|
|
|
2123
2117
|
}
|
|
2124
2118
|
startViewContext() {
|
|
2125
2119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2126
|
-
console.log('startViewContext');
|
|
2127
2120
|
this.clearSessionStorage();
|
|
2128
2121
|
let newViewContext = yield this.view
|
|
2129
2122
|
.createViewContext()
|
|
@@ -2132,7 +2125,6 @@ class SmartViewContextService {
|
|
|
2132
2125
|
throw new Error('No ViewContext was created');
|
|
2133
2126
|
}
|
|
2134
2127
|
this.viewContext = newViewContext;
|
|
2135
|
-
console.log(this.viewContext);
|
|
2136
2128
|
this.setTabId(newViewContext.uuid);
|
|
2137
2129
|
return this.viewContext;
|
|
2138
2130
|
});
|
|
@@ -2145,8 +2137,6 @@ class SmartViewContextService {
|
|
|
2145
2137
|
if (!this.messageDialogname) {
|
|
2146
2138
|
throw new Error('The messageDialogName provided by the backend has not been set.');
|
|
2147
2139
|
}
|
|
2148
|
-
console.log('init viewContext');
|
|
2149
|
-
console.log(uuid);
|
|
2150
2140
|
if (uuid) {
|
|
2151
2141
|
let subscription = this.session.headersUpdated.subscribe(() => __awaiter(this, void 0, void 0, function* () {
|
|
2152
2142
|
subscription.unsubscribe();
|
|
@@ -2172,8 +2162,6 @@ class SmartViewContextService {
|
|
|
2172
2162
|
if (!viewHandler) {
|
|
2173
2163
|
throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
|
|
2174
2164
|
}
|
|
2175
|
-
console.log(view);
|
|
2176
|
-
sessionStorage.setItem(view.viewName, view.uuid);
|
|
2177
2165
|
if (view.type === ViewType.Dialog) {
|
|
2178
2166
|
if (!viewHandler.component) {
|
|
2179
2167
|
throw new Error(`Component is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
|
|
@@ -2201,6 +2189,7 @@ class SmartViewContextService {
|
|
|
2201
2189
|
view.state = ViewState.Opened;
|
|
2202
2190
|
this.openedViewUuids.push(view.uuid);
|
|
2203
2191
|
this.openedViewData.push(view);
|
|
2192
|
+
sessionStorage.setItem(view.viewName, view.uuid);
|
|
2204
2193
|
this.uuidOfPageHasBeenChanged.next(view.viewName);
|
|
2205
2194
|
this.updateViewContext({
|
|
2206
2195
|
updates: [
|
|
@@ -2212,7 +2201,7 @@ class SmartViewContextService {
|
|
|
2212
2201
|
uuid: (_a = this.viewContext) === null || _a === void 0 ? void 0 : _a.uuid,
|
|
2213
2202
|
});
|
|
2214
2203
|
}
|
|
2215
|
-
closeView(view) {
|
|
2204
|
+
closeView(view, keepInSession) {
|
|
2216
2205
|
var _a;
|
|
2217
2206
|
let viewHandler = this.viewHandlers.find((handler) => handler.name === view.viewName);
|
|
2218
2207
|
if (!viewHandler) {
|
|
@@ -2241,8 +2230,10 @@ class SmartViewContextService {
|
|
|
2241
2230
|
if (index >= 0) {
|
|
2242
2231
|
this.openedViewUuids.splice(index, 1);
|
|
2243
2232
|
this.openedViewData.splice(index, 1);
|
|
2233
|
+
if (!keepInSession) {
|
|
2234
|
+
sessionStorage.removeItem(view.viewName);
|
|
2235
|
+
}
|
|
2244
2236
|
}
|
|
2245
|
-
sessionStorage.removeItem(view.viewName);
|
|
2246
2237
|
this.updateViewContext({
|
|
2247
2238
|
updates: [
|
|
2248
2239
|
{
|
|
@@ -2255,7 +2246,6 @@ class SmartViewContextService {
|
|
|
2255
2246
|
}
|
|
2256
2247
|
restoreViews(uuid) {
|
|
2257
2248
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2258
|
-
console.log('restoreViews');
|
|
2259
2249
|
if (!this.viewContext) {
|
|
2260
2250
|
yield this.getViewContext(uuid);
|
|
2261
2251
|
}
|
|
@@ -2272,7 +2262,7 @@ class SmartViewContextService {
|
|
|
2272
2262
|
this.openView(view);
|
|
2273
2263
|
break;
|
|
2274
2264
|
case ViewState.ToClose:
|
|
2275
|
-
this.closeView(view);
|
|
2265
|
+
this.closeView(view, false);
|
|
2276
2266
|
break;
|
|
2277
2267
|
}
|
|
2278
2268
|
});
|
|
@@ -2281,9 +2271,9 @@ class SmartViewContextService {
|
|
|
2281
2271
|
return !((_a = this.viewContext) === null || _a === void 0 ? void 0 : _a.views.flatMap((viewData) => viewData.uuid).includes(viewData.uuid));
|
|
2282
2272
|
});
|
|
2283
2273
|
if (viewDataToClose === null || viewDataToClose === void 0 ? void 0 : viewDataToClose.length) {
|
|
2284
|
-
viewDataToClose.map((viewData) =>
|
|
2285
|
-
|
|
2286
|
-
})
|
|
2274
|
+
viewDataToClose.map((viewData) => {
|
|
2275
|
+
this.closeView(viewData, true);
|
|
2276
|
+
});
|
|
2287
2277
|
}
|
|
2288
2278
|
this.viewContextHasBeenSynced.next();
|
|
2289
2279
|
}
|
|
@@ -4260,7 +4250,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
4260
4250
|
}
|
|
4261
4251
|
}
|
|
4262
4252
|
catch (error) {
|
|
4263
|
-
console.
|
|
4253
|
+
console.error(error);
|
|
4264
4254
|
this.model = change.value;
|
|
4265
4255
|
}
|
|
4266
4256
|
if (!change.changedWidgets && !change.changes && change.value) {
|