ngx-vector-components 4.11.0 → 4.11.1

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.
@@ -53,7 +53,7 @@ import * as i2$2 from 'primeng/api';
53
53
  import { DateTime } from 'luxon';
54
54
  import * as i1$2 from '@angular/common/http';
55
55
  import { HttpHeaders, HttpClient, HttpResponse } from '@angular/common/http';
56
- import { tap, map, debounceTime, catchError, switchMap, filter, take } from 'rxjs/operators';
56
+ import { tap, map, debounceTime, switchMap, catchError, filter, take } from 'rxjs/operators';
57
57
  import * as i1$3 from '@ngx-translate/core';
58
58
  import * as i1$b from 'primeng/accordion';
59
59
  import { AccordionModule } from 'primeng/accordion';
@@ -1285,7 +1285,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
1285
1285
  }] });
1286
1286
 
1287
1287
  class StorageService {
1288
- constructor() { }
1288
+ constructor(http) {
1289
+ this.http = http;
1290
+ }
1289
1291
  clear() {
1290
1292
  sessionStorage.clear();
1291
1293
  localStorage.clear();
@@ -1351,7 +1353,7 @@ class StorageService {
1351
1353
  sessionStorage.removeItem('username');
1352
1354
  }
1353
1355
  getUserId() {
1354
- const userId = sessionStorage.getItem('userId') || '';
1356
+ const userId = sessionStorage.getItem('userId');
1355
1357
  return userId ? +atob(userId) : 0;
1356
1358
  }
1357
1359
  setUserId(userId) {
@@ -1380,12 +1382,12 @@ class StorageService {
1380
1382
  sessionStorage.removeItem('profile');
1381
1383
  }
1382
1384
  }
1383
- StorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1385
+ StorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: StorageService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1384
1386
  StorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: StorageService, providedIn: 'root' });
1385
1387
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: StorageService, decorators: [{
1386
1388
  type: Injectable,
1387
1389
  args: [{ providedIn: 'root' }]
1388
- }], ctorParameters: function () { return []; } });
1390
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
1389
1391
 
1390
1392
  class ProfileService {
1391
1393
  constructor(http, storageService) {
@@ -1467,6 +1469,9 @@ class ProfileService {
1467
1469
  }
1468
1470
  return false;
1469
1471
  }
1472
+ getUserInfo() {
1473
+ return this.http.get(`connect/userinfo`);
1474
+ }
1470
1475
  }
1471
1476
  ProfileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ProfileService, deps: [{ token: i1$2.HttpClient }, { token: StorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1472
1477
  ProfileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ProfileService, providedIn: 'root' });
@@ -3588,10 +3593,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3588
3593
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
3589
3594
 
3590
3595
  class GetTokenByGuidGuard {
3591
- constructor(authService, storageService, router, appName) {
3596
+ constructor(authService, storageService, router, profileService, appName) {
3592
3597
  this.authService = authService;
3593
3598
  this.storageService = storageService;
3594
3599
  this.router = router;
3600
+ this.profileService = profileService;
3595
3601
  this.appName = appName;
3596
3602
  }
3597
3603
  canActivate(route) {
@@ -3602,11 +3608,16 @@ class GetTokenByGuidGuard {
3602
3608
  this.storageService.clear();
3603
3609
  this.storageService.setRole(route.queryParams['role']);
3604
3610
  this.storageService.setUserId(route.queryParams['userId']);
3605
- return this.authService.getTokenByGuid(paramTokenGuid).pipe(map((token) => {
3611
+ return this.authService.getTokenByGuid(paramTokenGuid).pipe(switchMap((token) => {
3606
3612
  if (token && role !== Role.ADMIN) {
3607
- return this.router.createUrlTree([this.appName.toLowerCase()]);
3613
+ this.router.createUrlTree([this.appName.toLowerCase()]);
3608
3614
  }
3609
- return true;
3615
+ return this.profileService.getUserInfo().pipe(map((response) => {
3616
+ if (response.id) {
3617
+ this.storageService.setUserId(response.id);
3618
+ }
3619
+ return true;
3620
+ }));
3610
3621
  }));
3611
3622
  }
3612
3623
  else if (this.storageService.getToken()) {
@@ -3619,11 +3630,11 @@ class GetTokenByGuidGuard {
3619
3630
  return false;
3620
3631
  }
3621
3632
  }
3622
- GetTokenByGuidGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, deps: [{ token: AuthService }, { token: StorageService }, { token: i2$1.Router }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
3633
+ GetTokenByGuidGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, deps: [{ token: AuthService }, { token: StorageService }, { token: i2$1.Router }, { token: ProfileService }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
3623
3634
  GetTokenByGuidGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard });
3624
3635
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, decorators: [{
3625
3636
  type: Injectable
3626
- }], ctorParameters: function () { return [{ type: AuthService }, { type: StorageService }, { type: i2$1.Router }, { type: AppName, decorators: [{
3637
+ }], ctorParameters: function () { return [{ type: AuthService }, { type: StorageService }, { type: i2$1.Router }, { type: ProfileService }, { type: AppName, decorators: [{
3627
3638
  type: Inject,
3628
3639
  args: ['appName']
3629
3640
  }] }]; } });