@dsivd/prestations-ng 16.5.4-beta.3 → 16.5.4-beta.4
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.
- package/CHANGELOG.md +7 -0
- package/dsivd-prestations-ng-v16.5.4-beta.4.tgz +0 -0
- package/esm2020/foehn-breadcrumb/breadcrumb-event.service.mjs +22 -15
- package/esm2020/gesdem-confirmation/gesdem-confirmation.component.mjs +14 -10
- package/esm2020/sdk-appinfo/application-info.mjs +7 -1
- package/esm2020/sdk-appinfo/application-info.service.mjs +21 -3
- package/fesm2015/dsivd-prestations-ng.mjs +259 -225
- package/fesm2015/dsivd-prestations-ng.mjs.map +1 -1
- package/fesm2020/dsivd-prestations-ng.mjs +249 -216
- package/fesm2020/dsivd-prestations-ng.mjs.map +1 -1
- package/foehn-breadcrumb/breadcrumb-event.service.d.ts +3 -1
- package/gesdem-confirmation/gesdem-confirmation.component.d.ts +2 -0
- package/package.json +1 -1
- package/sdk-appinfo/application-info.d.ts +3 -2
- package/dsivd-prestations-ng-v16.5.4-beta.3.tgz +0 -0
|
@@ -2,8 +2,8 @@ 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,
|
|
6
|
-
import { map, shareReplay, debounceTime, catchError, switchMap,
|
|
5
|
+
import { of, Subject, BehaviorSubject, combineLatest, throwError, tap as tap$1, concat, toArray, EMPTY, merge, withLatestFrom, debounceTime as debounceTime$1, switchMap as switchMap$1, map as map$1 } from 'rxjs';
|
|
6
|
+
import { map, shareReplay, filter, tap, debounceTime, catchError, switchMap, first, throttleTime, mergeMap, share, finalize, distinctUntilChanged } from 'rxjs/operators';
|
|
7
7
|
import * as i1 from '@angular/common/http';
|
|
8
8
|
import { HttpResponseBase, HttpErrorResponse, HttpParams, HttpEventType, HttpResponse, HTTP_INTERCEPTORS, HttpClientModule, HttpClient } from '@angular/common/http';
|
|
9
9
|
import * as i3 from '@angular/forms';
|
|
@@ -83,18 +83,245 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
83
83
|
}] }];
|
|
84
84
|
} });
|
|
85
85
|
|
|
86
|
+
// eslint-disable max-classes-per-file
|
|
87
|
+
class ApplicationInfo {
|
|
88
|
+
constructor() {
|
|
89
|
+
this.configuration = new Configuration();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class EtapeInfo {
|
|
93
|
+
}
|
|
94
|
+
class Configuration {
|
|
95
|
+
constructor() {
|
|
96
|
+
this.portail = new Portail();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
class Session {
|
|
100
|
+
}
|
|
101
|
+
class Document {
|
|
102
|
+
}
|
|
103
|
+
class Captcha {
|
|
104
|
+
}
|
|
105
|
+
class Portail {
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var ActionStatut;
|
|
109
|
+
(function (ActionStatut) {
|
|
110
|
+
ActionStatut["DRAFT"] = "DRAFT";
|
|
111
|
+
ActionStatut["INITIAL"] = "INITIAL";
|
|
112
|
+
ActionStatut["PENDING_PAYMENT"] = "PENDING_PAYMENT";
|
|
113
|
+
ActionStatut["TRANSFERRED"] = "TRANSFERRED";
|
|
114
|
+
ActionStatut["ABANDONED"] = "ABANDONED";
|
|
115
|
+
ActionStatut["REOPENED"] = "REOPENED";
|
|
116
|
+
})(ActionStatut || (ActionStatut = {}));
|
|
117
|
+
class GesdemStatutUtils {
|
|
118
|
+
static isFinal(actionStatut) {
|
|
119
|
+
if (!actionStatut) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return (actionStatut === ActionStatut.TRANSFERRED ||
|
|
123
|
+
actionStatut === ActionStatut.ABANDONED);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
class FoehnPageService {
|
|
128
|
+
constructor() {
|
|
129
|
+
this._foehnPageSubject = new Subject();
|
|
130
|
+
this._saveFormRequestSubject = new Subject();
|
|
131
|
+
this._currentEtapeId = new BehaviorSubject(null);
|
|
132
|
+
this.currentEtapeIdObs = this._currentEtapeId.asObservable();
|
|
133
|
+
}
|
|
134
|
+
foehnPageObservable() {
|
|
135
|
+
return this._foehnPageSubject.asObservable();
|
|
136
|
+
}
|
|
137
|
+
setPageTitle(title) {
|
|
138
|
+
this._foehnPageSubject.next(title);
|
|
139
|
+
}
|
|
140
|
+
requestFormSave() {
|
|
141
|
+
this._saveFormRequestSubject.next();
|
|
142
|
+
}
|
|
143
|
+
saveFormRequest() {
|
|
144
|
+
return this._saveFormRequestSubject.asObservable();
|
|
145
|
+
}
|
|
146
|
+
setCurrentEtapeId(etapeId) {
|
|
147
|
+
this._currentEtapeId.next(etapeId);
|
|
148
|
+
}
|
|
149
|
+
onEtapeIdChange() {
|
|
150
|
+
return this._currentEtapeId
|
|
151
|
+
.asObservable()
|
|
152
|
+
.pipe(filter(etapeInfo => !!etapeInfo));
|
|
153
|
+
}
|
|
154
|
+
isUserCategoryVisible(isFirstPage, isLastPage, isUserCategoryEnabled, isInitialStep, isUserNeverConnected,
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
backendResponse, isCurrentRouteDefined) {
|
|
157
|
+
const isStatusFinal = backendResponse &&
|
|
158
|
+
GesdemStatutUtils.isFinal(ActionStatut[backendResponse.meta.statut]);
|
|
159
|
+
return (isCurrentRouteDefined &&
|
|
160
|
+
!isStatusFinal &&
|
|
161
|
+
!isUserNeverConnected &&
|
|
162
|
+
isUserCategoryEnabled &&
|
|
163
|
+
isInitialStep &&
|
|
164
|
+
(isFirstPage || isLastPage));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
FoehnPageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
168
|
+
FoehnPageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, providedIn: 'root' });
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, decorators: [{
|
|
170
|
+
type: Injectable,
|
|
171
|
+
args: [{
|
|
172
|
+
providedIn: 'root'
|
|
173
|
+
}]
|
|
174
|
+
}], ctorParameters: function () { return []; } });
|
|
175
|
+
|
|
176
|
+
const APP_INFO_API_URL = 'api/applicationInfo';
|
|
177
|
+
const PORTAIL_BASE_URL_INT = 'https://int-prestations.vd.ch/';
|
|
178
|
+
const FORM_SUPPORT_CYBER_TITLE_FALLBACK = "Demander de l'aide pour l'utilisation du portail sécurisé";
|
|
179
|
+
class ApplicationInfoService {
|
|
180
|
+
constructor(http, foehnPageService) {
|
|
181
|
+
this.http = http;
|
|
182
|
+
this.foehnPageService = foehnPageService;
|
|
183
|
+
this.applicationInfo = new ApplicationInfo();
|
|
184
|
+
this.pulling_ = this.http
|
|
185
|
+
.get(APP_INFO_API_URL)
|
|
186
|
+
.pipe(shareReplay(1));
|
|
187
|
+
// In most prestation, we're interested in the first etape info.
|
|
188
|
+
this.firstEtapeInfo_ = this.pulling_.pipe(filter(appInfo => !!appInfo && !!appInfo.etapeInfos), map(({ etapeInfos }) => {
|
|
189
|
+
// Checks whether the server returns a first key, otherwise fails the
|
|
190
|
+
// observable to ensure that client applications don't try to use this value
|
|
191
|
+
// and are able to implement fallback strategies.
|
|
192
|
+
const firstKey = Object.keys(etapeInfos)[0];
|
|
193
|
+
if (!firstKey) {
|
|
194
|
+
throw new Error('There must be at least one key in the etapeInfos');
|
|
195
|
+
}
|
|
196
|
+
return etapeInfos[firstKey];
|
|
197
|
+
}));
|
|
198
|
+
this.currentEtapeInfo_ = combineLatest([
|
|
199
|
+
this.foehnPageService.onEtapeIdChange(),
|
|
200
|
+
this.pulling_
|
|
201
|
+
]).pipe(map(([etapeId, applicationInfo]) => applicationInfo.etapeInfos[etapeId]), shareReplay(1));
|
|
202
|
+
this.pulling_.subscribe((ai) => this.setApplicationInfo(ai));
|
|
203
|
+
}
|
|
204
|
+
get data() {
|
|
205
|
+
return this.pulling_.pipe(tap(appInfo => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
if (!!((_a = appInfo.configuration.portail.baseVdChUrl) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
208
|
+
// already set by the backend
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
switch ((_b = appInfo.environment) === null || _b === void 0 ? void 0 : _b.toUpperCase()) {
|
|
212
|
+
case 'IN':
|
|
213
|
+
appInfo.configuration.portail.baseVdChUrl =
|
|
214
|
+
'https://int.vd.ch';
|
|
215
|
+
break;
|
|
216
|
+
case 'VA':
|
|
217
|
+
appInfo.configuration.portail.baseVdChUrl =
|
|
218
|
+
'https://valid.vd.ch';
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
appInfo.configuration.portail.baseVdChUrl =
|
|
222
|
+
'https://www.vd.ch';
|
|
223
|
+
}
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
get firstEtapeInfo() {
|
|
227
|
+
return this.firstEtapeInfo_;
|
|
228
|
+
}
|
|
229
|
+
get currentEtapeInfo() {
|
|
230
|
+
return this.currentEtapeInfo_;
|
|
231
|
+
}
|
|
232
|
+
getSafeCyberLoginUrl() {
|
|
233
|
+
return this.data.pipe(map(appInfo => {
|
|
234
|
+
var _a, _b;
|
|
235
|
+
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.cyberLoginUrl) ||
|
|
236
|
+
`${this.getPortailBaseUrl(appInfo)}100018/`;
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
getSafeSupportFormUrl(reference, errors) {
|
|
240
|
+
return this.data.pipe(map(appInfo => {
|
|
241
|
+
var _a, _b;
|
|
242
|
+
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.supportFormUrl) ||
|
|
243
|
+
`${this.getPortailBaseUrl(appInfo)}pub/101098/`;
|
|
244
|
+
}), map(link => {
|
|
245
|
+
if (!!(reference === null || reference === void 0 ? void 0 : reference.length)) {
|
|
246
|
+
link += `?concernedReference=${reference}`;
|
|
247
|
+
}
|
|
248
|
+
if (!!(errors === null || errors === void 0 ? void 0 : errors.length)) {
|
|
249
|
+
link += !!(reference === null || reference === void 0 ? void 0 : reference.length) ? '&' : '?';
|
|
250
|
+
// Need following code to avoid browser Sanitizing error when using JSON.stringify
|
|
251
|
+
link += `errors=${errors
|
|
252
|
+
.map(error => Object.entries(error)
|
|
253
|
+
.map(value => `${value.join('=')}`)
|
|
254
|
+
.join(','))
|
|
255
|
+
.join(';')}`;
|
|
256
|
+
}
|
|
257
|
+
return link;
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
260
|
+
getSafeSupportFormTitle() {
|
|
261
|
+
return this.data.pipe(map(appInfo => {
|
|
262
|
+
var _a, _b, _c;
|
|
263
|
+
const title = (_c = (_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.portailTitlesByPrestaCode) === null || _c === void 0 ? void 0 : _c[101098];
|
|
264
|
+
return title && title.length
|
|
265
|
+
? title
|
|
266
|
+
: FORM_SUPPORT_CYBER_TITLE_FALLBACK;
|
|
267
|
+
}));
|
|
268
|
+
}
|
|
269
|
+
getSafeEspacesSecuriseUrl() {
|
|
270
|
+
return this.data.pipe(map(appInfo => {
|
|
271
|
+
var _a, _b;
|
|
272
|
+
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.espaceSecuriseUrl) ||
|
|
273
|
+
`${this.getPortailBaseUrl(appInfo)}100002/`;
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
setApplicationInfo(applicationInfo) {
|
|
277
|
+
this.applicationInfo = applicationInfo;
|
|
278
|
+
if (this.applicationInfo) {
|
|
279
|
+
switch (this.applicationInfo.environment) {
|
|
280
|
+
case 'CO': {
|
|
281
|
+
this.applicationInfo.environmentLabel = 'développement';
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
case 'IN': {
|
|
285
|
+
this.applicationInfo.environmentLabel = 'intégration';
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
case 'VA': {
|
|
289
|
+
this.applicationInfo.environmentLabel = 'validation';
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
default: {
|
|
293
|
+
// Nothing to do
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
getPortailBaseUrl(appInfo) {
|
|
299
|
+
return appInfo.environment === 'CO'
|
|
300
|
+
? PORTAIL_BASE_URL_INT
|
|
301
|
+
: `${window.location.origin}/`;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
ApplicationInfoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, deps: [{ token: i1.HttpClient }, { token: FoehnPageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
305
|
+
ApplicationInfoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, providedIn: 'root' });
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, decorators: [{
|
|
307
|
+
type: Injectable,
|
|
308
|
+
args: [{
|
|
309
|
+
providedIn: 'root'
|
|
310
|
+
}]
|
|
311
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: FoehnPageService }]; } });
|
|
312
|
+
|
|
86
313
|
const DEFAULT_VALUES = {
|
|
87
314
|
espaceSecuriseUrl: '/100002/accueil',
|
|
88
315
|
allPrestationsUrl: '/100002/prestations',
|
|
89
|
-
vdChUrl:
|
|
90
|
-
descriptionPageBaseUrl:
|
|
316
|
+
vdChUrl: null,
|
|
317
|
+
descriptionPageBaseUrl: null,
|
|
91
318
|
// It's better to not display the breadcrumb item if the prestation doesn't give its code.
|
|
92
319
|
prestationCode: null
|
|
93
320
|
};
|
|
94
321
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
95
|
-
function getNotConnectedBreadcrumb({ vdChUrl
|
|
322
|
+
function getNotConnectedBreadcrumb({ vdChUrl, descriptionPageBaseUrl, prestationCode = DEFAULT_VALUES.prestationCode }, vdChUrlFromAppInfo) {
|
|
96
323
|
const rootElement = {
|
|
97
|
-
url: vdChUrl,
|
|
324
|
+
url: vdChUrl || vdChUrlFromAppInfo,
|
|
98
325
|
routerLink: null,
|
|
99
326
|
label: 'vd.ch'
|
|
100
327
|
};
|
|
@@ -108,7 +335,9 @@ function getNotConnectedBreadcrumb({ vdChUrl = DEFAULT_VALUES.vdChUrl, descripti
|
|
|
108
335
|
rootElement,
|
|
109
336
|
{
|
|
110
337
|
// e.g. https://www.vd.ch/go.to?prestation=101016
|
|
111
|
-
url:
|
|
338
|
+
url: descriptionPageBaseUrl
|
|
339
|
+
? `${descriptionPageBaseUrl}${prestationCode}`
|
|
340
|
+
: `${vdChUrlFromAppInfo}/go.to?prestation=${prestationCode}`,
|
|
112
341
|
routerLink: null,
|
|
113
342
|
label: 'Description de la prestation'
|
|
114
343
|
}
|
|
@@ -135,22 +364,23 @@ function getConnectedBreadcrumb({ espaceSecuriseUrl = DEFAULT_VALUES.espaceSecur
|
|
|
135
364
|
* @param sessionInfoData data info on session
|
|
136
365
|
* @param configuration as breadcrumb config.
|
|
137
366
|
* @param currentItem as breadcrumb current item
|
|
367
|
+
* @param vdChBaseUrl typo3 base url for current env
|
|
138
368
|
* @returns Breadcrumb
|
|
139
369
|
*/
|
|
140
|
-
function getBreadcrumb(sessionInfoData, configuration, currentItem) {
|
|
370
|
+
function getBreadcrumb(sessionInfoData, configuration, currentItem, vdChBaseUrl) {
|
|
141
371
|
// Whether the user has a context we consider it as connected.
|
|
142
372
|
const isConnectedCyber = !!sessionInfoData && !!sessionInfoData.context;
|
|
143
373
|
const breadcrumb = new Breadcrumb();
|
|
144
374
|
// Depending on whether the user is connected, the content of the items change.
|
|
145
375
|
breadcrumb.breadcrumbItems = isConnectedCyber
|
|
146
376
|
? getConnectedBreadcrumb(configuration, sessionInfoData)
|
|
147
|
-
: getNotConnectedBreadcrumb(configuration);
|
|
377
|
+
: getNotConnectedBreadcrumb(configuration, vdChBaseUrl);
|
|
148
378
|
// Optionally set the current item.
|
|
149
379
|
breadcrumb.current = currentItem;
|
|
150
380
|
return breadcrumb;
|
|
151
381
|
}
|
|
152
382
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
153
|
-
function mapBreadcrumb([override, configuration, currentItem, sessionInfoData]) {
|
|
383
|
+
function mapBreadcrumb([override, configuration, currentItem, sessionInfoData, applicationInfo]) {
|
|
154
384
|
// Take the override if it exists
|
|
155
385
|
if (override) {
|
|
156
386
|
// Although there's an override, we do want to assign the current item
|
|
@@ -163,14 +393,15 @@ function mapBreadcrumb([override, configuration, currentItem, sessionInfoData])
|
|
|
163
393
|
}
|
|
164
394
|
// Otherwise get a breadcrumb based on the configuration
|
|
165
395
|
if (configuration) {
|
|
166
|
-
return getBreadcrumb(sessionInfoData, configuration, currentItem);
|
|
396
|
+
return getBreadcrumb(sessionInfoData, configuration, currentItem, applicationInfo.configuration.portail.baseVdChUrl);
|
|
167
397
|
}
|
|
168
398
|
// Only output a breadcrumb of there's a configuration or an override
|
|
169
399
|
return null;
|
|
170
400
|
}
|
|
171
401
|
class BreadcrumbEventService {
|
|
172
|
-
constructor(sessionInfo) {
|
|
402
|
+
constructor(sessionInfo, applicationInfoService) {
|
|
173
403
|
this.sessionInfo = sessionInfo;
|
|
404
|
+
this.applicationInfoService = applicationInfoService;
|
|
174
405
|
this._breadcrumbOverride = new BehaviorSubject(null);
|
|
175
406
|
this._breadcrumbConfiguration = new BehaviorSubject(null);
|
|
176
407
|
this._currentBreadcrumbItem = new BehaviorSubject(null);
|
|
@@ -180,7 +411,8 @@ class BreadcrumbEventService {
|
|
|
180
411
|
this._breadcrumbOverride,
|
|
181
412
|
this._breadcrumbConfiguration,
|
|
182
413
|
this._currentBreadcrumbItem,
|
|
183
|
-
this.sessionInfo.data
|
|
414
|
+
this.sessionInfo.data,
|
|
415
|
+
this.applicationInfoService.data
|
|
184
416
|
]).pipe(
|
|
185
417
|
// Put together the breadcrumb, or just take the override if it exists.
|
|
186
418
|
map(mapBreadcrumb));
|
|
@@ -189,7 +421,8 @@ class BreadcrumbEventService {
|
|
|
189
421
|
this._breadcrumbOverride,
|
|
190
422
|
this._breadcrumbConfiguration,
|
|
191
423
|
this._currentBreadcrumbItem,
|
|
192
|
-
of(null)
|
|
424
|
+
of(null),
|
|
425
|
+
this.applicationInfoService.data
|
|
193
426
|
]).pipe(
|
|
194
427
|
// Put together the breadcrumb, or just take the override if it exists.
|
|
195
428
|
map(mapBreadcrumb));
|
|
@@ -244,14 +477,14 @@ class BreadcrumbEventService {
|
|
|
244
477
|
this._breadcrumbConfiguration.next(configuration);
|
|
245
478
|
}
|
|
246
479
|
}
|
|
247
|
-
BreadcrumbEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbEventService, deps: [{ token: SessionInfo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
480
|
+
BreadcrumbEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbEventService, deps: [{ token: SessionInfo }, { token: ApplicationInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
248
481
|
BreadcrumbEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbEventService, providedIn: 'root' });
|
|
249
482
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbEventService, decorators: [{
|
|
250
483
|
type: Injectable,
|
|
251
484
|
args: [{
|
|
252
485
|
providedIn: 'root'
|
|
253
486
|
}]
|
|
254
|
-
}], ctorParameters: function () { return [{ type: SessionInfo }]; } });
|
|
487
|
+
}], ctorParameters: function () { return [{ type: SessionInfo }, { type: ApplicationInfoService }]; } });
|
|
255
488
|
|
|
256
489
|
class RegisterNgModelService {
|
|
257
490
|
constructor() {
|
|
@@ -2188,74 +2421,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2188
2421
|
}]
|
|
2189
2422
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: GesdemHandlerService }, { type: GesdemActionRecoveryService }, { type: i1$1.ActivatedRoute }, { type: i2.Location }, { type: DemandeTransmitInterceptor }, { type: SdkEventsLoggerService }]; } });
|
|
2190
2423
|
|
|
2191
|
-
var ActionStatut;
|
|
2192
|
-
(function (ActionStatut) {
|
|
2193
|
-
ActionStatut["DRAFT"] = "DRAFT";
|
|
2194
|
-
ActionStatut["INITIAL"] = "INITIAL";
|
|
2195
|
-
ActionStatut["PENDING_PAYMENT"] = "PENDING_PAYMENT";
|
|
2196
|
-
ActionStatut["TRANSFERRED"] = "TRANSFERRED";
|
|
2197
|
-
ActionStatut["ABANDONED"] = "ABANDONED";
|
|
2198
|
-
ActionStatut["REOPENED"] = "REOPENED";
|
|
2199
|
-
})(ActionStatut || (ActionStatut = {}));
|
|
2200
|
-
class GesdemStatutUtils {
|
|
2201
|
-
static isFinal(actionStatut) {
|
|
2202
|
-
if (!actionStatut) {
|
|
2203
|
-
return false;
|
|
2204
|
-
}
|
|
2205
|
-
return (actionStatut === ActionStatut.TRANSFERRED ||
|
|
2206
|
-
actionStatut === ActionStatut.ABANDONED);
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
class FoehnPageService {
|
|
2211
|
-
constructor() {
|
|
2212
|
-
this._foehnPageSubject = new Subject();
|
|
2213
|
-
this._saveFormRequestSubject = new Subject();
|
|
2214
|
-
this._currentEtapeId = new BehaviorSubject(null);
|
|
2215
|
-
this.currentEtapeIdObs = this._currentEtapeId.asObservable();
|
|
2216
|
-
}
|
|
2217
|
-
foehnPageObservable() {
|
|
2218
|
-
return this._foehnPageSubject.asObservable();
|
|
2219
|
-
}
|
|
2220
|
-
setPageTitle(title) {
|
|
2221
|
-
this._foehnPageSubject.next(title);
|
|
2222
|
-
}
|
|
2223
|
-
requestFormSave() {
|
|
2224
|
-
this._saveFormRequestSubject.next();
|
|
2225
|
-
}
|
|
2226
|
-
saveFormRequest() {
|
|
2227
|
-
return this._saveFormRequestSubject.asObservable();
|
|
2228
|
-
}
|
|
2229
|
-
setCurrentEtapeId(etapeId) {
|
|
2230
|
-
this._currentEtapeId.next(etapeId);
|
|
2231
|
-
}
|
|
2232
|
-
onEtapeIdChange() {
|
|
2233
|
-
return this._currentEtapeId
|
|
2234
|
-
.asObservable()
|
|
2235
|
-
.pipe(filter(etapeInfo => !!etapeInfo));
|
|
2236
|
-
}
|
|
2237
|
-
isUserCategoryVisible(isFirstPage, isLastPage, isUserCategoryEnabled, isInitialStep, isUserNeverConnected,
|
|
2238
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2239
|
-
backendResponse, isCurrentRouteDefined) {
|
|
2240
|
-
const isStatusFinal = backendResponse &&
|
|
2241
|
-
GesdemStatutUtils.isFinal(ActionStatut[backendResponse.meta.statut]);
|
|
2242
|
-
return (isCurrentRouteDefined &&
|
|
2243
|
-
!isStatusFinal &&
|
|
2244
|
-
!isUserNeverConnected &&
|
|
2245
|
-
isUserCategoryEnabled &&
|
|
2246
|
-
isInitialStep &&
|
|
2247
|
-
(isFirstPage || isLastPage));
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
FoehnPageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2251
|
-
FoehnPageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, providedIn: 'root' });
|
|
2252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FoehnPageService, decorators: [{
|
|
2253
|
-
type: Injectable,
|
|
2254
|
-
args: [{
|
|
2255
|
-
providedIn: 'root'
|
|
2256
|
-
}]
|
|
2257
|
-
}], ctorParameters: function () { return []; } });
|
|
2258
|
-
|
|
2259
2424
|
class PendingFiles {
|
|
2260
2425
|
}
|
|
2261
2426
|
|
|
@@ -2597,140 +2762,6 @@ class UploaderHelper {
|
|
|
2597
2762
|
}
|
|
2598
2763
|
}
|
|
2599
2764
|
|
|
2600
|
-
// eslint-disable max-classes-per-file
|
|
2601
|
-
class ApplicationInfo {
|
|
2602
|
-
}
|
|
2603
|
-
class EtapeInfo {
|
|
2604
|
-
}
|
|
2605
|
-
class Configuration {
|
|
2606
|
-
}
|
|
2607
|
-
class Session {
|
|
2608
|
-
}
|
|
2609
|
-
class Document {
|
|
2610
|
-
}
|
|
2611
|
-
class Captcha {
|
|
2612
|
-
}
|
|
2613
|
-
class Portail {
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
const APP_INFO_API_URL = 'api/applicationInfo';
|
|
2617
|
-
const PORTAIL_BASE_URL_INT = 'https://int-prestations.vd.ch/';
|
|
2618
|
-
const FORM_SUPPORT_CYBER_TITLE_FALLBACK = "Demander de l'aide pour l'utilisation du portail sécurisé";
|
|
2619
|
-
class ApplicationInfoService {
|
|
2620
|
-
constructor(http, foehnPageService) {
|
|
2621
|
-
this.http = http;
|
|
2622
|
-
this.foehnPageService = foehnPageService;
|
|
2623
|
-
this.applicationInfo = new ApplicationInfo();
|
|
2624
|
-
this.pulling_ = this.http
|
|
2625
|
-
.get(APP_INFO_API_URL)
|
|
2626
|
-
.pipe(shareReplay(1));
|
|
2627
|
-
// In most prestation, we're interested in the first etape info.
|
|
2628
|
-
this.firstEtapeInfo_ = this.pulling_.pipe(filter(appInfo => !!appInfo && !!appInfo.etapeInfos), map(({ etapeInfos }) => {
|
|
2629
|
-
// Checks whether the server returns a first key, otherwise fails the
|
|
2630
|
-
// observable to ensure that client applications don't try to use this value
|
|
2631
|
-
// and are able to implement fallback strategies.
|
|
2632
|
-
const firstKey = Object.keys(etapeInfos)[0];
|
|
2633
|
-
if (!firstKey) {
|
|
2634
|
-
throw new Error('There must be at least one key in the etapeInfos');
|
|
2635
|
-
}
|
|
2636
|
-
return etapeInfos[firstKey];
|
|
2637
|
-
}));
|
|
2638
|
-
this.currentEtapeInfo_ = combineLatest([
|
|
2639
|
-
this.foehnPageService.onEtapeIdChange(),
|
|
2640
|
-
this.pulling_
|
|
2641
|
-
]).pipe(map(([etapeId, applicationInfo]) => applicationInfo.etapeInfos[etapeId]), shareReplay(1));
|
|
2642
|
-
this.pulling_.subscribe((ai) => this.setApplicationInfo(ai));
|
|
2643
|
-
}
|
|
2644
|
-
get data() {
|
|
2645
|
-
return this.pulling_;
|
|
2646
|
-
}
|
|
2647
|
-
get firstEtapeInfo() {
|
|
2648
|
-
return this.firstEtapeInfo_;
|
|
2649
|
-
}
|
|
2650
|
-
get currentEtapeInfo() {
|
|
2651
|
-
return this.currentEtapeInfo_;
|
|
2652
|
-
}
|
|
2653
|
-
getSafeCyberLoginUrl() {
|
|
2654
|
-
return this.data.pipe(map(appInfo => {
|
|
2655
|
-
var _a, _b;
|
|
2656
|
-
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.cyberLoginUrl) ||
|
|
2657
|
-
`${this.getPortailBaseUrl(appInfo)}100018/`;
|
|
2658
|
-
}));
|
|
2659
|
-
}
|
|
2660
|
-
getSafeSupportFormUrl(reference, errors) {
|
|
2661
|
-
return this.data.pipe(map(appInfo => {
|
|
2662
|
-
var _a, _b;
|
|
2663
|
-
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.supportFormUrl) ||
|
|
2664
|
-
`${this.getPortailBaseUrl(appInfo)}pub/101098/`;
|
|
2665
|
-
}), map(link => {
|
|
2666
|
-
if (!!(reference === null || reference === void 0 ? void 0 : reference.length)) {
|
|
2667
|
-
link += `?concernedReference=${reference}`;
|
|
2668
|
-
}
|
|
2669
|
-
if (!!(errors === null || errors === void 0 ? void 0 : errors.length)) {
|
|
2670
|
-
link += !!(reference === null || reference === void 0 ? void 0 : reference.length) ? '&' : '?';
|
|
2671
|
-
// Need following code to avoid browser Sanitizing error when using JSON.stringify
|
|
2672
|
-
link += `errors=${errors
|
|
2673
|
-
.map(error => Object.entries(error)
|
|
2674
|
-
.map(value => `${value.join('=')}`)
|
|
2675
|
-
.join(','))
|
|
2676
|
-
.join(';')}`;
|
|
2677
|
-
}
|
|
2678
|
-
return link;
|
|
2679
|
-
}));
|
|
2680
|
-
}
|
|
2681
|
-
getSafeSupportFormTitle() {
|
|
2682
|
-
return this.data.pipe(map(appInfo => {
|
|
2683
|
-
var _a, _b, _c;
|
|
2684
|
-
const title = (_c = (_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.portailTitlesByPrestaCode) === null || _c === void 0 ? void 0 : _c[101098];
|
|
2685
|
-
return title && title.length
|
|
2686
|
-
? title
|
|
2687
|
-
: FORM_SUPPORT_CYBER_TITLE_FALLBACK;
|
|
2688
|
-
}));
|
|
2689
|
-
}
|
|
2690
|
-
getSafeEspacesSecuriseUrl() {
|
|
2691
|
-
return this.data.pipe(map(appInfo => {
|
|
2692
|
-
var _a, _b;
|
|
2693
|
-
return ((_b = (_a = appInfo.configuration) === null || _a === void 0 ? void 0 : _a.portail) === null || _b === void 0 ? void 0 : _b.espaceSecuriseUrl) ||
|
|
2694
|
-
`${this.getPortailBaseUrl(appInfo)}100002/`;
|
|
2695
|
-
}));
|
|
2696
|
-
}
|
|
2697
|
-
setApplicationInfo(applicationInfo) {
|
|
2698
|
-
this.applicationInfo = applicationInfo;
|
|
2699
|
-
if (this.applicationInfo) {
|
|
2700
|
-
switch (this.applicationInfo.environment) {
|
|
2701
|
-
case 'CO': {
|
|
2702
|
-
this.applicationInfo.environmentLabel = 'développement';
|
|
2703
|
-
break;
|
|
2704
|
-
}
|
|
2705
|
-
case 'IN': {
|
|
2706
|
-
this.applicationInfo.environmentLabel = 'intégration';
|
|
2707
|
-
break;
|
|
2708
|
-
}
|
|
2709
|
-
case 'VA': {
|
|
2710
|
-
this.applicationInfo.environmentLabel = 'validation';
|
|
2711
|
-
break;
|
|
2712
|
-
}
|
|
2713
|
-
default: {
|
|
2714
|
-
// Nothing to do
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
getPortailBaseUrl(appInfo) {
|
|
2720
|
-
return appInfo.environment === 'CO'
|
|
2721
|
-
? PORTAIL_BASE_URL_INT
|
|
2722
|
-
: `${window.location.origin}/`;
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
|
-
ApplicationInfoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, deps: [{ token: i1.HttpClient }, { token: FoehnPageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2726
|
-
ApplicationInfoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, providedIn: 'root' });
|
|
2727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationInfoService, decorators: [{
|
|
2728
|
-
type: Injectable,
|
|
2729
|
-
args: [{
|
|
2730
|
-
providedIn: 'root'
|
|
2731
|
-
}]
|
|
2732
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: FoehnPageService }]; } });
|
|
2733
|
-
|
|
2734
2765
|
class UploadProgressService {
|
|
2735
2766
|
constructor() {
|
|
2736
2767
|
this._uploadProgressSubject = new BehaviorSubject(null);
|
|
@@ -3654,6 +3685,7 @@ class GesdemConfirmationComponent {
|
|
|
3654
3685
|
this._sessionInfo = ServiceLocator.injector.get(SessionInfo);
|
|
3655
3686
|
this._navigation = ServiceLocator.injector.get(FoehnNavigationService);
|
|
3656
3687
|
this._eventsLoggerService = ServiceLocator.injector.get(SdkEventsLoggerService);
|
|
3688
|
+
this._applicationInfoService = ServiceLocator.injector.get(ApplicationInfoService);
|
|
3657
3689
|
const route = FoehnNavigationService.getRootRouteRecursive(activatedRoute.snapshot);
|
|
3658
3690
|
this._navigation.initRoute(route);
|
|
3659
3691
|
// Override from the routing.
|
|
@@ -3697,18 +3729,20 @@ class GesdemConfirmationComponent {
|
|
|
3697
3729
|
this.closeButtonConnectedText ||
|
|
3698
3730
|
'gesdem-confirmation.exit-button-connected';
|
|
3699
3731
|
// default closeLink if not by @Input and not by route data
|
|
3700
|
-
|
|
3701
|
-
.onEtapeIdChange()
|
|
3702
|
-
.pipe(first())
|
|
3703
|
-
|
|
3704
|
-
.
|
|
3732
|
+
combineLatest([
|
|
3733
|
+
this.foehnPageService.onEtapeIdChange().pipe(first()),
|
|
3734
|
+
this._applicationInfoService.data.pipe(first())
|
|
3735
|
+
])
|
|
3736
|
+
.pipe(first(), tap(([etapeId, appInfo]) => {
|
|
3705
3737
|
if (!this.closeLinkNotConnected.getValue()) {
|
|
3706
|
-
this.closeLinkNotConnected.next(
|
|
3738
|
+
this.closeLinkNotConnected.next(`${appInfo.configuration.portail.baseVdChUrl}/go.to?prestation=${etapeId}`);
|
|
3707
3739
|
}
|
|
3708
3740
|
if (!this.closeLinkConnected.getValue()) {
|
|
3709
3741
|
this.closeLinkConnected.next('/100018/logout');
|
|
3710
3742
|
}
|
|
3711
|
-
})
|
|
3743
|
+
}))
|
|
3744
|
+
// eslint-disable-next-line rxjs/no-nested-subscribe,rxjs-angular/prefer-async-pipe,rxjs/no-nested-subscribe
|
|
3745
|
+
.subscribe();
|
|
3712
3746
|
});
|
|
3713
3747
|
}
|
|
3714
3748
|
get isTransferred() {
|