@dsivd/prestations-ng 15.1.3 → 15.2.0-beta1

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.
@@ -323,12 +323,14 @@ class ApplicationInfoService {
323
323
  `${this.getPortailBaseUrl(appInfo)}100018/`;
324
324
  }));
325
325
  }
326
- getSafeSupportFormUrl() {
326
+ getSafeSupportFormUrl(reference) {
327
327
  return this.data.pipe(map(appInfo => {
328
328
  var _a, _b;
329
329
  return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.supportFormUrl) ||
330
330
  `${this.getPortailBaseUrl(appInfo)}pub/101098/`;
331
- }));
331
+ }), map(link => !!(reference === null || reference === void 0 ? void 0 : reference.length)
332
+ ? `${link}?concernedReference=${reference}`
333
+ : link));
332
334
  }
333
335
  getSafeSupportFormTitle() {
334
336
  return this.data.pipe(map(appInfo => {
@@ -596,6 +598,14 @@ class GesdemHandlerService {
596
598
  url = `${url}/validated/${reference}`;
597
599
  return this.http.get(url).pipe(tap(this.emitResponse.bind(this)), map(() => true), catchError((response) => this.handleGesdemError(reference, response)));
598
600
  }
601
+ retrieveActionStatut(reference) {
602
+ let url = 'api';
603
+ if (this.prefix) {
604
+ url = `api/${this.prefix}`;
605
+ }
606
+ url = `${url}/${reference}/action-statut`;
607
+ return this.http.get(url).pipe(map(status => status), catchError((response) => this.handleGesdemError(reference, response)));
608
+ }
599
609
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
600
610
  postToUrl(form, url) {
601
611
  if (this._lastResponse && this._lastResponse.meta.reference) {
@@ -1488,7 +1498,15 @@ const DEFAULT_DICTIONARY = {
1488
1498
  'foehn-agenda-navigation.next-week': 'Semaine suivante',
1489
1499
  'foehn-agenda-navigation.next-week-sr-only': 'Semaine suivante : {nextWeek}',
1490
1500
  'foehn-agenda-navigation.nav.aria-label': 'Changer de semaine',
1491
- 'foehn-agenda-navigation.date-picker-button.screen-reader.selected-date': 'Semaine du {selectedDate} sélectionnée'
1501
+ 'foehn-agenda-navigation.date-picker-button.screen-reader.selected-date': 'Semaine du {selectedDate} sélectionnée',
1502
+ 'gesdem-error.text.has-reference': 'Vous pouvez essayer de reprendre votre demande en cliquant sur le lien ci-dessous',
1503
+ 'gesdem-error.link.has-reference': 'Reprendre ma demande',
1504
+ 'gesdem-error.text.has-no-reference': 'Vous pouvez recommencer une demande en cliquant sur le lien ci-dessous',
1505
+ 'gesdem-error.link.has-no-reference': 'Recommencer',
1506
+ 'gesdem-error.text.pending-payment': '<p>Un problème est survenu lors de la transmission de votre demande.</p>' +
1507
+ '<p><strong>Merci de ne pas refaire une nouvelle demande tout de suite.</strong></p>' +
1508
+ "<p>Sans confirmation de la transmission de votre demande dans un délai d'un jour, " +
1509
+ 'nous vous prions de <a href="{supportLink}" target="_blank">contacter le support</a>.'
1492
1510
  };
1493
1511
 
1494
1512
  const DICTIONARY_BASE_URL = 'api/dictionary';
@@ -3334,20 +3352,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.5", ngImpor
3334
3352
  }] } });
3335
3353
 
3336
3354
  class GesdemErrorComponent {
3337
- constructor(activatedRoute, navigation, gesdemService, foehnPageService, supportAlertService) {
3355
+ constructor(activatedRoute, navigation, gesdemService, gesdemEventService, foehnPageService, supportAlertService, applicationInfoService) {
3356
+ var _a;
3338
3357
  this.activatedRoute = activatedRoute;
3339
3358
  this.navigation = navigation;
3340
3359
  this.gesdemService = gesdemService;
3360
+ this.gesdemEventService = gesdemEventService;
3341
3361
  this.foehnPageService = foehnPageService;
3342
3362
  this.supportAlertService = supportAlertService;
3363
+ this.applicationInfoService = applicationInfoService;
3343
3364
  this.setPageTitle = true;
3344
3365
  this.hasSessionExpired = false;
3345
3366
  const route = FoehnNavigationService.getRootRouteRecursive(activatedRoute.snapshot);
3346
3367
  navigation.initRoute(route);
3347
3368
  this.link = this.getBasePath();
3369
+ this.reference = this.activatedRoute.snapshot.params.reference;
3370
+ this.supportLink = this.applicationInfoService.getSafeSupportFormUrl(this.reference);
3371
+ if (!((_a = this.reference) === null || _a === void 0 ? void 0 : _a.length)) {
3372
+ this.isPendingPayment = of(false);
3373
+ }
3374
+ else {
3375
+ this.isPendingPayment = this.gesdemService
3376
+ .retrieveActionStatut(this.reference)
3377
+ .pipe(tap(statut => {
3378
+ if (GesdemStatutUtils.isFinal(statut)) {
3379
+ this.navigation.last();
3380
+ }
3381
+ }), map(statut => statut === ActionStatut.PENDING_PAYMENT), catchError(() => of(false)));
3382
+ }
3348
3383
  }
3349
3384
  ngOnInit() {
3350
- this.reference = this.activatedRoute.snapshot.params.reference;
3351
3385
  if (this.reference) {
3352
3386
  const firstPage = this.getFirstPage();
3353
3387
  if (this.gesdemService.prefix) {
@@ -3378,12 +3412,12 @@ class GesdemErrorComponent {
3378
3412
  return '/';
3379
3413
  }
3380
3414
  }
3381
- GesdemErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: FoehnNavigationService }, { token: GesdemHandlerService }, { token: FoehnPageService }, { token: SupportAlertService }], target: i0.ɵɵFactoryTarget.Component });
3382
- GesdemErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.5", type: GesdemErrorComponent, selector: "gesdem-error", inputs: { setPageTitle: "setPageTitle" }, ngImport: i0, template: "<div class=\"vd-card mb-3\" *ngIf=\"!hasSessionExpired\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"card-body\">\n <p class=\"card-text vd-card-text\">\n {{\n !!reference\n ? 'Vous pouvez essayer de reprendre votre demande en cliquant sur le lien ci-dessous'\n : 'Vous pouvez recommencer une demande en cliquant sur le lien ci-dessous'\n }}\n </p>\n <ul class=\"vd-list-links\">\n <li>\n <a [href]=\"link\">\n {{\n !!reference\n ? 'Reprendre ma demande'\n : 'Recommencer'\n }}\n </a>\n </li>\n </ul>\n <foehn-debug-summary></foehn-debug-summary>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<gesdem-action-recovery-login\n *ngIf=\"hasSessionExpired\"\n [reference]=\"reference\"\n [redirectTarget]=\"link\"\n></gesdem-action-recovery-login>\n", components: [{ type: FoehnDebugSummaryComponent, selector: "foehn-debug-summary" }, { type: GesdemActionRecoveryLoginComponent, selector: "gesdem-action-recovery-login", inputs: ["reference", "redirectTarget"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3415
+ GesdemErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: FoehnNavigationService }, { token: GesdemHandlerService }, { token: GesdemEventService }, { token: FoehnPageService }, { token: SupportAlertService }, { token: ApplicationInfoService }], target: i0.ɵɵFactoryTarget.Component });
3416
+ GesdemErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.5", type: GesdemErrorComponent, selector: "gesdem-error", inputs: { setPageTitle: "setPageTitle" }, ngImport: i0, template: "<div class=\"vd-card mb-3\" *ngIf=\"!hasSessionExpired\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"(isPendingPayment | async) === true\">\n <p\n class=\"card-text vd-card-text alert alert-danger\"\n [innerHTML]=\"\n 'gesdem-error.text.pending-payment'\n | fromDictionary\n : {\n supportLink: (supportLink | async)\n }\n \"\n ></p>\n </ng-container>\n <ng-container *ngIf=\"(isPendingPayment | async) === false\">\n <p class=\"card-text vd-card-text\">\n {{\n (!!reference\n ? 'gesdem-error.text.has-reference'\n : 'gesdem-error.text.has-no-reference'\n ) | fromDictionary\n }}\n </p>\n <ul class=\"vd-list-links\">\n <li>\n <a [href]=\"link\">\n {{\n (!!reference\n ? 'gesdem-error.link.has-reference'\n : 'gesdem-error.link.has-no-reference'\n ) | fromDictionary\n }}\n </a>\n </li>\n </ul>\n </ng-container>\n\n <foehn-debug-summary></foehn-debug-summary>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<gesdem-action-recovery-login\n *ngIf=\"hasSessionExpired\"\n [reference]=\"reference\"\n [redirectTarget]=\"link\"\n></gesdem-action-recovery-login>\n", components: [{ type: FoehnDebugSummaryComponent, selector: "foehn-debug-summary" }, { type: GesdemActionRecoveryLoginComponent, selector: "gesdem-action-recovery-login", inputs: ["reference", "redirectTarget"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe, "fromDictionary": SdkDictionaryPipe } });
3383
3417
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorComponent, decorators: [{
3384
3418
  type: Component,
3385
- args: [{ selector: 'gesdem-error', template: "<div class=\"vd-card mb-3\" *ngIf=\"!hasSessionExpired\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"card-body\">\n <p class=\"card-text vd-card-text\">\n {{\n !!reference\n ? 'Vous pouvez essayer de reprendre votre demande en cliquant sur le lien ci-dessous'\n : 'Vous pouvez recommencer une demande en cliquant sur le lien ci-dessous'\n }}\n </p>\n <ul class=\"vd-list-links\">\n <li>\n <a [href]=\"link\">\n {{\n !!reference\n ? 'Reprendre ma demande'\n : 'Recommencer'\n }}\n </a>\n </li>\n </ul>\n <foehn-debug-summary></foehn-debug-summary>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<gesdem-action-recovery-login\n *ngIf=\"hasSessionExpired\"\n [reference]=\"reference\"\n [redirectTarget]=\"link\"\n></gesdem-action-recovery-login>\n" }]
3386
- }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: FoehnNavigationService }, { type: GesdemHandlerService }, { type: FoehnPageService }, { type: SupportAlertService }]; }, propDecorators: { setPageTitle: [{
3419
+ args: [{ selector: 'gesdem-error', template: "<div class=\"vd-card mb-3\" *ngIf=\"!hasSessionExpired\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"(isPendingPayment | async) === true\">\n <p\n class=\"card-text vd-card-text alert alert-danger\"\n [innerHTML]=\"\n 'gesdem-error.text.pending-payment'\n | fromDictionary\n : {\n supportLink: (supportLink | async)\n }\n \"\n ></p>\n </ng-container>\n <ng-container *ngIf=\"(isPendingPayment | async) === false\">\n <p class=\"card-text vd-card-text\">\n {{\n (!!reference\n ? 'gesdem-error.text.has-reference'\n : 'gesdem-error.text.has-no-reference'\n ) | fromDictionary\n }}\n </p>\n <ul class=\"vd-list-links\">\n <li>\n <a [href]=\"link\">\n {{\n (!!reference\n ? 'gesdem-error.link.has-reference'\n : 'gesdem-error.link.has-no-reference'\n ) | fromDictionary\n }}\n </a>\n </li>\n </ul>\n </ng-container>\n\n <foehn-debug-summary></foehn-debug-summary>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<gesdem-action-recovery-login\n *ngIf=\"hasSessionExpired\"\n [reference]=\"reference\"\n [redirectTarget]=\"link\"\n></gesdem-action-recovery-login>\n" }]
3420
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: FoehnNavigationService }, { type: GesdemHandlerService }, { type: GesdemEventService }, { type: FoehnPageService }, { type: SupportAlertService }, { type: ApplicationInfoService }]; }, propDecorators: { setPageTitle: [{
3387
3421
  type: Input
3388
3422
  }] } });
3389
3423
 
@@ -10319,12 +10353,14 @@ GesdemErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
10319
10353
  GesdemErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorModule, declarations: [GesdemErrorComponent], imports: [CommonModule,
10320
10354
  RouterModule,
10321
10355
  GesdemActionRecoveryModule,
10322
- FoehnDebugSummaryComponentModule], exports: [GesdemErrorComponent] });
10356
+ FoehnDebugSummaryComponentModule,
10357
+ SdkDictionaryModule], exports: [GesdemErrorComponent] });
10323
10358
  GesdemErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorModule, imports: [[
10324
10359
  CommonModule,
10325
10360
  RouterModule,
10326
10361
  GesdemActionRecoveryModule,
10327
- FoehnDebugSummaryComponentModule
10362
+ FoehnDebugSummaryComponentModule,
10363
+ SdkDictionaryModule
10328
10364
  ]] });
10329
10365
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.5", ngImport: i0, type: GesdemErrorModule, decorators: [{
10330
10366
  type: NgModule,
@@ -10333,7 +10369,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.5", ngImpor
10333
10369
  CommonModule,
10334
10370
  RouterModule,
10335
10371
  GesdemActionRecoveryModule,
10336
- FoehnDebugSummaryComponentModule
10372
+ FoehnDebugSummaryComponentModule,
10373
+ SdkDictionaryModule
10337
10374
  ],
10338
10375
  declarations: [GesdemErrorComponent],
10339
10376
  exports: [GesdemErrorComponent]
@@ -11236,6 +11273,7 @@ class EPaymentService {
11236
11273
  responseType: 'text'
11237
11274
  })
11238
11275
  .pipe(catchError(() => {
11276
+ this.growlService.addWithType(GrowlType.DANGER, 'Une erreur de transmission est survenue. Merci de réessayer plus tard.');
11239
11277
  this.cancelPendingPayment(ref, baseUrl);
11240
11278
  throw new Error();
11241
11279
  }));