vc-error-handlers 0.1.97 → 0.1.98
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/esm2020/lib/featureFlag/feature-flag.module.mjs +1 -1
- package/esm2020/lib/shared/components/chunk-unavailable/chunk-unavailable.component.mjs +4 -3
- package/esm2020/lib/shared/components/component-level-server-error/component-level-server-error.component.mjs +5 -4
- package/esm2020/lib/shared/components/error-modal/error-modal.component.mjs +14 -11
- package/esm2020/lib/shared/components/page-not-found/page-not-found.component.mjs +25 -14
- package/esm2020/lib/shared/components/server-error/server-error.component.mjs +17 -6
- package/esm2020/lib/shared/components/session-expired/session-expired.component.mjs +4 -3
- package/esm2020/lib/shared/components/unauthorized/unauthorized.component.mjs +26 -10
- package/esm2020/lib/shared/constants/api-config.constants.mjs +7 -14
- package/esm2020/lib/shared/constants/error-handling.constants.mjs +15 -2
- package/esm2020/lib/shared/errorhandler/sentry-error.handler.mjs +6 -9
- package/esm2020/lib/shared/interceptors/http.interceptor.mjs +3 -3
- package/esm2020/lib/shared/services/global-error.service.mjs +24 -50
- package/esm2020/lib/shared/services/util.service.mjs +29 -2
- package/esm2020/lib/shared/types/global-error.types.mjs +1 -1
- package/esm2020/lib/vc-error-handlers.component.mjs +9 -12
- package/esm2020/public-api.mjs +1 -2
- package/fesm2015/vc-error-handlers.mjs +167 -138
- package/fesm2015/vc-error-handlers.mjs.map +1 -1
- package/fesm2020/vc-error-handlers.mjs +167 -138
- package/fesm2020/vc-error-handlers.mjs.map +1 -1
- package/lib/shared/components/chunk-unavailable/chunk-unavailable.component.d.ts +4 -0
- package/lib/shared/components/component-level-server-error/component-level-server-error.component.d.ts +4 -0
- package/lib/shared/components/error-modal/error-modal.component.d.ts +8 -4
- package/lib/shared/components/page-not-found/page-not-found.component.d.ts +8 -3
- package/lib/shared/components/server-error/server-error.component.d.ts +4 -0
- package/lib/shared/components/session-expired/session-expired.component.d.ts +4 -0
- package/lib/shared/components/unauthorized/unauthorized.component.d.ts +5 -0
- package/lib/shared/constants/api-config.constants.d.ts +2 -6
- package/lib/shared/constants/error-handling.constants.d.ts +13 -0
- package/lib/shared/errorhandler/sentry-error.handler.d.ts +1 -1
- package/lib/shared/services/global-error.service.d.ts +1 -1
- package/lib/shared/services/util.service.d.ts +10 -1
- package/lib/shared/types/global-error.types.d.ts +11 -0
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/esm2020/lib/shared/services/auth.service.mjs +0 -20
- package/lib/shared/services/auth.service.d.ts +0 -9
|
@@ -3,9 +3,9 @@ import { Injectable, Component, Input, Directive, ViewChild, NgModule, EventEmit
|
|
|
3
3
|
import { Subject, throwError } from 'rxjs';
|
|
4
4
|
import * as i3 from '@angular/router';
|
|
5
5
|
import { NavigationStart, NavigationEnd, NavigationError } from '@angular/router';
|
|
6
|
-
import * as i1 from '@vcomply/authorizer';
|
|
7
6
|
import * as i2 from '@angular/common';
|
|
8
7
|
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i1 from '@vcomply/authorizer';
|
|
9
9
|
import * as i1$1 from '@angular/common/http';
|
|
10
10
|
import { HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
11
11
|
import { retry, timeout, tap, catchError } from 'rxjs/operators';
|
|
@@ -41,18 +41,11 @@ var ErrorStatusCode;
|
|
|
41
41
|
|
|
42
42
|
const PAGE_LEVEL_API_CONFIG = [
|
|
43
43
|
{
|
|
44
|
-
method: '
|
|
45
|
-
path: '
|
|
46
|
-
query:
|
|
47
|
-
body:
|
|
48
|
-
pageCodes: ['
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
method: 'GET',
|
|
52
|
-
path: '/compliance_post',
|
|
53
|
-
query: { mode: 'xyz' },
|
|
54
|
-
body: { mode: 'abc' },
|
|
55
|
-
pageCodes: ['compliance:mr', 'risk:mr'],
|
|
44
|
+
method: '',
|
|
45
|
+
path: '',
|
|
46
|
+
query: null,
|
|
47
|
+
body: null,
|
|
48
|
+
pageCodes: [''],
|
|
56
49
|
},
|
|
57
50
|
];
|
|
58
51
|
const COMPONENT_LEVEL_API_CONFIG = [
|
|
@@ -190,7 +183,7 @@ const COMPONENT_LEVEL_API_CONFIG = [
|
|
|
190
183
|
},
|
|
191
184
|
{
|
|
192
185
|
method: 'POST',
|
|
193
|
-
path: '
|
|
186
|
+
path: 'memberDetailsbyIds',
|
|
194
187
|
query: null,
|
|
195
188
|
body: null,
|
|
196
189
|
},
|
|
@@ -318,12 +311,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
318
311
|
class UtilsService {
|
|
319
312
|
isJsonSubset(parentJson, subsetJson) {
|
|
320
313
|
for (let key in subsetJson) {
|
|
321
|
-
if (!parentJson.hasOwnProperty(key) ||
|
|
314
|
+
if (!parentJson.hasOwnProperty(key) ||
|
|
315
|
+
parentJson[key] !== subsetJson[key]) {
|
|
322
316
|
return false;
|
|
323
317
|
}
|
|
324
318
|
}
|
|
325
319
|
return true;
|
|
326
320
|
}
|
|
321
|
+
extractQueryParams(params) {
|
|
322
|
+
const query = {};
|
|
323
|
+
params.keys().forEach((key) => {
|
|
324
|
+
query[key] = params.get(key);
|
|
325
|
+
});
|
|
326
|
+
return query;
|
|
327
|
+
}
|
|
328
|
+
isStringEqual(apiMethod, requestMethod) {
|
|
329
|
+
return apiMethod === requestMethod;
|
|
330
|
+
}
|
|
331
|
+
isSubstringInString(apiPath, requestPath) {
|
|
332
|
+
return requestPath.includes(apiPath);
|
|
333
|
+
}
|
|
334
|
+
isSubsetOfObject(apiQuery, requestQuery) {
|
|
335
|
+
if (!apiQuery)
|
|
336
|
+
return true;
|
|
337
|
+
return this.isJsonSubset(requestQuery, apiQuery);
|
|
338
|
+
}
|
|
339
|
+
isSubsetOfArray(apiBody, requestBody) {
|
|
340
|
+
if (!apiBody)
|
|
341
|
+
return true;
|
|
342
|
+
return this.isJsonSubset(apiBody, requestBody);
|
|
343
|
+
}
|
|
344
|
+
isValueInArray(apiPageCodes, pageCode) {
|
|
345
|
+
return apiPageCodes.includes(pageCode);
|
|
346
|
+
}
|
|
327
347
|
}
|
|
328
348
|
UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
329
349
|
UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
|
@@ -388,11 +408,9 @@ class GlobalErrorService {
|
|
|
388
408
|
}
|
|
389
409
|
handleServerError(error, request) {
|
|
390
410
|
if (this.isPageLevelError(error, request)) {
|
|
391
|
-
console.log('page level error');
|
|
392
411
|
this.publishGlobalError(error);
|
|
393
412
|
}
|
|
394
413
|
else if (this.isComponentLevelError(error, request)) {
|
|
395
|
-
console.log('component level error');
|
|
396
414
|
this.publishLocalError(error, request);
|
|
397
415
|
}
|
|
398
416
|
}
|
|
@@ -403,61 +421,37 @@ class GlobalErrorService {
|
|
|
403
421
|
this.localError$.next({ error, request });
|
|
404
422
|
}
|
|
405
423
|
isPageLevelError(error, request) {
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
if (!isQuerySubset)
|
|
415
|
-
return false;
|
|
416
|
-
const isBodyMatch = this.utilService.isJsonSubset(apiConfig.body, body);
|
|
417
|
-
if (!isBodyMatch)
|
|
418
|
-
return false;
|
|
419
|
-
return apiConfig.pageCodes.includes(pageCode);
|
|
420
|
-
});
|
|
421
|
-
return isConfigMatched;
|
|
424
|
+
const requestDetails = {
|
|
425
|
+
method: request.method,
|
|
426
|
+
path: request.url,
|
|
427
|
+
query: this.utilService.extractQueryParams(request.params),
|
|
428
|
+
body: request.body,
|
|
429
|
+
pageCode: this.getPageCode(),
|
|
430
|
+
};
|
|
431
|
+
return this.pageLevelApiConfig.some((apiConfig) => this.isApiConfigMatching(apiConfig, requestDetails));
|
|
422
432
|
}
|
|
423
433
|
isComponentLevelError(error, request) {
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
query
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
return false;
|
|
432
|
-
if (!path.includes(apiConfig.path))
|
|
433
|
-
return false;
|
|
434
|
-
if (apiConfig.query) {
|
|
435
|
-
const isQuerySubset = this.utilService.isJsonSubset(query, apiConfig.query);
|
|
436
|
-
if (!isQuerySubset)
|
|
437
|
-
return false;
|
|
438
|
-
}
|
|
439
|
-
if (apiConfig.body) {
|
|
440
|
-
const isBodyMatch = this.utilService.isJsonSubset(apiConfig.body, body);
|
|
441
|
-
if (!isBodyMatch)
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
return true;
|
|
445
|
-
});
|
|
446
|
-
return isConfigFound;
|
|
447
|
-
}
|
|
448
|
-
parseRequest(request) {
|
|
449
|
-
const { method, url: path, params, body } = request;
|
|
450
|
-
const query = {};
|
|
451
|
-
params.keys().forEach((key) => {
|
|
452
|
-
query[key] = params.get(key);
|
|
453
|
-
});
|
|
454
|
-
return { method, path, query, body };
|
|
434
|
+
const requestDetails = {
|
|
435
|
+
method: request.method,
|
|
436
|
+
path: request.url,
|
|
437
|
+
query: this.utilService.extractQueryParams(request.params),
|
|
438
|
+
body: request.body,
|
|
439
|
+
};
|
|
440
|
+
return this.componentLevelApiConfig.some((apiConfig) => this.isApiConfigMatching(apiConfig, requestDetails));
|
|
455
441
|
}
|
|
456
442
|
getPageCode() {
|
|
457
443
|
var _a;
|
|
458
444
|
const currentRoute = this.router.routerState.snapshot.root.firstChild;
|
|
459
445
|
return (_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.data) === null || _a === void 0 ? void 0 : _a.pageCode;
|
|
460
446
|
}
|
|
447
|
+
isApiConfigMatching(apiConfig, requestDetails) {
|
|
448
|
+
return (this.utilService.isStringEqual(apiConfig.method, requestDetails.method) &&
|
|
449
|
+
this.utilService.isSubstringInString(apiConfig.path, requestDetails.path) &&
|
|
450
|
+
this.utilService.isSubsetOfObject(apiConfig.query, requestDetails.query) &&
|
|
451
|
+
this.utilService.isSubsetOfArray(apiConfig.body, requestDetails.body) &&
|
|
452
|
+
(!apiConfig.pageCodes ||
|
|
453
|
+
this.utilService.isValueInArray(apiConfig.pageCodes, requestDetails.pageCode || '')));
|
|
454
|
+
}
|
|
461
455
|
}
|
|
462
456
|
GlobalErrorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: GlobalErrorService, deps: [{ token: SnackBarService }, { token: UtilsService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
463
457
|
GlobalErrorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: GlobalErrorService, providedIn: 'root' });
|
|
@@ -468,23 +462,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
468
462
|
}]
|
|
469
463
|
}], ctorParameters: function () { return [{ type: SnackBarService }, { type: UtilsService }, { type: i3.Router }]; } });
|
|
470
464
|
|
|
471
|
-
class AuthService {
|
|
472
|
-
constructor(authorizer) {
|
|
473
|
-
this.authorizer = authorizer;
|
|
474
|
-
}
|
|
475
|
-
logoutUser() {
|
|
476
|
-
this.authorizer.logout();
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AuthService, deps: [{ token: i1.AuthorizerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
480
|
-
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AuthService, providedIn: "root" });
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AuthService, decorators: [{
|
|
482
|
-
type: Injectable,
|
|
483
|
-
args: [{
|
|
484
|
-
providedIn: "root",
|
|
485
|
-
}]
|
|
486
|
-
}], ctorParameters: function () { return [{ type: i1.AuthorizerService }]; } });
|
|
487
|
-
|
|
488
465
|
class RouterService {
|
|
489
466
|
redirectToLogin() {
|
|
490
467
|
window.location.href =
|
|
@@ -504,6 +481,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
504
481
|
|
|
505
482
|
const VCOMPLY_LOGO_URL = 'https://cdn.v-comply.com/logo/prod/v-logo.svg';
|
|
506
483
|
const API_TIMEOUT_TIME = 1000 * 15;
|
|
484
|
+
const ORGANISATION_NAME = 'VCOMPLY TECHNOLOGIES, INC.';
|
|
485
|
+
const ERROR_FEATURE_FLAG = 'ff_error_handling';
|
|
507
486
|
const ERROR_CONFIG = {
|
|
508
487
|
PAGE_NOT_FOUND: {
|
|
509
488
|
imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
|
|
@@ -529,7 +508,7 @@ const ERROR_CONFIG = {
|
|
|
529
508
|
},
|
|
530
509
|
CHUNK_UNAVAILABLE: {
|
|
531
510
|
heading: 'Oops!',
|
|
532
|
-
description: '
|
|
511
|
+
description: 'Something went wrong. Please refresh the page or try again later.',
|
|
533
512
|
buttonText: 'REFRESH',
|
|
534
513
|
},
|
|
535
514
|
SERVER_ERROR: {
|
|
@@ -550,6 +529,17 @@ const ERROR_CONFIG = {
|
|
|
550
529
|
NETWORK_UNAVAILABLE: {
|
|
551
530
|
offlineMessage: "You're currently offline. Please check your internet connection and try again.",
|
|
552
531
|
},
|
|
532
|
+
};
|
|
533
|
+
const REDIRECTION_URL = {
|
|
534
|
+
compliance_dashboard: '/global-dashboard/compliance_dashboard',
|
|
535
|
+
};
|
|
536
|
+
const MODAL_ERROR_TYPES = {
|
|
537
|
+
CHUNK_NOT_FOUND: 'chunk_not_found',
|
|
538
|
+
SESSION_EXPIRED: 'session_expired',
|
|
539
|
+
};
|
|
540
|
+
const ALT_IMAGE_TEXT = {
|
|
541
|
+
ERROR_IMAGE: 'Error Image',
|
|
542
|
+
VCOMPLY_LOGO: 'VComply',
|
|
553
543
|
};
|
|
554
544
|
|
|
555
545
|
class SnackBarComponent {
|
|
@@ -606,7 +596,7 @@ class ErrorModalComponent {
|
|
|
606
596
|
this.authService = authService;
|
|
607
597
|
this.dialogConfig = dialogConfig;
|
|
608
598
|
this.routerService = routerService;
|
|
609
|
-
this.
|
|
599
|
+
this.errorTypes = MODAL_ERROR_TYPES;
|
|
610
600
|
this.data = {
|
|
611
601
|
heading: 'Message',
|
|
612
602
|
description: 'Description',
|
|
@@ -620,16 +610,18 @@ class ErrorModalComponent {
|
|
|
620
610
|
this.errorType = (_b = this.dialogConfig.data) === null || _b === void 0 ? void 0 : _b.errorType;
|
|
621
611
|
}
|
|
622
612
|
onContinueAction() {
|
|
623
|
-
|
|
624
|
-
this.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
613
|
+
switch (this.errorType) {
|
|
614
|
+
case this.errorTypes.SESSION_EXPIRED:
|
|
615
|
+
this.authService.logout();
|
|
616
|
+
this.routerService.redirectToLogin();
|
|
617
|
+
break;
|
|
618
|
+
case this.errorTypes.CHUNK_NOT_FOUND:
|
|
619
|
+
window.location.reload();
|
|
620
|
+
break;
|
|
629
621
|
}
|
|
630
622
|
}
|
|
631
623
|
}
|
|
632
|
-
ErrorModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ErrorModalComponent, deps: [{ token:
|
|
624
|
+
ErrorModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ErrorModalComponent, deps: [{ token: i1.AuthorizerService }, { token: DialogConfig }, { token: RouterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
633
625
|
ErrorModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ErrorModalComponent, selector: "lib-vc-error-modal", inputs: { errorType: "errorType" }, ngImport: i0, template: ` <div class="error-dialog-box">
|
|
634
626
|
<div class="error-dialog-box-top">{{ data.heading }}</div>
|
|
635
627
|
<div class="error-dialog-box-mid">
|
|
@@ -654,7 +646,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
654
646
|
</button>
|
|
655
647
|
</div>
|
|
656
648
|
</div>`, styles: [".error-dialog-box{background:#fff;border-radius:.75rem;box-shadow:0 1px 10px #0003;width:27rem}.error-dialog-box-top{color:#000;font-size:16px;font-weight:500;border-radius:.75rem .75rem 0 0;display:flex;align-items:center;height:3.375rem;padding:0 1rem;margin-bottom:1rem}.error-dialog-box-mid{color:#565a6f;font-size:13px;min-height:5.5rem;padding:0 1rem}.error-dialog-box-bottom{display:flex;justify-content:end;padding:1rem}.error-dialog-box-bottom button.logIn-btn{background:#1e5dd3;border-radius:.125rem;border:none;color:#fff;cursor:pointer;font-size:11px;height:2rem;padding:.5rem .75rem}\n"] }]
|
|
657
|
-
}], ctorParameters: function () { return [{ type:
|
|
649
|
+
}], ctorParameters: function () { return [{ type: i1.AuthorizerService }, { type: DialogConfig }, { type: RouterService }]; }, propDecorators: { errorType: [{
|
|
658
650
|
type: Input
|
|
659
651
|
}] } });
|
|
660
652
|
|
|
@@ -838,6 +830,7 @@ class SessionExpiredComponent {
|
|
|
838
830
|
constructor(dialogService) {
|
|
839
831
|
this.dialogService = dialogService;
|
|
840
832
|
this.errorConfig = ERROR_CONFIG.SESSION_EXPIRED;
|
|
833
|
+
this.errorTypes = MODAL_ERROR_TYPES;
|
|
841
834
|
}
|
|
842
835
|
ngOnInit() {
|
|
843
836
|
this.openSessionExpiredModal();
|
|
@@ -845,7 +838,7 @@ class SessionExpiredComponent {
|
|
|
845
838
|
openSessionExpiredModal() {
|
|
846
839
|
this.dialogService.open(ErrorModalComponent, {
|
|
847
840
|
data: {
|
|
848
|
-
errorType:
|
|
841
|
+
errorType: this.errorTypes.SESSION_EXPIRED,
|
|
849
842
|
errorConfig: this.errorConfig,
|
|
850
843
|
},
|
|
851
844
|
position: 'center',
|
|
@@ -868,6 +861,8 @@ class UnauthorizedComponent {
|
|
|
868
861
|
this.currentYear = new Date().getFullYear();
|
|
869
862
|
this.errorConfig = ERROR_CONFIG.UNAUTHORIZED;
|
|
870
863
|
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
864
|
+
this.altImageText = ALT_IMAGE_TEXT;
|
|
865
|
+
this.organisationName = ORGANISATION_NAME;
|
|
871
866
|
}
|
|
872
867
|
redirectToSupport() {
|
|
873
868
|
window.location.href = this.errorConfig.mail;
|
|
@@ -877,14 +872,19 @@ UnauthorizedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
|
|
|
877
872
|
UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: UnauthorizedComponent, selector: "lib-vc-error-unauthorized", ngImport: i0, template: `
|
|
878
873
|
<div class="errorPage">
|
|
879
874
|
<div class="errorPage-top">
|
|
880
|
-
<img
|
|
875
|
+
<img
|
|
876
|
+
[src]="VcomplyLogo"
|
|
877
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
878
|
+
width="24"
|
|
879
|
+
height="24"
|
|
880
|
+
/>
|
|
881
881
|
</div>
|
|
882
882
|
<div class="errorPage-container">
|
|
883
883
|
<div class="errorPage-inner">
|
|
884
884
|
<div class="errorPage-inner-image">
|
|
885
885
|
<img
|
|
886
886
|
[src]="errorConfig.imageUrl"
|
|
887
|
-
alt="
|
|
887
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
888
888
|
width="246"
|
|
889
889
|
height="178"
|
|
890
890
|
/>
|
|
@@ -894,7 +894,9 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
894
894
|
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
895
895
|
<div class="errorPage-details">
|
|
896
896
|
{{ errorConfig.details }}
|
|
897
|
-
<a href="mailto:
|
|
897
|
+
<a [href]="'mailto:' + errorConfig.email">{{
|
|
898
|
+
errorConfig.email
|
|
899
|
+
}}</a>
|
|
898
900
|
{{ errorConfig.support }}.
|
|
899
901
|
</div>
|
|
900
902
|
<button class="errorPage-btn" (click)="redirectToSupport()">
|
|
@@ -903,7 +905,7 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
903
905
|
</div>
|
|
904
906
|
</div>
|
|
905
907
|
<div class="errorPage-copyright">
|
|
906
|
-
© {{ currentYear }},
|
|
908
|
+
© {{ currentYear }}, {{ organisationName }}
|
|
907
909
|
</div>
|
|
908
910
|
</div>
|
|
909
911
|
</div>
|
|
@@ -913,14 +915,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
913
915
|
args: [{ selector: 'lib-vc-error-unauthorized', template: `
|
|
914
916
|
<div class="errorPage">
|
|
915
917
|
<div class="errorPage-top">
|
|
916
|
-
<img
|
|
918
|
+
<img
|
|
919
|
+
[src]="VcomplyLogo"
|
|
920
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
921
|
+
width="24"
|
|
922
|
+
height="24"
|
|
923
|
+
/>
|
|
917
924
|
</div>
|
|
918
925
|
<div class="errorPage-container">
|
|
919
926
|
<div class="errorPage-inner">
|
|
920
927
|
<div class="errorPage-inner-image">
|
|
921
928
|
<img
|
|
922
929
|
[src]="errorConfig.imageUrl"
|
|
923
|
-
alt="
|
|
930
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
924
931
|
width="246"
|
|
925
932
|
height="178"
|
|
926
933
|
/>
|
|
@@ -930,7 +937,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
930
937
|
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
931
938
|
<div class="errorPage-details">
|
|
932
939
|
{{ errorConfig.details }}
|
|
933
|
-
<a href="mailto:
|
|
940
|
+
<a [href]="'mailto:' + errorConfig.email">{{
|
|
941
|
+
errorConfig.email
|
|
942
|
+
}}</a>
|
|
934
943
|
{{ errorConfig.support }}.
|
|
935
944
|
</div>
|
|
936
945
|
<button class="errorPage-btn" (click)="redirectToSupport()">
|
|
@@ -939,7 +948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
939
948
|
</div>
|
|
940
949
|
</div>
|
|
941
950
|
<div class="errorPage-copyright">
|
|
942
|
-
© {{ currentYear }},
|
|
951
|
+
© {{ currentYear }}, {{ organisationName }}
|
|
943
952
|
</div>
|
|
944
953
|
</div>
|
|
945
954
|
</div>
|
|
@@ -950,6 +959,7 @@ class ChunkUnavailableComponent {
|
|
|
950
959
|
constructor(dialogService) {
|
|
951
960
|
this.dialogService = dialogService;
|
|
952
961
|
this.errorConfig = ERROR_CONFIG.CHUNK_UNAVAILABLE;
|
|
962
|
+
this.errorType = MODAL_ERROR_TYPES;
|
|
953
963
|
}
|
|
954
964
|
ngOnInit() {
|
|
955
965
|
this.openSessionExpiredModal();
|
|
@@ -957,7 +967,7 @@ class ChunkUnavailableComponent {
|
|
|
957
967
|
openSessionExpiredModal() {
|
|
958
968
|
this.dialogService.open(ErrorModalComponent, {
|
|
959
969
|
data: {
|
|
960
|
-
errorType:
|
|
970
|
+
errorType: this.errorType.CHUNK_NOT_FOUND,
|
|
961
971
|
errorConfig: this.errorConfig,
|
|
962
972
|
},
|
|
963
973
|
position: 'center',
|
|
@@ -979,6 +989,7 @@ class ServerErrorComponent {
|
|
|
979
989
|
constructor() {
|
|
980
990
|
this.errorConfig = ERROR_CONFIG.SERVER_ERROR;
|
|
981
991
|
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
992
|
+
this.altImageText = ALT_IMAGE_TEXT;
|
|
982
993
|
}
|
|
983
994
|
refreshPage() {
|
|
984
995
|
window.location.reload();
|
|
@@ -988,14 +999,19 @@ ServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
|
|
|
988
999
|
ServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ServerErrorComponent, selector: "lib-vc-error-server-error", ngImport: i0, template: `
|
|
989
1000
|
<div class="errorPage">
|
|
990
1001
|
<div class="errorPage-top">
|
|
991
|
-
<img
|
|
1002
|
+
<img
|
|
1003
|
+
[src]="VcomplyLogo"
|
|
1004
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
1005
|
+
width="24"
|
|
1006
|
+
height="24"
|
|
1007
|
+
/>
|
|
992
1008
|
</div>
|
|
993
1009
|
<div class="errorPage-container">
|
|
994
1010
|
<div class="errorPage-inner">
|
|
995
1011
|
<div class="errorPage-inner-image">
|
|
996
1012
|
<img
|
|
997
1013
|
[src]="errorConfig.imageUrl"
|
|
998
|
-
alt="
|
|
1014
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
999
1015
|
width="246"
|
|
1000
1016
|
height="178"
|
|
1001
1017
|
/>
|
|
@@ -1017,14 +1033,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1017
1033
|
args: [{ selector: 'lib-vc-error-server-error', template: `
|
|
1018
1034
|
<div class="errorPage">
|
|
1019
1035
|
<div class="errorPage-top">
|
|
1020
|
-
<img
|
|
1036
|
+
<img
|
|
1037
|
+
[src]="VcomplyLogo"
|
|
1038
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
1039
|
+
width="24"
|
|
1040
|
+
height="24"
|
|
1041
|
+
/>
|
|
1021
1042
|
</div>
|
|
1022
1043
|
<div class="errorPage-container">
|
|
1023
1044
|
<div class="errorPage-inner">
|
|
1024
1045
|
<div class="errorPage-inner-image">
|
|
1025
1046
|
<img
|
|
1026
1047
|
[src]="errorConfig.imageUrl"
|
|
1027
|
-
alt="
|
|
1048
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
1028
1049
|
width="246"
|
|
1029
1050
|
height="178"
|
|
1030
1051
|
/>
|
|
@@ -1076,17 +1097,14 @@ class VcErrorHandlersComponent {
|
|
|
1076
1097
|
});
|
|
1077
1098
|
}
|
|
1078
1099
|
handleError(error) {
|
|
1079
|
-
|
|
1080
|
-
this.sessionExpired = true
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
}
|
|
1088
|
-
else if (error.status === ErrorStatusCode.NetworkUnavailable) {
|
|
1089
|
-
this.handleNetworkError();
|
|
1100
|
+
const errorHandlers = {
|
|
1101
|
+
[ErrorStatusCode.Unauthenticated]: () => (this.sessionExpired = true),
|
|
1102
|
+
[ErrorStatusCode.UnauthorizedAccess]: () => (this.unauthorized = true),
|
|
1103
|
+
[ErrorStatusCode.JSChunkUnavailable]: () => (this.chunkUnavailable = true),
|
|
1104
|
+
[ErrorStatusCode.NetworkUnavailable]: () => this.handleNetworkError(),
|
|
1105
|
+
};
|
|
1106
|
+
if (errorHandlers[error.status]) {
|
|
1107
|
+
errorHandlers[error.status]();
|
|
1090
1108
|
}
|
|
1091
1109
|
else if (this.errorService.isServerError(error)) {
|
|
1092
1110
|
this.serverError = true;
|
|
@@ -1139,28 +1157,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1139
1157
|
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
1140
1158
|
|
|
1141
1159
|
class PageNotFoundComponent {
|
|
1142
|
-
constructor(
|
|
1143
|
-
this.router = router;
|
|
1160
|
+
constructor() {
|
|
1144
1161
|
this.errorConfig = ERROR_CONFIG.PAGE_NOT_FOUND;
|
|
1145
1162
|
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
1163
|
+
this.altImageText = ALT_IMAGE_TEXT;
|
|
1146
1164
|
this.currentYear = new Date().getFullYear();
|
|
1165
|
+
this.redirectionUrl = REDIRECTION_URL;
|
|
1166
|
+
this.organisationName = ORGANISATION_NAME;
|
|
1147
1167
|
}
|
|
1148
1168
|
redirectToHome() {
|
|
1149
|
-
window.location.replace(
|
|
1169
|
+
window.location.replace(this.redirectionUrl.compliance_dashboard);
|
|
1150
1170
|
}
|
|
1151
1171
|
}
|
|
1152
|
-
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [
|
|
1172
|
+
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1153
1173
|
PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: PageNotFoundComponent, selector: "lib-vc-error-page-not-found", ngImport: i0, template: `
|
|
1154
1174
|
<div class="errorPage">
|
|
1155
1175
|
<div class="errorPage-top">
|
|
1156
|
-
<img
|
|
1176
|
+
<img
|
|
1177
|
+
[src]="VcomplyLogo"
|
|
1178
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
1179
|
+
width="24"
|
|
1180
|
+
height="24"
|
|
1181
|
+
/>
|
|
1157
1182
|
</div>
|
|
1158
1183
|
<div class="errorPage-container">
|
|
1159
1184
|
<div class="errorPage-inner">
|
|
1160
1185
|
<div class="errorPage-inner-image">
|
|
1161
1186
|
<img
|
|
1162
1187
|
[src]="errorConfig.imageUrl"
|
|
1163
|
-
alt="
|
|
1188
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
1164
1189
|
width="246"
|
|
1165
1190
|
height="178"
|
|
1166
1191
|
/>
|
|
@@ -1175,7 +1200,7 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
1175
1200
|
</div>
|
|
1176
1201
|
</div>
|
|
1177
1202
|
<div class="errorPage-copyright">
|
|
1178
|
-
© {{ currentYear }},
|
|
1203
|
+
© {{ currentYear }}, {{ organisationName }}
|
|
1179
1204
|
</div>
|
|
1180
1205
|
</div>
|
|
1181
1206
|
</div>
|
|
@@ -1185,14 +1210,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1185
1210
|
args: [{ selector: 'lib-vc-error-page-not-found', template: `
|
|
1186
1211
|
<div class="errorPage">
|
|
1187
1212
|
<div class="errorPage-top">
|
|
1188
|
-
<img
|
|
1213
|
+
<img
|
|
1214
|
+
[src]="VcomplyLogo"
|
|
1215
|
+
[alt]="altImageText.VCOMPLY_LOGO"
|
|
1216
|
+
width="24"
|
|
1217
|
+
height="24"
|
|
1218
|
+
/>
|
|
1189
1219
|
</div>
|
|
1190
1220
|
<div class="errorPage-container">
|
|
1191
1221
|
<div class="errorPage-inner">
|
|
1192
1222
|
<div class="errorPage-inner-image">
|
|
1193
1223
|
<img
|
|
1194
1224
|
[src]="errorConfig.imageUrl"
|
|
1195
|
-
alt="
|
|
1225
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
1196
1226
|
width="246"
|
|
1197
1227
|
height="178"
|
|
1198
1228
|
/>
|
|
@@ -1207,16 +1237,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1207
1237
|
</div>
|
|
1208
1238
|
</div>
|
|
1209
1239
|
<div class="errorPage-copyright">
|
|
1210
|
-
© {{ currentYear }},
|
|
1240
|
+
© {{ currentYear }}, {{ organisationName }}
|
|
1211
1241
|
</div>
|
|
1212
1242
|
</div>
|
|
1213
1243
|
</div>
|
|
1214
1244
|
`, styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";.errorPage{background:#161b2f;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999}.errorPage-top{width:100%;height:3rem;display:flex;align-items:center;padding-left:.75rem}.errorPage-container{background:#f2f2f5;border-radius:.75rem;border:1px solid #e3e3e9;box-shadow:0 4px 8px #1d5dd31a;height:calc(100vh - 3.75rem);display:flex;align-items:center;justify-content:center;padding:0 4rem;margin:0 .75rem;position:relative}.errorPage-inner{display:flex;align-items:center}.errorPage-inner-image{width:16rem}.errorPage-inner-right{margin-left:2rem;width:calc(100% - 18rem)}.errorPage-inner-right .errorPage-heading{-webkit-text-fill-color:#e3e3e9;-webkit-text-stroke-color:#a9aab6;-webkit-text-stroke-width:1px;color:#e3e3e9;font-size:78px;font-weight:bold;line-height:110px;margin-bottom:1.5rem}.errorPage-inner-right .errorPage-text{color:#141724;font-size:19px;font-weight:500;line-height:1.75rem;margin-bottom:.5rem}.errorPage-inner-right .errorPage-details{color:#565a6f;font-size:13px;line-height:20px;margin-bottom:1.75rem}.errorPage-inner-right .errorPage-btn{background:#1e5dd3;border-radius:.25rem;border:none;color:#fff;display:inline-flex;align-items:center;font-size:11px;font-weight:500;line-height:2rem;padding:0 1rem}.errorPage-inner-right .errorPage-btn i{font-size:14px;margin-left:.25rem}.errorPage-copyright{font-size:11px;color:#787a8c;font-weight:500;position:absolute;bottom:8px;right:16px;line-height:16px}\n"] }]
|
|
1215
|
-
}]
|
|
1245
|
+
}] });
|
|
1216
1246
|
|
|
1217
1247
|
class ComponentLevelServerErrorComponent {
|
|
1218
1248
|
constructor() {
|
|
1219
1249
|
this.errorConfig = ERROR_CONFIG.COMPONENT_LEVEL_SERVER_ERROR;
|
|
1250
|
+
this.altImageText = ALT_IMAGE_TEXT;
|
|
1220
1251
|
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
1221
1252
|
this.onClick = new EventEmitter();
|
|
1222
1253
|
}
|
|
@@ -1228,7 +1259,7 @@ ComponentLevelServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersio
|
|
|
1228
1259
|
<div class="serverError-inner-image">
|
|
1229
1260
|
<img
|
|
1230
1261
|
[src]="errorConfig.imageUrl"
|
|
1231
|
-
alt="
|
|
1262
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
1232
1263
|
width="106"
|
|
1233
1264
|
height="76"
|
|
1234
1265
|
/>
|
|
@@ -1253,7 +1284,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1253
1284
|
<div class="serverError-inner-image">
|
|
1254
1285
|
<img
|
|
1255
1286
|
[src]="errorConfig.imageUrl"
|
|
1256
|
-
alt="
|
|
1287
|
+
[alt]="altImageText.ERROR_IMAGE"
|
|
1257
1288
|
width="106"
|
|
1258
1289
|
height="76"
|
|
1259
1290
|
/>
|
|
@@ -1524,15 +1555,13 @@ class SentryErrorHandler {
|
|
|
1524
1555
|
}
|
|
1525
1556
|
handleError(error) {
|
|
1526
1557
|
const ERROR = (error === null || error === void 0 ? void 0 : error.originalError) || error;
|
|
1527
|
-
this.
|
|
1558
|
+
this.handleChunkError(ERROR);
|
|
1528
1559
|
Sentry.captureException(ERROR);
|
|
1529
1560
|
}
|
|
1530
|
-
|
|
1531
|
-
const
|
|
1532
|
-
if (
|
|
1533
|
-
|
|
1534
|
-
status: ErrorStatusCode.JSChunkUnavailable,
|
|
1535
|
-
});
|
|
1561
|
+
handleChunkError(error) {
|
|
1562
|
+
const chunkFailedMessage = /Loading chunk [\d]+ failed/;
|
|
1563
|
+
if (chunkFailedMessage.test(error === null || error === void 0 ? void 0 : error.message)) {
|
|
1564
|
+
window.location.reload();
|
|
1536
1565
|
}
|
|
1537
1566
|
}
|
|
1538
1567
|
}
|
|
@@ -1552,7 +1581,7 @@ class HttpReqInterceptor {
|
|
|
1552
1581
|
this.featureFlagService = featureFlagService;
|
|
1553
1582
|
}
|
|
1554
1583
|
intercept(req, next) {
|
|
1555
|
-
if (this.featureFlagService.isFeatureEnabled(
|
|
1584
|
+
if (this.featureFlagService.isFeatureEnabled(ERROR_FEATURE_FLAG)) {
|
|
1556
1585
|
return next.handle(req).pipe(timeout(API_TIMEOUT_TIME), tap((event) => {
|
|
1557
1586
|
if (event instanceof HttpResponse) {
|
|
1558
1587
|
this.errorService.handleSoftErrors(event);
|
|
@@ -1646,5 +1675,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1646
1675
|
* Generated bundle index. Do not edit.
|
|
1647
1676
|
*/
|
|
1648
1677
|
|
|
1649
|
-
export {
|
|
1678
|
+
export { ChunkUnavailableComponent, ComponentLevelServerErrorComponent, ErrorModalComponent, FOR_ROOT_SENTRY_OPTIONS_TOKEN, GlobalErrorService, HttpReqInterceptor, PageNotFoundComponent, RouterService, ServerErrorComponent, SessionExpiredComponent, UnauthorizedComponent, VcErrorHandlersComponent, VcErrorHandlersModule, VcErrorHandlersService };
|
|
1650
1679
|
//# sourceMappingURL=vc-error-handlers.mjs.map
|