@smartbit4all/ng-client 1.1.21 → 1.1.22

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.
@@ -759,8 +759,6 @@ class SmartSessionService {
759
759
  throw new Error(`sessionHandlerService was not initialized. Error: ${sessionError.code}`);
760
760
  }
761
761
  addHeaderParam(headerParam) {
762
- console.log('addHeaderParam called ');
763
- console.log(headerParam);
764
762
  if (this.headerParams.find((h) => h.headerName === headerParam.headerName)) {
765
763
  let index = this.headerParams.findIndex((h) => h.headerName === headerParam.headerName);
766
764
  this.headerParams[index].value = headerParam.value;
@@ -771,13 +769,10 @@ class SmartSessionService {
771
769
  this.headersUpdated.next();
772
770
  }
773
771
  setUpTokenForSessionService() {
774
- if (this.headerParams.find((header) => header.headerName === 'Authorization')) {
775
- let index = this.headerParams.findIndex((header) => header.headerName === 'Authorization');
776
- this.headerParams[index].value = `Bearer ${this.token}`;
777
- }
778
- else {
779
- this.addHeaderParam({ headerName: 'Authorization', value: `Bearer ${this.token}` });
780
- }
772
+ this.addHeaderParam({
773
+ headerName: 'Authorization',
774
+ value: `Bearer ${this.token}`,
775
+ });
781
776
  }
782
777
  setUrl(url) {
783
778
  this.basePath = url;
@@ -2184,7 +2179,6 @@ class SmartViewContextService {
2184
2179
  sessionStorage.clear();
2185
2180
  }
2186
2181
  setTabId(tabId) {
2187
- console.log('setTabId ' + tabId);
2188
2182
  sessionStorage.setItem(this.tabIdName, tabId);
2189
2183
  this.session.addHeaderParam({
2190
2184
  headerName: this.tabIdhttpHeaderName,
@@ -2192,7 +2186,6 @@ class SmartViewContextService {
2192
2186
  });
2193
2187
  }
2194
2188
  async startViewContext() {
2195
- console.log('startViewContext');
2196
2189
  this.clearSessionStorage();
2197
2190
  let newViewContext = await this.view
2198
2191
  .createViewContext()
@@ -2201,7 +2194,6 @@ class SmartViewContextService {
2201
2194
  throw new Error('No ViewContext was created');
2202
2195
  }
2203
2196
  this.viewContext = newViewContext;
2204
- console.log(this.viewContext);
2205
2197
  this.setTabId(newViewContext.uuid);
2206
2198
  return this.viewContext;
2207
2199
  }
@@ -2212,8 +2204,6 @@ class SmartViewContextService {
2212
2204
  if (!this.messageDialogname) {
2213
2205
  throw new Error('The messageDialogName provided by the backend has not been set.');
2214
2206
  }
2215
- console.log('init viewContext');
2216
- console.log(uuid);
2217
2207
  if (uuid) {
2218
2208
  let subscription = this.session.headersUpdated.subscribe(async () => {
2219
2209
  subscription.unsubscribe();
@@ -2237,8 +2227,6 @@ class SmartViewContextService {
2237
2227
  if (!viewHandler) {
2238
2228
  throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
2239
2229
  }
2240
- console.log(view);
2241
- sessionStorage.setItem(view.viewName, view.uuid);
2242
2230
  if (view.type === ViewType.Dialog) {
2243
2231
  if (!viewHandler.component) {
2244
2232
  throw new Error(`Component is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
@@ -2266,6 +2254,7 @@ class SmartViewContextService {
2266
2254
  view.state = ViewState.Opened;
2267
2255
  this.openedViewUuids.push(view.uuid);
2268
2256
  this.openedViewData.push(view);
2257
+ sessionStorage.setItem(view.viewName, view.uuid);
2269
2258
  this.uuidOfPageHasBeenChanged.next(view.viewName);
2270
2259
  this.updateViewContext({
2271
2260
  updates: [
@@ -2305,8 +2294,8 @@ class SmartViewContextService {
2305
2294
  if (index >= 0) {
2306
2295
  this.openedViewUuids.splice(index, 1);
2307
2296
  this.openedViewData.splice(index, 1);
2297
+ sessionStorage.removeItem(view.viewName);
2308
2298
  }
2309
- sessionStorage.removeItem(view.viewName);
2310
2299
  this.updateViewContext({
2311
2300
  updates: [
2312
2301
  {
@@ -2318,7 +2307,6 @@ class SmartViewContextService {
2318
2307
  });
2319
2308
  }
2320
2309
  async restoreViews(uuid) {
2321
- console.log('restoreViews');
2322
2310
  if (!this.viewContext) {
2323
2311
  await this.getViewContext(uuid);
2324
2312
  }
@@ -2341,8 +2329,8 @@ class SmartViewContextService {
2341
2329
  .flatMap((viewData) => viewData.uuid)
2342
2330
  .includes(viewData.uuid));
2343
2331
  if (viewDataToClose?.length) {
2344
- viewDataToClose.map(async (viewData) => {
2345
- await this.closeView(viewData);
2332
+ viewDataToClose.map((viewData) => {
2333
+ this.closeView(viewData);
2346
2334
  });
2347
2335
  }
2348
2336
  this.viewContextHasBeenSynced.next();
@@ -4242,7 +4230,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4242
4230
  }
4243
4231
  }
4244
4232
  catch (error) {
4245
- console.log(error);
4233
+ console.error(error);
4246
4234
  this.model = change.value;
4247
4235
  }
4248
4236
  if (!change.changedWidgets && !change.changes && change.value) {