@smartbit4all/ng-client 1.1.27 → 1.1.29

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.
Files changed (37) hide show
  1. package/esm2020/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.component.mjs +2 -2
  2. package/esm2020/lib/session/dev-tool/smart-dev-tool-floating-button/smart-dev-tool-floating-button.component.mjs +10 -10
  3. package/esm2020/lib/session/dev-tool/smart-dev-tool.service.mjs +26 -22
  4. package/esm2020/lib/session/smart-header-maintainer.interceptor.mjs +14 -11
  5. package/esm2020/lib/session/smart-session.service.mjs +12 -6
  6. package/esm2020/lib/session/smart-timer/smart-session-timer.component.mjs +6 -6
  7. package/esm2020/lib/session/smart-timer/smart-session-timer.service.mjs +9 -8
  8. package/esm2020/lib/smart-client/projects.mjs +5 -6
  9. package/esm2020/lib/smart-client/smart-authentication.service.mjs +10 -4
  10. package/esm2020/lib/smart-client/smart-component-api-client.mjs +2 -2
  11. package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-confirm-dialog/ui-action-confirm-dialog.service.mjs +13 -12
  12. package/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.service.mjs +13 -12
  13. package/esm2020/lib/view-context/smart-ui-action/ui-action.descriptor.service.mjs +3 -2
  14. package/esm2020/lib/view-context/smart-ui-action/ui-action.service.mjs +9 -3
  15. package/esm2020/lib/view-context/smart-view-context.module.mjs +18 -18
  16. package/esm2020/lib/view-context/smart-view-context.service.mjs +13 -7
  17. package/fesm2015/smartbit4all-ng-client.mjs +99 -92
  18. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  19. package/fesm2020/smartbit4all-ng-client.mjs +99 -92
  20. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  21. package/lib/session/dev-tool/smart-dev-tool-floating-button/smart-dev-tool-floating-button.component.d.ts +2 -2
  22. package/lib/session/dev-tool/smart-dev-tool.service.d.ts +8 -6
  23. package/lib/session/smart-header-maintainer.interceptor.d.ts +3 -3
  24. package/lib/session/smart-session.service.d.ts +4 -1
  25. package/lib/session/smart-timer/smart-session-timer.component.d.ts +2 -2
  26. package/lib/session/smart-timer/smart-session-timer.service.d.ts +3 -3
  27. package/lib/smart-client/projects.d.ts +4 -5
  28. package/lib/smart-client/smart-authentication.service.d.ts +5 -2
  29. package/lib/view-context/smart-ui-action/dialogs/ui-action-confirm-dialog/ui-action-confirm-dialog.service.d.ts +5 -5
  30. package/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.service.d.ts +6 -6
  31. package/lib/view-context/smart-ui-action/ui-action.service.d.ts +4 -1
  32. package/lib/view-context/smart-view-context.service.d.ts +4 -2
  33. package/package.json +1 -1
  34. package/smartbit4all-ng-client-1.1.29.tgz +0 -0
  35. package/esm2020/lib/smart-client/smart.subject.mjs +0 -21
  36. package/lib/smart-client/smart.subject.d.ts +0 -6
  37. package/smartbit4all-ng-client-1.1.27.tgz +0 -0
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Pipe, CUSTOM_ELEMENTS_SCHEMA, ViewChild, Input } from '@angular/core';
3
3
  import { Subject, takeUntil, map, catchError, throwError, from } from 'rxjs';
4
+ import { SmartSubject } from '@smartbit4all/subject';
4
5
  import * as i1 from '@angular/common/http';
5
6
  import { HttpHeaders, HttpContext, HttpEventType, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
6
7
  import * as i4 from '@angular/common';
@@ -730,14 +731,15 @@ class SmartSessionService {
730
731
  constructor(apiService, cookieService) {
731
732
  this.apiService = apiService;
732
733
  this.cookieService = cookieService;
734
+ this._destroy$ = new Subject();
733
735
  this.isAuthenticated = false;
734
- this.authenticationStateChanged = new Subject();
736
+ this.authenticationStateChanged = new SmartSubject(this._destroy$);
735
737
  this.headerParams = new Array();
736
- this.headersUpdated = new Subject();
738
+ this.headersUpdated = new SmartSubject(this._destroy$);
737
739
  // Locale
738
740
  this.localStorageLocaleName = 'locale';
739
- this.localeChanged = new Subject();
740
- this.sessionExpiracyChanged = new Subject();
741
+ this.localeChanged = new SmartSubject(this._destroy$);
742
+ this.sessionExpiracyChanged = new SmartSubject(this._destroy$);
741
743
  }
742
744
  get sessionInfoData() {
743
745
  return this._sessionInfoData;
@@ -749,6 +751,10 @@ class SmartSessionService {
749
751
  this.sessionExpiracyChanged.next();
750
752
  }
751
753
  }
754
+ ngOnDestroy() {
755
+ this._destroy$.next();
756
+ this._destroy$.complete();
757
+ }
752
758
  setSessionHandlerService(smartSessionHandlerService) {
753
759
  this.sessionHandlerService = smartSessionHandlerService;
754
760
  }
@@ -815,7 +821,7 @@ class SmartSessionService {
815
821
  return this.initializeRunning.toPromise();
816
822
  }
817
823
  else {
818
- this.initializeRunning = new Subject();
824
+ this.initializeRunning = new SmartSubject(this._destroy$);
819
825
  try {
820
826
  this.checkStatements();
821
827
  let tokenFromLocalStorage = localStorage.getItem('token');
@@ -2104,13 +2110,14 @@ class SmartViewContextService {
2104
2110
  this.viewHandlers = new Array();
2105
2111
  this.openedViewUuids = new Array();
2106
2112
  this.openedViewData = new Array();
2107
- this.uuidOfPageHasBeenChanged = new Subject();
2108
- this.viewContextHasBeenSynced = new Subject();
2109
- this.openSmartLink = new Subject();
2113
+ this._destroy$ = new Subject();
2114
+ this.uuidOfPageHasBeenChanged = new SmartSubject(this._destroy$);
2115
+ this.viewContextHasBeenSynced = new SmartSubject(this._destroy$);
2116
+ this.openSmartLink = new SmartSubject(this._destroy$);
2110
2117
  this.isOpeningSmartLink = false;
2111
2118
  this.dialogRefs = [];
2112
2119
  this.smartApiClients = new Map();
2113
- this.translateServiceChanged = new Subject();
2120
+ this.translateServiceChanged = new SmartSubject(this._destroy$);
2114
2121
  }
2115
2122
  set translateService(translateService) {
2116
2123
  this._translateService = translateService;
@@ -2123,6 +2130,10 @@ class SmartViewContextService {
2123
2130
  }
2124
2131
  return undefined;
2125
2132
  }
2133
+ ngOnDestroy() {
2134
+ this._destroy$.next();
2135
+ this._destroy$.complete();
2136
+ }
2126
2137
  follow(uuid, detectChange) {
2127
2138
  this.smartApiClients.set(uuid, detectChange);
2128
2139
  }
@@ -2221,7 +2232,7 @@ class SmartViewContextService {
2221
2232
  return this.initializeRunning.toPromise();
2222
2233
  }
2223
2234
  else {
2224
- this.initializeRunning = new Subject();
2235
+ this.initializeRunning = new SmartSubject(this._destroy$);
2225
2236
  try {
2226
2237
  if (this.viewHandlers.length === 0) {
2227
2238
  throw new Error("There aren't any viewHandlers in SmartViewContextService! Provide some to use its functions.");
@@ -2544,7 +2555,7 @@ class ApiQueueService {
2544
2555
  this._destroy$ = new Subject();
2545
2556
  this.queue = [];
2546
2557
  this.isProcessing = false;
2547
- this.queueSubject = new Subject();
2558
+ this.queueSubject = new SmartSubject(this._destroy$);
2548
2559
  this.queueSubject.pipe(takeUntil(this._destroy$)).subscribe(() => this.processQueue());
2549
2560
  }
2550
2561
  ngOnDestroy() {
@@ -2602,16 +2613,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2602
2613
  class SmartDevToolService {
2603
2614
  constructor(cookieService) {
2604
2615
  this.cookieService = cookieService;
2605
- this.smartDevToolName = "smartDevTool";
2606
- this.isSmartDevToolActiveName = "smartDevToolActive";
2616
+ this.smartDevToolName = 'smartDevTool';
2617
+ this.isSmartDevToolActiveName = 'smartDevToolActive';
2607
2618
  this.isActive = false;
2608
- this.smartDevToolHoursName = "smartDevToolHours";
2609
- this.smartDevToolMaxName = "smartDevToolMaxCalls";
2619
+ this.smartDevToolHoursName = 'smartDevToolHours';
2620
+ this.smartDevToolMaxName = 'smartDevToolMaxCalls';
2610
2621
  this.hoursToSave = 1;
2611
2622
  this.maxNumOfSavedCalls = 50;
2612
- this.descriptorChanged = new Subject();
2623
+ this._destroy$ = new Subject();
2624
+ this.descriptorChanged = new SmartSubject(this._destroy$);
2613
2625
  this.newErrorsCount = 0;
2614
- this.newErrorsCountChanged = new Subject();
2626
+ this.newErrorsCountChanged = new SmartSubject(this._destroy$);
2615
2627
  this.setUpLocalStorage();
2616
2628
  let apiCallsFromLocalStorage = localStorage.getItem(this.smartDevToolName);
2617
2629
  if (apiCallsFromLocalStorage) {
@@ -2621,9 +2633,9 @@ class SmartDevToolService {
2621
2633
  this.descriptor = { apiCalls: [] };
2622
2634
  this.save();
2623
2635
  }
2624
- window.addEventListener("storage", (event) => {
2636
+ window.addEventListener('storage', (event) => {
2625
2637
  if (event.storageArea === localStorage) {
2626
- this.isActive = localStorage.getItem(this.isSmartDevToolActiveName) === "true";
2638
+ this.isActive = localStorage.getItem(this.isSmartDevToolActiveName) === 'true';
2627
2639
  let hoursToSaveString = localStorage.getItem(this.smartDevToolHoursName);
2628
2640
  if (hoursToSaveString) {
2629
2641
  this.hoursToSave = Number.parseInt(hoursToSaveString);
@@ -2635,10 +2647,14 @@ class SmartDevToolService {
2635
2647
  }
2636
2648
  });
2637
2649
  }
2650
+ ngOnDestroy() {
2651
+ this._destroy$.next();
2652
+ this._destroy$.complete();
2653
+ }
2638
2654
  setUpLocalStorage() {
2639
2655
  let keysOfLocalStorage = Object.keys(localStorage);
2640
2656
  if (!keysOfLocalStorage.includes(this.isSmartDevToolActiveName)) {
2641
- localStorage.setItem(this.isSmartDevToolActiveName, "true");
2657
+ localStorage.setItem(this.isSmartDevToolActiveName, 'true');
2642
2658
  }
2643
2659
  }
2644
2660
  writeResponse(request, response, requestDate, responseDate) {
@@ -2693,19 +2709,17 @@ class SmartDevToolService {
2693
2709
  let now = new Date();
2694
2710
  this.descriptor.apiCalls = this.descriptor.apiCalls.filter((apiCall) => {
2695
2711
  let hoursBetween;
2696
- if (typeof apiCall.requestDate === "string") {
2712
+ if (typeof apiCall.requestDate === 'string') {
2697
2713
  hoursBetween = Math.floor(Math.abs(now.getMilliseconds() - new Date(apiCall.requestDate).getMilliseconds()) / 36e5);
2698
2714
  }
2699
2715
  else {
2700
- hoursBetween = Math.floor(Math.abs(now.getMilliseconds() - apiCall.requestDate.getMilliseconds()) /
2701
- 36e5);
2716
+ hoursBetween = Math.floor(Math.abs(now.getMilliseconds() - apiCall.requestDate.getMilliseconds()) / 36e5);
2702
2717
  }
2703
2718
  return hoursBetween < this.hoursToSave;
2704
2719
  });
2705
2720
  }
2706
2721
  sanitizeByLength() {
2707
- if (this.descriptor?.apiCalls &&
2708
- this.descriptor.apiCalls.length > this.maxNumOfSavedCalls) {
2722
+ if (this.descriptor?.apiCalls && this.descriptor.apiCalls.length > this.maxNumOfSavedCalls) {
2709
2723
  let length = this.descriptor.apiCalls.length;
2710
2724
  this.descriptor.apiCalls.splice(this.maxNumOfSavedCalls - 1, length - this.maxNumOfSavedCalls);
2711
2725
  }
@@ -2734,15 +2748,15 @@ class SmartDevToolService {
2734
2748
  }
2735
2749
  }
2736
2750
  SmartDevToolService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolService, deps: [{ token: SmartCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
2737
- SmartDevToolService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolService, providedIn: "root" });
2751
+ SmartDevToolService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolService, providedIn: 'root' });
2738
2752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolService, decorators: [{
2739
2753
  type: Injectable,
2740
2754
  args: [{
2741
- providedIn: "root",
2755
+ providedIn: 'root',
2742
2756
  }]
2743
2757
  }], ctorParameters: function () { return [{ type: SmartCookieService }]; } });
2744
2758
  class SmartDevToolDatePipe extends DatePipe {
2745
- transform(value, format = "yyyy.MM.dd. H:mm:ss") {
2759
+ transform(value, format = 'yyyy.MM.dd. H:mm:ss') {
2746
2760
  return super.transform(value, format);
2747
2761
  }
2748
2762
  }
@@ -2751,7 +2765,7 @@ SmartDevToolDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", versi
2751
2765
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolDatePipe, decorators: [{
2752
2766
  type: Pipe,
2753
2767
  args: [{
2754
- name: "smartDevToolDatePipe",
2768
+ name: 'smartDevToolDatePipe',
2755
2769
  }]
2756
2770
  }] });
2757
2771
 
@@ -2836,7 +2850,7 @@ class SmartDevToolDialogComponent {
2836
2850
  }
2837
2851
  copy() {
2838
2852
  copyToClipboard({
2839
- value: this.service.getPureString()
2853
+ value: this.service.getPureString(),
2840
2854
  });
2841
2855
  }
2842
2856
  close() {
@@ -2876,20 +2890,20 @@ class SmartDevToolFloatingButtonComponent {
2876
2890
  constructor(service) {
2877
2891
  this.service = service;
2878
2892
  this._destroy$ = new Subject();
2879
- this.adminKeyName = "useDevTool";
2893
+ this.adminKeyName = 'useDevTool';
2880
2894
  this.isShown = false;
2881
- this.errorsCount = "";
2895
+ this.errorsCount = '';
2882
2896
  this.service.service.newErrorsCountChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
2883
- this.errorsCount = `${this.service.service.newErrorsCount > 0 ? this.service.service.newErrorsCount : ""}`;
2897
+ this.errorsCount = `${this.service.service.newErrorsCount > 0 ? this.service.service.newErrorsCount : ''}`;
2884
2898
  });
2885
- window.addEventListener("storage", (event) => {
2899
+ window.addEventListener('storage', (event) => {
2886
2900
  if (event.storageArea === localStorage) {
2887
2901
  if (Object.keys(localStorage).includes(this.adminKeyName)) {
2888
- this.isShown = localStorage.getItem(this.adminKeyName) === "true";
2902
+ this.isShown = localStorage.getItem(this.adminKeyName) === 'true';
2889
2903
  }
2890
2904
  }
2891
2905
  });
2892
- this.isShown = localStorage.getItem(this.adminKeyName) === "true";
2906
+ this.isShown = localStorage.getItem(this.adminKeyName) === 'true';
2893
2907
  }
2894
2908
  ngOnDestroy() {
2895
2909
  this._destroy$.next();
@@ -2902,7 +2916,7 @@ SmartDevToolFloatingButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion
2902
2916
  SmartDevToolFloatingButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartDevToolFloatingButtonComponent, selector: "smart-session-dev-tool", ngImport: i0, template: "<button\r\n *ngIf=\"isShown\"\r\n mat-fab\r\n [color]=\"errorsCount.length ? 'warn' : 'accent'\"\r\n class=\"floatingButton\"\r\n extended\r\n title=\"devTool\"\r\n (click)=\"openDevToolDialog()\"\r\n>\r\n <smart-icon color=\"white\" icon=\"developer_mode\"></smart-icon>\r\n {{ errorsCount }}\r\n</button>\r\n", styles: [".floatingButton{position:fixed;right:2rem;bottom:2rem}.mat-icon.mat-white{color:#fff}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2903
2917
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartDevToolFloatingButtonComponent, decorators: [{
2904
2918
  type: Component,
2905
- args: [{ selector: "smart-session-dev-tool", template: "<button\r\n *ngIf=\"isShown\"\r\n mat-fab\r\n [color]=\"errorsCount.length ? 'warn' : 'accent'\"\r\n class=\"floatingButton\"\r\n extended\r\n title=\"devTool\"\r\n (click)=\"openDevToolDialog()\"\r\n>\r\n <smart-icon color=\"white\" icon=\"developer_mode\"></smart-icon>\r\n {{ errorsCount }}\r\n</button>\r\n", styles: [".floatingButton{position:fixed;right:2rem;bottom:2rem}.mat-icon.mat-white{color:#fff}\n"] }]
2919
+ args: [{ selector: 'smart-session-dev-tool', template: "<button\r\n *ngIf=\"isShown\"\r\n mat-fab\r\n [color]=\"errorsCount.length ? 'warn' : 'accent'\"\r\n class=\"floatingButton\"\r\n extended\r\n title=\"devTool\"\r\n (click)=\"openDevToolDialog()\"\r\n>\r\n <smart-icon color=\"white\" icon=\"developer_mode\"></smart-icon>\r\n {{ errorsCount }}\r\n</button>\r\n", styles: [".floatingButton{position:fixed;right:2rem;bottom:2rem}.mat-icon.mat-white{color:#fff}\n"] }]
2906
2920
  }], ctorParameters: function () { return [{ type: SmartDevToolDialogService }]; } });
2907
2921
 
2908
2922
  class SmartDevToolInterceptor {
@@ -2963,9 +2977,9 @@ class SmartSessionTimerService {
2963
2977
  this.session = session;
2964
2978
  this._destroy$ = new Subject();
2965
2979
  this.totalTimeInMinutes = 30;
2966
- this.sessionExpiration = "sessionExpiracy";
2967
- this.timeChanged = new Subject();
2968
- this.onTimerExpired = new Subject();
2980
+ this.sessionExpiration = 'sessionExpiracy';
2981
+ this.timeChanged = new SmartSubject(this._destroy$);
2982
+ this.onTimerExpired = new SmartSubject(this._destroy$);
2969
2983
  this.session.sessionExpiracyChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
2970
2984
  this.restart();
2971
2985
  });
@@ -2997,11 +3011,11 @@ class SmartSessionTimerService {
2997
3011
  }
2998
3012
  }
2999
3013
  SmartSessionTimerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerService, deps: [{ token: SmartSessionService }], target: i0.ɵɵFactoryTarget.Injectable });
3000
- SmartSessionTimerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerService, providedIn: "root" });
3014
+ SmartSessionTimerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerService, providedIn: 'root' });
3001
3015
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerService, decorators: [{
3002
3016
  type: Injectable,
3003
3017
  args: [{
3004
- providedIn: "root",
3018
+ providedIn: 'root',
3005
3019
  }]
3006
3020
  }], ctorParameters: function () { return [{ type: SmartSessionService }]; } });
3007
3021
 
@@ -3024,14 +3038,14 @@ class SmartSessionTimerComponent {
3024
3038
  formatTime(seconds) {
3025
3039
  let minutes = Math.floor(seconds / 60);
3026
3040
  let remainingSeconds = seconds % 60;
3027
- return `${minutes}:${remainingSeconds < 10 ? "0" : ""}${remainingSeconds}`;
3041
+ return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
3028
3042
  }
3029
3043
  }
3030
3044
  SmartSessionTimerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerComponent, deps: [{ token: SmartSessionTimerService }], target: i0.ɵɵFactoryTarget.Component });
3031
3045
  SmartSessionTimerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartSessionTimerComponent, selector: "smart-session-timer", providers: [SmartSessionTimerService], ngImport: i0, template: "<div class=\"smart-session-timer-container\">\r\n <span class=\"smart-session-timer\" *ngIf=\"timeInSeconds\">\r\n {{ formatTime(timeInSeconds!) }}\r\n </span>\r\n</div>\r\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3032
3046
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartSessionTimerComponent, decorators: [{
3033
3047
  type: Component,
3034
- args: [{ selector: "smart-session-timer", providers: [SmartSessionTimerService], template: "<div class=\"smart-session-timer-container\">\r\n <span class=\"smart-session-timer\" *ngIf=\"timeInSeconds\">\r\n {{ formatTime(timeInSeconds!) }}\r\n </span>\r\n</div>\r\n", styles: [""] }]
3048
+ args: [{ selector: 'smart-session-timer', providers: [SmartSessionTimerService], template: "<div class=\"smart-session-timer-container\">\r\n <span class=\"smart-session-timer\" *ngIf=\"timeInSeconds\">\r\n {{ formatTime(timeInSeconds!) }}\r\n </span>\r\n</div>\r\n", styles: [""] }]
3035
3049
  }], ctorParameters: function () { return [{ type: SmartSessionTimerService }]; } });
3036
3050
 
3037
3051
  /*
@@ -3108,21 +3122,24 @@ class SmartHeaderMaintainerInterceptor {
3108
3122
  this.session = session;
3109
3123
  }
3110
3124
  intercept(request, next) {
3111
- const hasHeaders = this.session.headerParams && this.session.headerParams.length;
3125
+ // new request data
3126
+ let url = request.urlWithParams.replace('http://localhost', this.session.getBasePath());
3112
3127
  let headers = {};
3128
+ // copy current headers
3129
+ request.headers.keys().map((key) => {
3130
+ let value = request.headers.getAll(key);
3131
+ if (value) {
3132
+ headers[key] = value;
3133
+ }
3134
+ });
3135
+ // add own headers
3136
+ const hasHeaders = this.session.headerParams && this.session.headerParams.length;
3113
3137
  if (hasHeaders) {
3114
3138
  this.session.headerParams.map((headerParam) => {
3115
3139
  headers[headerParam.headerName] = headerParam.value;
3116
3140
  });
3117
3141
  }
3118
- let url = request.urlWithParams.replace("http://localhost", this.session.getBasePath());
3119
- // TODO fix me
3120
- if (request.urlWithParams.includes("/kerb/sso")) {
3121
- request = request.clone({
3122
- url: url,
3123
- });
3124
- return next.handle(request);
3125
- }
3142
+ // create new request (necessary to rewrite url)
3126
3143
  request = request.clone({
3127
3144
  url: url,
3128
3145
  setHeaders: headers,
@@ -3343,7 +3360,7 @@ class UiActionDescriptorService {
3343
3360
  constructor(viewContext) {
3344
3361
  this.viewContext = viewContext;
3345
3362
  this._destroy$ = new Subject();
3346
- this.languageChanged = new Subject();
3363
+ this.languageChanged = new SmartSubject(this._destroy$);
3347
3364
  this.keysToTranslate = ['title', 'text', 'placeholder', 'caption', 'feedbackText'];
3348
3365
  this.basicActionDescriptors = new Map([
3349
3366
  [
@@ -3528,15 +3545,15 @@ class UiActionConfirmDialogService extends SmartdialogService {
3528
3545
  constructor(dialog, router) {
3529
3546
  super(dialog, router);
3530
3547
  this._destroy$ = new Subject();
3531
- this.onAction = new Subject();
3548
+ this.onAction = new SmartSubject(this._destroy$);
3532
3549
  this.shouldDoAction = false;
3533
3550
  }
3534
3551
  openDialog() {
3535
3552
  this.shouldDoAction = false;
3536
- this.onAction = new Subject();
3553
+ this.onAction = new SmartSubject(this._destroy$);
3537
3554
  const dialogData = {
3538
3555
  content: {
3539
- title: "",
3556
+ title: '',
3540
3557
  },
3541
3558
  size: {},
3542
3559
  customComponent: UiActionConfirmDialogComponent,
@@ -3547,20 +3564,20 @@ class UiActionConfirmDialogService extends SmartdialogService {
3547
3564
  this.shouldDoAction = true;
3548
3565
  this.onAction.complete();
3549
3566
  this.closeDialog();
3550
- this.onAction = new Subject();
3567
+ this.onAction = new SmartSubject(this._destroy$);
3551
3568
  }
3552
3569
  cancel() {
3553
3570
  this.onAction.complete();
3554
3571
  this.closeDialog();
3555
- this.onAction = new Subject();
3572
+ this.onAction = new SmartSubject(this._destroy$);
3556
3573
  }
3557
3574
  }
3558
3575
  UiActionConfirmDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
3559
- UiActionConfirmDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, providedIn: "root" });
3576
+ UiActionConfirmDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, providedIn: 'root' });
3560
3577
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, decorators: [{
3561
3578
  type: Injectable,
3562
3579
  args: [{
3563
- providedIn: "root",
3580
+ providedIn: 'root',
3564
3581
  }]
3565
3582
  }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
3566
3583
 
@@ -3677,7 +3694,7 @@ class UiActionInputDialogService extends SmartdialogService {
3677
3694
  constructor(dialog, router) {
3678
3695
  super(dialog, router);
3679
3696
  this._destroy$ = new Subject();
3680
- this.onAction = new Subject();
3697
+ this.onAction = new SmartSubject(this._destroy$);
3681
3698
  }
3682
3699
  setDataAndOpenDialog(action, nodeName) {
3683
3700
  this.action = action;
@@ -3686,10 +3703,10 @@ class UiActionInputDialogService extends SmartdialogService {
3686
3703
  }
3687
3704
  openDialog() {
3688
3705
  this.params = undefined;
3689
- this.onAction = new Subject();
3706
+ this.onAction = new SmartSubject(this._destroy$);
3690
3707
  const dialogData = {
3691
3708
  content: {
3692
- title: "",
3709
+ title: '',
3693
3710
  },
3694
3711
  size: {},
3695
3712
  customComponent: UiActionInputDialogComponent,
@@ -3700,20 +3717,20 @@ class UiActionInputDialogService extends SmartdialogService {
3700
3717
  this.params = params;
3701
3718
  this.onAction.complete();
3702
3719
  this.closeDialog();
3703
- this.onAction = new Subject();
3720
+ this.onAction = new SmartSubject(this._destroy$);
3704
3721
  }
3705
3722
  cancel() {
3706
3723
  this.onAction.complete();
3707
3724
  this.closeDialog();
3708
- this.onAction = new Subject();
3725
+ this.onAction = new SmartSubject(this._destroy$);
3709
3726
  }
3710
3727
  }
3711
3728
  UiActionInputDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
3712
- UiActionInputDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, providedIn: "root" });
3729
+ UiActionInputDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, providedIn: 'root' });
3713
3730
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, decorators: [{
3714
3731
  type: Injectable,
3715
3732
  args: [{
3716
- providedIn: "root",
3733
+ providedIn: 'root',
3717
3734
  }]
3718
3735
  }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
3719
3736
 
@@ -3722,6 +3739,11 @@ class UiActionService {
3722
3739
  this.confirmDialogService = confirmDialogService;
3723
3740
  this.textFieldDialogService = textFieldDialogService;
3724
3741
  this._snackBar = _snackBar;
3742
+ this._destroy$ = new Subject();
3743
+ }
3744
+ ngOnDestroy() {
3745
+ this._destroy$.next();
3746
+ this._destroy$.complete();
3725
3747
  }
3726
3748
  async execute(uiAction, options) {
3727
3749
  let uiActionRequest;
@@ -3734,12 +3756,12 @@ class UiActionService {
3734
3756
  this.uiActionModel.serviceToUse.submit.next();
3735
3757
  try {
3736
3758
  await this.uiActionModel.serviceToUse.submit.toPromise();
3737
- this.uiActionModel.serviceToUse.submit = new Subject();
3759
+ this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
3738
3760
  this.uiActionModel.serviceToUse.reSubscribeToChange.next();
3739
3761
  }
3740
3762
  catch (error) {
3741
3763
  console.error(error);
3742
- this.uiActionModel.serviceToUse.submit = new Subject();
3764
+ this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
3743
3765
  this.uiActionModel.serviceToUse.reSubscribeToChange.next();
3744
3766
  return;
3745
3767
  }
@@ -4053,7 +4075,12 @@ var UiActionDialogType;
4053
4075
  class SmartAuthService {
4054
4076
  constructor() {
4055
4077
  this.bffApisHaveBeenSetUp = false;
4056
- this.headersUpdated = new Subject();
4078
+ this._destroy$ = new Subject();
4079
+ this.headersUpdated = new SmartSubject(this._destroy$);
4080
+ }
4081
+ ngOnDestroy() {
4082
+ this._destroy$.next();
4083
+ this._destroy$.complete();
4057
4084
  }
4058
4085
  }
4059
4086
  SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -4062,26 +4089,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4062
4089
  type: Injectable
4063
4090
  }] });
4064
4091
 
4065
- class SmartSubject extends Subject {
4066
- constructor(unsubscribe$) {
4067
- super();
4068
- this.unsubscribe$ = unsubscribe$;
4069
- }
4070
- subscribe(observerOrNext, error, complete) {
4071
- if (typeof observerOrNext === "object") {
4072
- const next = observerOrNext.next;
4073
- observerOrNext.next = (value) => {
4074
- if (next) {
4075
- next.call(observerOrNext, value);
4076
- }
4077
- };
4078
- }
4079
- const subscription = super.subscribe(observerOrNext, error, complete);
4080
- subscription.add(this.unsubscribe$.subscribe());
4081
- return subscription;
4082
- }
4083
- }
4084
-
4085
4092
  let SmartComponentApiClient = class SmartComponentApiClient {
4086
4093
  constructor(inject, auth, pageName) {
4087
4094
  this.inject = inject;
@@ -4450,5 +4457,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4450
4457
  * Generated bundle index. Do not edit.
4451
4458
  */
4452
4459
 
4453
- export { APIS, ApiModule, ApiQueueService, BASE_PATH, COLLECTION_FORMATS, CloseResult, Configuration, DataChangeKind, IS_ASYNC_PARAM_NAME, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
4460
+ export { APIS, ApiModule, ApiQueueService, BASE_PATH, COLLECTION_FORMATS, CloseResult, Configuration, DataChangeKind, IS_ASYNC_PARAM_NAME, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
4454
4461
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map