@dsivd/prestations-ng 16.5.4-beta.1 → 16.5.4-beta.2

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.
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, Optional, Inject, EventEmitter, Directive, Input, ViewChildren, ViewChild, forwardRef, Output, HostBinding, Pipe, Component, ContentChildren, HostListener, NgModule, TemplateRef, ContentChild, InjectionToken } from '@angular/core';
3
3
  import * as i1$1 from '@angular/router';
4
4
  import { ActivatedRoute, NavigationStart, RouterModule, NavigationEnd, RouterLink } from '@angular/router';
5
- import { of, BehaviorSubject, combineLatest, Subject, throwError, tap as tap$1, concat, toArray, EMPTY, merge, withLatestFrom, debounceTime as debounceTime$1, switchMap as switchMap$1, map as map$1 } from 'rxjs';
5
+ import { of, BehaviorSubject, combineLatest, Subject, throwError, tap as tap$1, concat, toArray, EMPTY, merge, withLatestFrom, debounceTime as debounceTime$1, map as map$1 } from 'rxjs';
6
6
  import { map, shareReplay, debounceTime, catchError, switchMap, tap, first, filter, throttleTime, mergeMap, share, finalize, distinctUntilChanged } from 'rxjs/operators';
7
7
  import * as i1 from '@angular/common/http';
8
- import { HttpResponse, HttpErrorResponse, HttpParams, HttpEventType, HTTP_INTERCEPTORS, HttpClientModule, HttpClient } from '@angular/common/http';
8
+ import { HttpResponseBase, HttpErrorResponse, HttpParams, HttpEventType, HttpResponse, HTTP_INTERCEPTORS, HttpClientModule, HttpClient } from '@angular/common/http';
9
9
  import * as i3 from '@angular/forms';
10
10
  import { NgModel, NgForm, FormsModule } from '@angular/forms';
11
11
  import * as i2 from '@angular/common';
@@ -1420,7 +1420,7 @@ class IamExpiredInterceptorService {
1420
1420
  }
1421
1421
  intercept(req, next) {
1422
1422
  return next.handle(req).pipe(map(event => {
1423
- if (event instanceof HttpResponse) {
1423
+ if (event instanceof HttpResponseBase) {
1424
1424
  if (hasIamExpiredHeader(event) ||
1425
1425
  isRedirectionToLogin(event)) {
1426
1426
  this._isIamSessionExpired.next(true);
@@ -12919,28 +12919,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
12919
12919
  }] });
12920
12920
 
12921
12921
  class RedirectComponent {
12922
- constructor(iamInterceptor, foehnPageModalService, sessionInfo) {
12922
+ constructor(iamInterceptor, foehnPageModalService) {
12923
12923
  this.iamInterceptor = iamInterceptor;
12924
12924
  this.foehnPageModalService = foehnPageModalService;
12925
- this.sessionInfo = sessionInfo;
12926
- this.redirectUrl = '';
12927
- this.sessionInfo.data
12928
- .pipe(first(), switchMap$1(data => {
12929
- if (!data || !!data.context) {
12930
- // not connected or connected cyber
12931
- return this.foehnPageModalService.buildSelfRedirectionThroughCyberLogin();
12932
- }
12933
- // connected ACV, refresh page
12934
- return of('');
12935
- }), tap(redirectUrl => {
12936
- this.redirectUrl = redirectUrl;
12937
- }))
12938
- // eslint-disable-next-line rxjs-angular/prefer-async-pipe
12939
- .subscribe( /* redirect url should be calculated when the user is still connected to know if IAM or Cyber*/);
12925
+ this.redirectUrl = this.foehnPageModalService.buildSelfRedirectionThroughCyberLogin();
12940
12926
  this.isModalVisible = this.iamInterceptor.isIamSessionExpired.pipe(first(), tap(() => this.startTimer()));
12941
12927
  }
12942
12928
  reloadPage() {
12943
- window.location.href = this.redirectUrl;
12929
+ this.redirectUrl
12930
+ // eslint-disable-next-line rxjs-angular/prefer-async-pipe
12931
+ .subscribe(redirectUrl => {
12932
+ window.location.href = redirectUrl;
12933
+ });
12944
12934
  }
12945
12935
  startTimer() {
12946
12936
  this.counter = 10;
@@ -12953,12 +12943,12 @@ class RedirectComponent {
12953
12943
  }, 1000);
12954
12944
  }
12955
12945
  }
12956
- RedirectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RedirectComponent, deps: [{ token: IamExpiredInterceptorService }, { token: FoehnPageModalService }, { token: SessionInfo }], target: i0.ɵɵFactoryTarget.Component });
12957
- RedirectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RedirectComponent, selector: "redirector", ngImport: i0, template: "<foehn-modal\n [modalHeaderText]=\"'Information'\"\n [isModalVisible]=\"isModalVisible | async\"\n [closeable]=\"false\"\n>\n <p>Votre session a expir\u00E9.</p>\n <p>\n Vous pouvez\n <a [href]=\"redirectUrl\">vous connecter</a>\n \u00E0 nouveau pour continuer \u00E0 utiliser nos services.\n </p>\n\n <div modal-footer class=\"w-100 text-right font-weight-bold\">\n Vous allez \u00EAtre redirig\u00E9 dans {{ counter }} s.\n </div>\n</foehn-modal>\n", dependencies: [{ kind: "component", type: FoehnModalComponent, selector: "foehn-modal", inputs: ["id", "name", "modalSize", "modalBodyText", "modalHeaderText", "closeable", "modalTriggerHtmlElement", "isModalVisible"], outputs: ["isModalVisibleChange"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
12946
+ RedirectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RedirectComponent, deps: [{ token: IamExpiredInterceptorService }, { token: FoehnPageModalService }], target: i0.ɵɵFactoryTarget.Component });
12947
+ RedirectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RedirectComponent, selector: "redirector", ngImport: i0, template: "<foehn-modal\n [modalHeaderText]=\"'Information'\"\n [isModalVisible]=\"isModalVisible | async\"\n [closeable]=\"false\"\n>\n <p>Votre session a expir\u00E9.</p>\n <p>\n Vous pouvez\n <a [href]=\"redirectUrl | async\">vous connecter</a>\n \u00E0 nouveau pour continuer \u00E0 utiliser nos services.\n </p>\n\n <div modal-footer class=\"w-100 text-right font-weight-bold\">\n Vous allez \u00EAtre redirig\u00E9 dans {{ counter }} s.\n </div>\n</foehn-modal>\n", dependencies: [{ kind: "component", type: FoehnModalComponent, selector: "foehn-modal", inputs: ["id", "name", "modalSize", "modalBodyText", "modalHeaderText", "closeable", "modalTriggerHtmlElement", "isModalVisible"], outputs: ["isModalVisibleChange"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
12958
12948
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RedirectComponent, decorators: [{
12959
12949
  type: Component,
12960
- args: [{ selector: 'redirector', template: "<foehn-modal\n [modalHeaderText]=\"'Information'\"\n [isModalVisible]=\"isModalVisible | async\"\n [closeable]=\"false\"\n>\n <p>Votre session a expir\u00E9.</p>\n <p>\n Vous pouvez\n <a [href]=\"redirectUrl\">vous connecter</a>\n \u00E0 nouveau pour continuer \u00E0 utiliser nos services.\n </p>\n\n <div modal-footer class=\"w-100 text-right font-weight-bold\">\n Vous allez \u00EAtre redirig\u00E9 dans {{ counter }} s.\n </div>\n</foehn-modal>\n" }]
12961
- }], ctorParameters: function () { return [{ type: IamExpiredInterceptorService }, { type: FoehnPageModalService }, { type: SessionInfo }]; } });
12950
+ args: [{ selector: 'redirector', template: "<foehn-modal\n [modalHeaderText]=\"'Information'\"\n [isModalVisible]=\"isModalVisible | async\"\n [closeable]=\"false\"\n>\n <p>Votre session a expir\u00E9.</p>\n <p>\n Vous pouvez\n <a [href]=\"redirectUrl | async\">vous connecter</a>\n \u00E0 nouveau pour continuer \u00E0 utiliser nos services.\n </p>\n\n <div modal-footer class=\"w-100 text-right font-weight-bold\">\n Vous allez \u00EAtre redirig\u00E9 dans {{ counter }} s.\n </div>\n</foehn-modal>\n" }]
12951
+ }], ctorParameters: function () { return [{ type: IamExpiredInterceptorService }, { type: FoehnPageModalService }]; } });
12962
12952
 
12963
12953
  class SdkRedirectModule {
12964
12954
  }