vc-error-handlers 0.1.7 → 0.1.8
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/shared/components/chunk-unavailable/chunk-unavailable.component.mjs +26 -6
- package/esm2020/lib/shared/components/error-modal/error-modal.component.mjs +61 -0
- package/esm2020/lib/shared/components/page-not-found/page-not-found.component.mjs +27 -25
- package/esm2020/lib/shared/components/server-error/server-error.component.mjs +63 -6
- package/esm2020/lib/shared/components/session-expired/session-expired.component.mjs +11 -11
- package/esm2020/lib/shared/components/unauthorized/unauthorized.component.mjs +21 -22
- package/esm2020/lib/shared/constants/error-handling.constants.mjs +19 -2
- package/esm2020/lib/shared/errorhandler/sentry-error.handler.mjs +15 -10
- package/esm2020/lib/shared/interceptors/http.interceptor.mjs +24 -6
- package/esm2020/lib/shared/types/global-error.types.mjs +1 -1
- package/esm2020/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.mjs +1 -2
- package/esm2020/lib/vc-error-handlers.component.mjs +58 -10
- package/esm2020/lib/vc-error-handlers.module.mjs +6 -6
- package/esm2020/public-api.mjs +2 -2
- package/fesm2015/vc-error-handlers.mjs +356 -189
- package/fesm2015/vc-error-handlers.mjs.map +1 -1
- package/fesm2020/vc-error-handlers.mjs +355 -189
- package/fesm2020/vc-error-handlers.mjs.map +1 -1
- package/lib/shared/components/chunk-unavailable/chunk-unavailable.component.d.ts +10 -2
- package/lib/shared/components/error-modal/error-modal.component.d.ts +17 -0
- package/lib/shared/components/page-not-found/page-not-found.component.d.ts +5 -1
- package/lib/shared/components/server-error/server-error.component.d.ts +12 -5
- package/lib/shared/components/session-expired/session-expired.component.d.ts +1 -3
- package/lib/shared/components/unauthorized/unauthorized.component.d.ts +3 -1
- package/lib/shared/constants/error-handling.constants.d.ts +18 -1
- package/lib/shared/errorhandler/sentry-error.handler.d.ts +5 -3
- package/lib/shared/interceptors/http.interceptor.d.ts +4 -1
- package/lib/shared/types/global-error.types.d.ts +1 -1
- package/lib/vc-error-handlers.component.d.ts +14 -2
- package/lib/vc-error-handlers.module.d.ts +2 -2
- package/package.json +2 -2
- package/public-api.d.ts +1 -1
- package/esm2020/lib/shared/components/session-expired-modal/session-expired-modal.component.mjs +0 -48
- package/lib/shared/components/session-expired-modal/session-expired-modal.component.d.ts +0 -18
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, Directive, ViewChild, NgModule, Optional, InjectionToken, ErrorHandler } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Input, Directive, ViewChild, NgModule, Optional, InjectionToken, ErrorHandler } from '@angular/core';
|
|
3
3
|
import { Subject, throwError } from 'rxjs';
|
|
4
4
|
import * as i1 from '@vcomply/authorizer';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i2 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
import * as i3 from '@angular/router';
|
|
8
8
|
import { NavigationStart, NavigationEnd, NavigationError } from '@angular/router';
|
|
9
|
-
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
9
|
+
import { HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
10
10
|
import * as Sentry from '@sentry/angular-ivy';
|
|
11
|
-
import { timeout, catchError } from 'rxjs/operators';
|
|
11
|
+
import { timeout, tap, catchError } from 'rxjs/operators';
|
|
12
12
|
|
|
13
13
|
class VcErrorHandlersService {
|
|
14
14
|
constructor() { }
|
|
@@ -103,7 +103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
103
103
|
}]
|
|
104
104
|
}] });
|
|
105
105
|
|
|
106
|
-
const
|
|
106
|
+
const VCOMPLY_LOGO_URL = 'https://cdn.v-comply.com/logo/prod/v-logo.svg';
|
|
107
107
|
const API_TIMEOUT_TIME = 1000 * 15;
|
|
108
108
|
const ERROR_CONFIG = {
|
|
109
109
|
PAGE_NOT_FOUND: {
|
|
@@ -121,59 +121,164 @@ const ERROR_CONFIG = {
|
|
|
121
121
|
email: 'help@v-comply.com',
|
|
122
122
|
support: 'for support',
|
|
123
123
|
buttonText: 'CONTACT SUPPORT',
|
|
124
|
+
mail: 'mailto:help@v-comply.com',
|
|
124
125
|
},
|
|
125
126
|
SESSION_EXPIRED: {
|
|
126
127
|
heading: 'Session Expired!',
|
|
127
128
|
description: 'Your session has expired. Please log in again to continue using the app.',
|
|
128
129
|
buttonText: 'LOGIN',
|
|
129
130
|
},
|
|
131
|
+
CHUNK_UNAVAILABLE: {
|
|
132
|
+
heading: 'Oops!',
|
|
133
|
+
description: 'We are unable to load the data.',
|
|
134
|
+
buttonText: 'REFRESH',
|
|
135
|
+
},
|
|
136
|
+
SERVER_ERROR: {
|
|
137
|
+
imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
|
|
138
|
+
title: 'Oops!',
|
|
139
|
+
description: 'We are unable to load the data.',
|
|
140
|
+
details: 'Please refresh this page or try again later.',
|
|
141
|
+
buttonText: 'REFRESH',
|
|
142
|
+
snackBarMessage: `Oops! Something went wrong. Please try again later.`,
|
|
143
|
+
},
|
|
144
|
+
NETWORK_UNAVAILABLE: {
|
|
145
|
+
offlineMessage: "You're currently offline.Please check your internet connection and try again.",
|
|
146
|
+
},
|
|
130
147
|
};
|
|
131
148
|
|
|
149
|
+
class SnackBarService {
|
|
150
|
+
constructor() {
|
|
151
|
+
this.snackbarSubject = new Subject();
|
|
152
|
+
this.snackbarState = this.snackbarSubject.asObservable();
|
|
153
|
+
}
|
|
154
|
+
show(message, type) {
|
|
155
|
+
this.snackbarSubject.next({
|
|
156
|
+
show: true,
|
|
157
|
+
message,
|
|
158
|
+
icon: type,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
hide() {
|
|
162
|
+
this.snackbarSubject.next({
|
|
163
|
+
show: false,
|
|
164
|
+
message: '',
|
|
165
|
+
icon: '',
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
SnackBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
170
|
+
SnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarService, providedIn: 'root' });
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarService, decorators: [{
|
|
172
|
+
type: Injectable,
|
|
173
|
+
args: [{
|
|
174
|
+
providedIn: 'root',
|
|
175
|
+
}]
|
|
176
|
+
}], ctorParameters: function () { return []; } });
|
|
177
|
+
|
|
178
|
+
class SnackBarComponent {
|
|
179
|
+
constructor(snackbarService) {
|
|
180
|
+
this.snackbarService = snackbarService;
|
|
181
|
+
this.show = false;
|
|
182
|
+
this.message = '--';
|
|
183
|
+
this.icon = '';
|
|
184
|
+
this.type = 'alert';
|
|
185
|
+
this.icons = {
|
|
186
|
+
success: '',
|
|
187
|
+
warning: '',
|
|
188
|
+
info: '',
|
|
189
|
+
alert: '',
|
|
190
|
+
error: '',
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
ngOnInit() {
|
|
194
|
+
this.snackbarSubscription = this.snackbarService.snackbarState.subscribe((state) => {
|
|
195
|
+
if (state.icon && Object.keys(this.icons).includes(state?.icon)) {
|
|
196
|
+
this.icon = this.icons[state.icon];
|
|
197
|
+
this.type = state?.icon;
|
|
198
|
+
}
|
|
199
|
+
this.message = state.message;
|
|
200
|
+
this.show = state.show;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
setAutoClose() {
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
this.show = false;
|
|
206
|
+
this.close();
|
|
207
|
+
}, 3000);
|
|
208
|
+
}
|
|
209
|
+
close() {
|
|
210
|
+
this.show = false;
|
|
211
|
+
this.snackbarService.hide();
|
|
212
|
+
}
|
|
213
|
+
ngOnDestroy() {
|
|
214
|
+
this.snackbarSubscription.unsubscribe();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarComponent, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
218
|
+
SnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SnackBarComponent, selector: "app-snack-bar", ngImport: i0, template: "<div class=\"workflow-snackbar\" *ngIf=\"show\">\r\n <div class=\"workflow-snackbar-inner\">\r\n <div class=\"workflow-snackbarText\">\r\n <!--  -->\r\n <i class=\"icons\" [class]=\"type\" [innerHTML]=\"icon\"></i> <span [innerHTML]=\"message\">{{ message }}</span>\r\n </div>\r\n <button (click)=\"close()\">[ <span>Close</span> ]</button>\r\n </div>\r\n </div>", styles: ["::ng-deep .workflow-snackbar{position:fixed;top:20px;left:0;right:0;display:flex;align-items:center;justify-content:center;z-index:2147483647!important;pointer-events:none;animation:slide-top .3s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .workflow-snackbar.white{background-color:#fff;color:#000;z-index:20}::ng-deep .workflow-snackbar.white button{color:#f6882f;font-size:11px;font-weight:400;pointer-events:all}::ng-deep .workflow-snackbar .workflow-snackbar-inner{display:flex;max-width:500px;min-width:450px;align-items:center;justify-content:space-between;padding:10px;background:#ffffff;border-radius:3px;box-shadow:0 0 10px #0003;min-height:55px;pointer-events:auto}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText{color:#161b2f;font-size:13px;display:flex;align-items:center;width:calc(100% - 70px)}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i{background:#f1f1f1;color:#d93b41;border-radius:50px;font-size:16px;width:30px;height:30px;text-align:center;line-height:28px;margin-right:10px;min-width:30px}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.success{color:#34aa44}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.warning{color:#f0b819}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.info{color:#1e5dd3}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.alert,::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.error{color:#d93b41}::ng-deep .workflow-snackbar .workflow-snackbar-inner button{background:transparent;border:none;font-size:11px;padding:0;position:relative;color:#747576;width:65px;text-align:right;cursor:pointer;text-transform:uppercase}::ng-deep .workflow-snackbar .workflow-snackbar-inner button span{color:#1e5dd3;font-weight:500}::ng-deep .workflow-snackbar .workflow-snackbar-inner button:focus{outline:none}@keyframes slide-top{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
220
|
+
type: Component,
|
|
221
|
+
args: [{ selector: 'app-snack-bar', template: "<div class=\"workflow-snackbar\" *ngIf=\"show\">\r\n <div class=\"workflow-snackbar-inner\">\r\n <div class=\"workflow-snackbarText\">\r\n <!--  -->\r\n <i class=\"icons\" [class]=\"type\" [innerHTML]=\"icon\"></i> <span [innerHTML]=\"message\">{{ message }}</span>\r\n </div>\r\n <button (click)=\"close()\">[ <span>Close</span> ]</button>\r\n </div>\r\n </div>", styles: ["::ng-deep .workflow-snackbar{position:fixed;top:20px;left:0;right:0;display:flex;align-items:center;justify-content:center;z-index:2147483647!important;pointer-events:none;animation:slide-top .3s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .workflow-snackbar.white{background-color:#fff;color:#000;z-index:20}::ng-deep .workflow-snackbar.white button{color:#f6882f;font-size:11px;font-weight:400;pointer-events:all}::ng-deep .workflow-snackbar .workflow-snackbar-inner{display:flex;max-width:500px;min-width:450px;align-items:center;justify-content:space-between;padding:10px;background:#ffffff;border-radius:3px;box-shadow:0 0 10px #0003;min-height:55px;pointer-events:auto}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText{color:#161b2f;font-size:13px;display:flex;align-items:center;width:calc(100% - 70px)}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i{background:#f1f1f1;color:#d93b41;border-radius:50px;font-size:16px;width:30px;height:30px;text-align:center;line-height:28px;margin-right:10px;min-width:30px}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.success{color:#34aa44}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.warning{color:#f0b819}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.info{color:#1e5dd3}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.alert,::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.error{color:#d93b41}::ng-deep .workflow-snackbar .workflow-snackbar-inner button{background:transparent;border:none;font-size:11px;padding:0;position:relative;color:#747576;width:65px;text-align:right;cursor:pointer;text-transform:uppercase}::ng-deep .workflow-snackbar .workflow-snackbar-inner button span{color:#1e5dd3;font-weight:500}::ng-deep .workflow-snackbar .workflow-snackbar-inner button:focus{outline:none}@keyframes slide-top{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
222
|
+
}], ctorParameters: function () { return [{ type: SnackBarService }]; } });
|
|
223
|
+
|
|
132
224
|
class DialogConfig {
|
|
133
225
|
}
|
|
134
226
|
|
|
135
|
-
class
|
|
136
|
-
constructor(dialogConfig, routerService) {
|
|
227
|
+
class ErrorModalComponent {
|
|
228
|
+
constructor(authService, dialogConfig, routerService) {
|
|
229
|
+
this.authService = authService;
|
|
137
230
|
this.dialogConfig = dialogConfig;
|
|
138
231
|
this.routerService = routerService;
|
|
139
|
-
this.
|
|
232
|
+
this.errorType = 'session_expired';
|
|
140
233
|
this.data = {
|
|
141
|
-
|
|
234
|
+
heading: 'Message',
|
|
142
235
|
description: 'Description',
|
|
143
236
|
buttonText: 'Click Action',
|
|
144
237
|
};
|
|
145
|
-
this.
|
|
238
|
+
this.setDataConfig();
|
|
239
|
+
}
|
|
240
|
+
setDataConfig() {
|
|
241
|
+
this.data = this.dialogConfig.data?.errorConfig;
|
|
242
|
+
this.errorType = this.dialogConfig.data?.errorType;
|
|
146
243
|
}
|
|
147
244
|
onContinueAction() {
|
|
148
|
-
this.
|
|
245
|
+
if (this.errorType === 'session_expired') {
|
|
246
|
+
this.authService.logoutUser();
|
|
247
|
+
this.routerService.redirectToLogin();
|
|
248
|
+
}
|
|
249
|
+
else if (this.errorType === 'chunk_not_found') {
|
|
250
|
+
window.location.reload();
|
|
251
|
+
}
|
|
149
252
|
}
|
|
150
253
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<div class="error-dialog-box-top">{{
|
|
254
|
+
ErrorModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ErrorModalComponent, deps: [{ token: AuthService }, { token: DialogConfig }, { token: RouterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
255
|
+
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">
|
|
256
|
+
<div class="error-dialog-box-top">{{ data.heading }}</div>
|
|
154
257
|
<div class="error-dialog-box-mid">
|
|
155
|
-
{{
|
|
258
|
+
{{ data.description }}
|
|
156
259
|
</div>
|
|
157
260
|
<div class="error-dialog-box-bottom">
|
|
158
261
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
159
|
-
{{
|
|
262
|
+
{{ data.buttonText }}
|
|
160
263
|
</button>
|
|
161
264
|
</div>
|
|
162
265
|
</div>`, isInline: true, 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"] });
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type:
|
|
266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ErrorModalComponent, decorators: [{
|
|
164
267
|
type: Component,
|
|
165
|
-
args: [{ selector: 'lib-vc-error-
|
|
166
|
-
<div class="error-dialog-box-top">{{
|
|
268
|
+
args: [{ selector: 'lib-vc-error-modal', template: ` <div class="error-dialog-box">
|
|
269
|
+
<div class="error-dialog-box-top">{{ data.heading }}</div>
|
|
167
270
|
<div class="error-dialog-box-mid">
|
|
168
|
-
{{
|
|
271
|
+
{{ data.description }}
|
|
169
272
|
</div>
|
|
170
273
|
<div class="error-dialog-box-bottom">
|
|
171
274
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
172
|
-
{{
|
|
275
|
+
{{ data.buttonText }}
|
|
173
276
|
</button>
|
|
174
277
|
</div>
|
|
175
278
|
</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"] }]
|
|
176
|
-
}], ctorParameters: function () { return [{ type: DialogConfig }, { type: RouterService }]; }
|
|
279
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: DialogConfig }, { type: RouterService }]; }, propDecorators: { errorType: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}] } });
|
|
177
282
|
|
|
178
283
|
class InsertionDirective {
|
|
179
284
|
constructor(viewContainerRef) {
|
|
@@ -267,7 +372,7 @@ class DialogComponent {
|
|
|
267
372
|
}
|
|
268
373
|
}
|
|
269
374
|
DialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DialogComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: DialogRef }, { token: DialogConfig }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
270
|
-
DialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: DialogComponent, selector: "app-dialog", viewQueries: [{ propertyName: "insertionPoint", first: true, predicate: InsertionDirective, descendants: true, static: true }], ngImport: i0, template: "<div\r\n class=\"overlay\"\r\n (click)=\"onOverlayClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER',\r\n black: background === 'black',\r\n whiteBlur: background === 'whiteBlur'\r\n }\" [class.pointer-none]=\"pointer === 'none'\"\r\n>\r\n <div\r\n class=\"dialog\"\r\n [class.animate]=\"animation\"\r\n (click)=\"onDialogClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER'\r\n }\"\r\n >\r\n <ng-template appInsertion></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".overlay{display:flex;position:fixed;top:0;bottom:0;left:0;right:0;align-items:center;justify-content:center;z-index:2147483009!important}.overlay.low{z-index:1}.overlay.black{background:#161b2fcc}.overlay.whiteBlur{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.overlay.top{align-items:flex-start}.overlay.right{justify-content:flex-end}.overlay.bottom{align-items:flex-end}.overlay.left{justify-content:flex-start}.dialog{position:relative}.dialog.animate.top{animation:animate-top .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-top{0%{transform:translateY(-100px)}to{transform:translateY(0)}}.dialog.animate.right{animation:animate-right .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-right{0%{transform:translate(100%)}to{transform:translate(0)}}.pointer-none{pointer-events:none}\n"], directives: [{ type:
|
|
375
|
+
DialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: DialogComponent, selector: "app-dialog", viewQueries: [{ propertyName: "insertionPoint", first: true, predicate: InsertionDirective, descendants: true, static: true }], ngImport: i0, template: "<div\r\n class=\"overlay\"\r\n (click)=\"onOverlayClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER',\r\n black: background === 'black',\r\n whiteBlur: background === 'whiteBlur'\r\n }\" [class.pointer-none]=\"pointer === 'none'\"\r\n>\r\n <div\r\n class=\"dialog\"\r\n [class.animate]=\"animation\"\r\n (click)=\"onDialogClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER'\r\n }\"\r\n >\r\n <ng-template appInsertion></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".overlay{display:flex;position:fixed;top:0;bottom:0;left:0;right:0;align-items:center;justify-content:center;z-index:2147483009!important}.overlay.low{z-index:1}.overlay.black{background:#161b2fcc}.overlay.whiteBlur{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.overlay.top{align-items:flex-start}.overlay.right{justify-content:flex-end}.overlay.bottom{align-items:flex-end}.overlay.left{justify-content:flex-start}.dialog{position:relative}.dialog.animate.top{animation:animate-top .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-top{0%{transform:translateY(-100px)}to{transform:translateY(0)}}.dialog.animate.right{animation:animate-right .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-right{0%{transform:translate(100%)}to{transform:translate(0)}}.pointer-none{pointer-events:none}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: InsertionDirective, selector: "[appInsertion]" }] });
|
|
271
376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DialogComponent, decorators: [{
|
|
272
377
|
type: Component,
|
|
273
378
|
args: [{ selector: 'app-dialog', template: "<div\r\n class=\"overlay\"\r\n (click)=\"onOverlayClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER',\r\n black: background === 'black',\r\n whiteBlur: background === 'whiteBlur'\r\n }\" [class.pointer-none]=\"pointer === 'none'\"\r\n>\r\n <div\r\n class=\"dialog\"\r\n [class.animate]=\"animation\"\r\n (click)=\"onDialogClicked($event)\"\r\n [ngClass]=\"{\r\n top: position === 'TOP',\r\n right: position === 'RIGHT',\r\n bottom: position === 'BOTTOM',\r\n left: position === 'LEFT',\r\n center: position === 'CENTER'\r\n }\"\r\n >\r\n <ng-template appInsertion></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".overlay{display:flex;position:fixed;top:0;bottom:0;left:0;right:0;align-items:center;justify-content:center;z-index:2147483009!important}.overlay.low{z-index:1}.overlay.black{background:#161b2fcc}.overlay.whiteBlur{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.overlay.top{align-items:flex-start}.overlay.right{justify-content:flex-end}.overlay.bottom{align-items:flex-end}.overlay.left{justify-content:flex-start}.dialog{position:relative}.dialog.animate.top{animation:animate-top .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-top{0%{transform:translateY(-100px)}to{transform:translateY(0)}}.dialog.animate.right{animation:animate-right .2s cubic-bezier(.25,.46,.45,.94) both}@keyframes animate-right{0%{transform:translate(100%)}to{transform:translate(0)}}.pointer-none{pointer-events:none}\n"] }]
|
|
@@ -352,24 +457,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
352
457
|
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
353
458
|
|
|
354
459
|
class SessionExpiredComponent {
|
|
355
|
-
constructor(
|
|
356
|
-
this.authService = authService;
|
|
460
|
+
constructor(dialogService) {
|
|
357
461
|
this.dialogService = dialogService;
|
|
358
462
|
this.errorConfig = ERROR_CONFIG.SESSION_EXPIRED;
|
|
359
463
|
}
|
|
360
464
|
ngOnInit() {
|
|
361
|
-
this.authService.logoutUser();
|
|
362
465
|
this.openSessionExpiredModal();
|
|
363
466
|
}
|
|
364
467
|
openSessionExpiredModal() {
|
|
365
|
-
this.dialogService.open(
|
|
366
|
-
data:
|
|
468
|
+
this.dialogService.open(ErrorModalComponent, {
|
|
469
|
+
data: {
|
|
470
|
+
errorType: 'session_expired',
|
|
471
|
+
errorConfig: this.errorConfig,
|
|
472
|
+
},
|
|
367
473
|
position: 'center',
|
|
368
474
|
background: 'whiteBlur',
|
|
369
475
|
});
|
|
370
476
|
}
|
|
371
477
|
}
|
|
372
|
-
SessionExpiredComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, deps: [{ token:
|
|
478
|
+
SessionExpiredComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
373
479
|
SessionExpiredComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SessionExpiredComponent, selector: "lib-vc-error-session-expired", ngImport: i0, template: ``, isInline: true });
|
|
374
480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, decorators: [{
|
|
375
481
|
type: Component,
|
|
@@ -377,25 +483,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
377
483
|
selector: 'lib-vc-error-session-expired',
|
|
378
484
|
template: ``,
|
|
379
485
|
}]
|
|
380
|
-
}], ctorParameters: function () { return [{ type:
|
|
486
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; } });
|
|
381
487
|
|
|
382
488
|
class UnauthorizedComponent {
|
|
383
489
|
constructor() {
|
|
490
|
+
this.currentYear = new Date().getFullYear();
|
|
384
491
|
this.errorConfig = ERROR_CONFIG.UNAUTHORIZED;
|
|
385
|
-
this.
|
|
492
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
493
|
+
}
|
|
494
|
+
redirectToSupport() {
|
|
495
|
+
window.location.href = this.errorConfig.mail;
|
|
386
496
|
}
|
|
387
|
-
redirectToSupport() { }
|
|
388
497
|
}
|
|
389
498
|
UnauthorizedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
390
499
|
UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: UnauthorizedComponent, selector: "lib-vc-error-unauthorized", ngImport: i0, template: `
|
|
391
500
|
<div class="errorPage">
|
|
392
501
|
<div class="errorPage-top">
|
|
393
|
-
<img
|
|
394
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
395
|
-
alt="VComply"
|
|
396
|
-
width="24"
|
|
397
|
-
height="24"
|
|
398
|
-
/>
|
|
502
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
399
503
|
</div>
|
|
400
504
|
<div class="errorPage-container">
|
|
401
505
|
<div class="errorPage-inner">
|
|
@@ -403,8 +507,8 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
403
507
|
<img
|
|
404
508
|
[src]="errorConfig.imageUrl"
|
|
405
509
|
alt="Error Image"
|
|
406
|
-
width="
|
|
407
|
-
height="
|
|
510
|
+
width="246"
|
|
511
|
+
height="178"
|
|
408
512
|
/>
|
|
409
513
|
</div>
|
|
410
514
|
<div class="errorPage-inner-right">
|
|
@@ -420,20 +524,18 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
420
524
|
</button>
|
|
421
525
|
</div>
|
|
422
526
|
</div>
|
|
527
|
+
<div class="errorPage-copyright">
|
|
528
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
529
|
+
</div>
|
|
423
530
|
</div>
|
|
424
531
|
</div>
|
|
425
|
-
`, isInline: true, 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}.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}\n"] });
|
|
532
|
+
`, isInline: true, 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"] });
|
|
426
533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, decorators: [{
|
|
427
534
|
type: Component,
|
|
428
535
|
args: [{ selector: 'lib-vc-error-unauthorized', template: `
|
|
429
536
|
<div class="errorPage">
|
|
430
537
|
<div class="errorPage-top">
|
|
431
|
-
<img
|
|
432
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
433
|
-
alt="VComply"
|
|
434
|
-
width="24"
|
|
435
|
-
height="24"
|
|
436
|
-
/>
|
|
538
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
437
539
|
</div>
|
|
438
540
|
<div class="errorPage-container">
|
|
439
541
|
<div class="errorPage-inner">
|
|
@@ -441,8 +543,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
441
543
|
<img
|
|
442
544
|
[src]="errorConfig.imageUrl"
|
|
443
545
|
alt="Error Image"
|
|
444
|
-
width="
|
|
445
|
-
height="
|
|
546
|
+
width="246"
|
|
547
|
+
height="178"
|
|
446
548
|
/>
|
|
447
549
|
</div>
|
|
448
550
|
<div class="errorPage-inner-right">
|
|
@@ -458,19 +560,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
458
560
|
</button>
|
|
459
561
|
</div>
|
|
460
562
|
</div>
|
|
563
|
+
<div class="errorPage-copyright">
|
|
564
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
565
|
+
</div>
|
|
461
566
|
</div>
|
|
462
567
|
</div>
|
|
463
|
-
`, 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}.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}\n"] }]
|
|
568
|
+
`, 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"] }]
|
|
464
569
|
}] });
|
|
465
570
|
|
|
571
|
+
class ChunkUnavailableComponent {
|
|
572
|
+
constructor(dialogService) {
|
|
573
|
+
this.dialogService = dialogService;
|
|
574
|
+
this.errorConfig = ERROR_CONFIG.CHUNK_UNAVAILABLE;
|
|
575
|
+
}
|
|
576
|
+
ngOnInit() {
|
|
577
|
+
this.openSessionExpiredModal();
|
|
578
|
+
}
|
|
579
|
+
openSessionExpiredModal() {
|
|
580
|
+
this.dialogService.open(ErrorModalComponent, {
|
|
581
|
+
data: {
|
|
582
|
+
errorType: 'chunk_not_found',
|
|
583
|
+
errorConfig: this.errorConfig,
|
|
584
|
+
},
|
|
585
|
+
position: 'center',
|
|
586
|
+
background: 'whiteBlur',
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
ChunkUnavailableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
591
|
+
ChunkUnavailableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChunkUnavailableComponent, selector: "lib-vc-error-chunk-unavailable", ngImport: i0, template: ``, isInline: true });
|
|
592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, decorators: [{
|
|
593
|
+
type: Component,
|
|
594
|
+
args: [{
|
|
595
|
+
selector: 'lib-vc-error-chunk-unavailable',
|
|
596
|
+
template: ``,
|
|
597
|
+
}]
|
|
598
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; } });
|
|
599
|
+
|
|
466
600
|
class VcErrorHandlersComponent {
|
|
467
|
-
constructor(errorService) {
|
|
601
|
+
constructor(errorService, snackBarService) {
|
|
468
602
|
this.errorService = errorService;
|
|
603
|
+
this.snackBarService = snackBarService;
|
|
604
|
+
this.errorConfig = ERROR_CONFIG.NETWORK_UNAVAILABLE;
|
|
469
605
|
this.unauthorized = false;
|
|
470
606
|
this.sessionExpired = false;
|
|
471
|
-
this.
|
|
607
|
+
this.chunkUnavailable = false;
|
|
608
|
+
this.isOnline = navigator.onLine;
|
|
609
|
+
this.onNetworkOnline = () => {
|
|
610
|
+
this.isOnline = true;
|
|
611
|
+
this.hideSnackBar();
|
|
612
|
+
};
|
|
613
|
+
this.onNetworkOffline = () => {
|
|
614
|
+
this.isOnline = false;
|
|
615
|
+
this.showOfflineSnackBar();
|
|
616
|
+
};
|
|
472
617
|
this.subscribeGlobalError();
|
|
473
618
|
}
|
|
619
|
+
ngOnInit() {
|
|
620
|
+
this.subscribeNetworkDetection();
|
|
621
|
+
}
|
|
622
|
+
ngOnDestroy() {
|
|
623
|
+
window.removeEventListener('online', this.onNetworkOnline);
|
|
624
|
+
window.removeEventListener('offline', this.onNetworkOffline);
|
|
625
|
+
}
|
|
474
626
|
subscribeGlobalError() {
|
|
475
627
|
this.errorService.globalError$.subscribe((error) => {
|
|
476
628
|
this.handleError(error);
|
|
@@ -483,50 +635,76 @@ class VcErrorHandlersComponent {
|
|
|
483
635
|
else if (error.status === ErrorStatusCode.UnauthorizedAccess) {
|
|
484
636
|
this.unauthorized = true;
|
|
485
637
|
}
|
|
638
|
+
else if (error.status === ErrorStatusCode.JSChunkUnavailable) {
|
|
639
|
+
this.chunkUnavailable = true;
|
|
640
|
+
}
|
|
486
641
|
else if (error.status === ErrorStatusCode.NetworkUnavailable) {
|
|
487
|
-
this.
|
|
642
|
+
this.handleNetworkError();
|
|
488
643
|
}
|
|
489
644
|
}
|
|
645
|
+
subscribeNetworkDetection() {
|
|
646
|
+
window.addEventListener('online', this.onNetworkOnline);
|
|
647
|
+
window.addEventListener('offline', this.onNetworkOffline);
|
|
648
|
+
}
|
|
649
|
+
handleNetworkError() {
|
|
650
|
+
if (!this.isOnline) {
|
|
651
|
+
this.showOfflineSnackBar();
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
showOfflineSnackBar() {
|
|
655
|
+
this.snackBarService.show(this.errorConfig.offlineMessage, 'error');
|
|
656
|
+
}
|
|
657
|
+
hideSnackBar() {
|
|
658
|
+
this.snackBarService.hide();
|
|
659
|
+
}
|
|
490
660
|
}
|
|
491
|
-
VcErrorHandlersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, deps: [{ token: GlobalErrorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
661
|
+
VcErrorHandlersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, deps: [{ token: GlobalErrorService }, { token: SnackBarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
492
662
|
VcErrorHandlersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: VcErrorHandlersComponent, selector: "lib-vc-error-handlers", ngImport: i0, template: `
|
|
663
|
+
<app-snack-bar></app-snack-bar>
|
|
493
664
|
<lib-vc-error-session-expired
|
|
494
665
|
*ngIf="sessionExpired"
|
|
495
666
|
></lib-vc-error-session-expired>
|
|
496
667
|
<lib-vc-error-unauthorized *ngIf="unauthorized"></lib-vc-error-unauthorized>
|
|
497
|
-
|
|
668
|
+
<lib-vc-error-chunk-unavailable
|
|
669
|
+
*ngIf="chunkUnavailable"
|
|
670
|
+
></lib-vc-error-chunk-unavailable>
|
|
671
|
+
`, isInline: true, components: [{ type: SnackBarComponent, selector: "app-snack-bar" }, { type: SessionExpiredComponent, selector: "lib-vc-error-session-expired" }, { type: UnauthorizedComponent, selector: "lib-vc-error-unauthorized" }, { type: ChunkUnavailableComponent, selector: "lib-vc-error-chunk-unavailable" }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
498
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, decorators: [{
|
|
499
673
|
type: Component,
|
|
500
674
|
args: [{
|
|
501
675
|
selector: 'lib-vc-error-handlers',
|
|
502
676
|
template: `
|
|
677
|
+
<app-snack-bar></app-snack-bar>
|
|
503
678
|
<lib-vc-error-session-expired
|
|
504
679
|
*ngIf="sessionExpired"
|
|
505
680
|
></lib-vc-error-session-expired>
|
|
506
681
|
<lib-vc-error-unauthorized *ngIf="unauthorized"></lib-vc-error-unauthorized>
|
|
682
|
+
<lib-vc-error-chunk-unavailable
|
|
683
|
+
*ngIf="chunkUnavailable"
|
|
684
|
+
></lib-vc-error-chunk-unavailable>
|
|
507
685
|
`,
|
|
508
686
|
}]
|
|
509
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
687
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
510
688
|
|
|
511
689
|
class PageNotFoundComponent {
|
|
512
|
-
constructor() {
|
|
690
|
+
constructor(router) {
|
|
691
|
+
this.router = router;
|
|
513
692
|
this.errorConfig = ERROR_CONFIG.PAGE_NOT_FOUND;
|
|
514
|
-
this.
|
|
693
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
694
|
+
this.currentYear = new Date().getFullYear();
|
|
515
695
|
}
|
|
516
696
|
redirectToHome() {
|
|
517
|
-
|
|
697
|
+
const currentUrl = window.location.href;
|
|
698
|
+
if (currentUrl.includes('organization')) {
|
|
699
|
+
this.router.navigate(['/global-dashboard/compliance_dashboard']);
|
|
700
|
+
}
|
|
518
701
|
}
|
|
519
702
|
}
|
|
520
|
-
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [{ token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
521
704
|
PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: PageNotFoundComponent, selector: "lib-vc-error-page-not-found", ngImport: i0, template: `
|
|
522
705
|
<div class="errorPage">
|
|
523
706
|
<div class="errorPage-top">
|
|
524
|
-
<img
|
|
525
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
526
|
-
alt="VComply"
|
|
527
|
-
width="24"
|
|
528
|
-
height="24"
|
|
529
|
-
/>
|
|
707
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
530
708
|
</div>
|
|
531
709
|
<div class="errorPage-container">
|
|
532
710
|
<div class="errorPage-inner">
|
|
@@ -534,8 +712,8 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
534
712
|
<img
|
|
535
713
|
[src]="errorConfig.imageUrl"
|
|
536
714
|
alt="Error Image"
|
|
537
|
-
width="
|
|
538
|
-
height="
|
|
715
|
+
width="246"
|
|
716
|
+
height="178"
|
|
539
717
|
/>
|
|
540
718
|
</div>
|
|
541
719
|
<div class="errorPage-inner-right">
|
|
@@ -547,20 +725,18 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
547
725
|
</button>
|
|
548
726
|
</div>
|
|
549
727
|
</div>
|
|
728
|
+
<div class="errorPage-copyright">
|
|
729
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
730
|
+
</div>
|
|
550
731
|
</div>
|
|
551
732
|
</div>
|
|
552
|
-
`, isInline: true, 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}.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}\n"] });
|
|
733
|
+
`, isInline: true, 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"] });
|
|
553
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
|
554
735
|
type: Component,
|
|
555
736
|
args: [{ selector: 'lib-vc-error-page-not-found', template: `
|
|
556
737
|
<div class="errorPage">
|
|
557
738
|
<div class="errorPage-top">
|
|
558
|
-
<img
|
|
559
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
560
|
-
alt="VComply"
|
|
561
|
-
width="24"
|
|
562
|
-
height="24"
|
|
563
|
-
/>
|
|
739
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
564
740
|
</div>
|
|
565
741
|
<div class="errorPage-container">
|
|
566
742
|
<div class="errorPage-inner">
|
|
@@ -568,8 +744,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
568
744
|
<img
|
|
569
745
|
[src]="errorConfig.imageUrl"
|
|
570
746
|
alt="Error Image"
|
|
571
|
-
width="
|
|
572
|
-
height="
|
|
747
|
+
width="246"
|
|
748
|
+
height="178"
|
|
573
749
|
/>
|
|
574
750
|
</div>
|
|
575
751
|
<div class="errorPage-inner-right">
|
|
@@ -581,110 +757,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
581
757
|
</button>
|
|
582
758
|
</div>
|
|
583
759
|
</div>
|
|
760
|
+
<div class="errorPage-copyright">
|
|
761
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
762
|
+
</div>
|
|
584
763
|
</div>
|
|
585
764
|
</div>
|
|
586
|
-
`, 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}.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}\n"] }]
|
|
587
|
-
}] });
|
|
588
|
-
|
|
589
|
-
class ChunkUnavailableComponent {
|
|
590
|
-
constructor() { }
|
|
591
|
-
ngOnInit() {
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
ChunkUnavailableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
595
|
-
ChunkUnavailableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChunkUnavailableComponent, selector: "lib-chunk-unavailable", ngImport: i0, template: "<p>chunk-unavailable works!</p>\r\n", styles: [""] });
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, decorators: [{
|
|
597
|
-
type: Component,
|
|
598
|
-
args: [{ selector: 'lib-chunk-unavailable', template: "<p>chunk-unavailable works!</p>\r\n", styles: [""] }]
|
|
599
|
-
}], ctorParameters: function () { return []; } });
|
|
765
|
+
`, 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"] }]
|
|
766
|
+
}], ctorParameters: function () { return [{ type: i3.Router }]; } });
|
|
600
767
|
|
|
601
768
|
class ServerErrorComponent {
|
|
602
|
-
constructor() { }
|
|
603
|
-
ngOnInit() {
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
ServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
607
|
-
ServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ServerErrorComponent, selector: "lib-server-error", ngImport: i0, template: "<p>server-error works!</p>\r\n", styles: [""] });
|
|
608
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, decorators: [{
|
|
609
|
-
type: Component,
|
|
610
|
-
args: [{ selector: 'lib-server-error', template: "<p>server-error works!</p>\r\n", styles: [""] }]
|
|
611
|
-
}], ctorParameters: function () { return []; } });
|
|
612
|
-
|
|
613
|
-
class SnackBarService {
|
|
614
769
|
constructor() {
|
|
615
|
-
this.
|
|
616
|
-
this.
|
|
770
|
+
this.errorConfig = ERROR_CONFIG.SERVER_ERROR;
|
|
771
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
617
772
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
show: true,
|
|
621
|
-
message,
|
|
622
|
-
icon: type,
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
hide() {
|
|
626
|
-
this.snackbarSubject.next({
|
|
627
|
-
show: false,
|
|
628
|
-
message: '',
|
|
629
|
-
icon: '',
|
|
630
|
-
});
|
|
773
|
+
refreshPage() {
|
|
774
|
+
window.location.reload();
|
|
631
775
|
}
|
|
632
776
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
this.message = state.message;
|
|
664
|
-
this.show = state.show;
|
|
665
|
-
this.setAutoClose();
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
setAutoClose() {
|
|
669
|
-
setTimeout(() => {
|
|
670
|
-
this.show = false;
|
|
671
|
-
this.close();
|
|
672
|
-
}, 3000);
|
|
673
|
-
}
|
|
674
|
-
close() {
|
|
675
|
-
this.show = false;
|
|
676
|
-
this.snackbarService.hide();
|
|
677
|
-
}
|
|
678
|
-
ngOnDestroy() {
|
|
679
|
-
this.snackbarSubscription.unsubscribe();
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarComponent, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
683
|
-
SnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SnackBarComponent, selector: "app-snack-bar", ngImport: i0, template: "<div class=\"workflow-snackbar\" *ngIf=\"show\">\r\n <div class=\"workflow-snackbar-inner\">\r\n <div class=\"workflow-snackbarText\">\r\n <!--  -->\r\n <i class=\"icons\" [class]=\"type\" [innerHTML]=\"icon\"></i> <span [innerHTML]=\"message\">{{ message }}</span>\r\n </div>\r\n <button (click)=\"close()\">[ <span>Close</span> ]</button>\r\n </div>\r\n </div>", styles: ["::ng-deep .workflow-snackbar{position:fixed;top:20px;left:0;right:0;display:flex;align-items:center;justify-content:center;z-index:2147483647!important;pointer-events:none;animation:slide-top .3s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .workflow-snackbar.white{background-color:#fff;color:#000;z-index:20}::ng-deep .workflow-snackbar.white button{color:#f6882f;font-size:11px;font-weight:400;pointer-events:all}::ng-deep .workflow-snackbar .workflow-snackbar-inner{display:flex;max-width:500px;min-width:450px;align-items:center;justify-content:space-between;padding:10px;background:#ffffff;border-radius:3px;box-shadow:0 0 10px #0003;min-height:55px;pointer-events:auto}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText{color:#161b2f;font-size:13px;display:flex;align-items:center;width:calc(100% - 70px)}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i{background:#f1f1f1;color:#d93b41;border-radius:50px;font-size:16px;width:30px;height:30px;text-align:center;line-height:28px;margin-right:10px;min-width:30px}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.success{color:#34aa44}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.warning{color:#f0b819}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.info{color:#1e5dd3}::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.alert,::ng-deep .workflow-snackbar .workflow-snackbar-inner .workflow-snackbarText i.error{color:#d93b41}::ng-deep .workflow-snackbar .workflow-snackbar-inner button{background:transparent;border:none;font-size:11px;padding:0;position:relative;color:#747576;width:65px;text-align:right;cursor:pointer;text-transform:uppercase}::ng-deep .workflow-snackbar .workflow-snackbar-inner button span{color:#1e5dd3;font-weight:500}::ng-deep .workflow-snackbar .workflow-snackbar-inner button:focus{outline:none}@keyframes slide-top{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
777
|
+
ServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
778
|
+
ServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ServerErrorComponent, selector: "lib-vc-error-server-error", ngImport: i0, template: `
|
|
779
|
+
<div class="errorPage">
|
|
780
|
+
<div class="errorPage-top">
|
|
781
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
782
|
+
</div>
|
|
783
|
+
<div class="errorPage-container">
|
|
784
|
+
<div class="errorPage-inner">
|
|
785
|
+
<div class="errorPage-inner-image">
|
|
786
|
+
<img
|
|
787
|
+
[src]="errorConfig.imageUrl"
|
|
788
|
+
alt="Error Image"
|
|
789
|
+
width="246"
|
|
790
|
+
height="178"
|
|
791
|
+
/>
|
|
792
|
+
</div>
|
|
793
|
+
<div class="errorPage-inner-right">
|
|
794
|
+
<div class="errorPage-heading">{{ errorConfig.title }}</div>
|
|
795
|
+
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
796
|
+
<div class="errorPage-details">{{ errorConfig.details }}</div>
|
|
797
|
+
<button class="errorPage-btn" (click)="refreshPage()">
|
|
798
|
+
{{ errorConfig.buttonText }} <i class="icons"></i>
|
|
799
|
+
</button>
|
|
800
|
+
</div>
|
|
801
|
+
</div>
|
|
802
|
+
</div>
|
|
803
|
+
</div>
|
|
804
|
+
`, isInline: true, 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"] });
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, decorators: [{
|
|
685
806
|
type: Component,
|
|
686
|
-
args: [{ selector: '
|
|
687
|
-
|
|
807
|
+
args: [{ selector: 'lib-vc-error-server-error', template: `
|
|
808
|
+
<div class="errorPage">
|
|
809
|
+
<div class="errorPage-top">
|
|
810
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
811
|
+
</div>
|
|
812
|
+
<div class="errorPage-container">
|
|
813
|
+
<div class="errorPage-inner">
|
|
814
|
+
<div class="errorPage-inner-image">
|
|
815
|
+
<img
|
|
816
|
+
[src]="errorConfig.imageUrl"
|
|
817
|
+
alt="Error Image"
|
|
818
|
+
width="246"
|
|
819
|
+
height="178"
|
|
820
|
+
/>
|
|
821
|
+
</div>
|
|
822
|
+
<div class="errorPage-inner-right">
|
|
823
|
+
<div class="errorPage-heading">{{ errorConfig.title }}</div>
|
|
824
|
+
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
825
|
+
<div class="errorPage-details">{{ errorConfig.details }}</div>
|
|
826
|
+
<button class="errorPage-btn" (click)="refreshPage()">
|
|
827
|
+
{{ errorConfig.buttonText }} <i class="icons"></i>
|
|
828
|
+
</button>
|
|
829
|
+
</div>
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
</div>
|
|
833
|
+
`, 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"] }]
|
|
834
|
+
}] });
|
|
688
835
|
|
|
689
836
|
class SnackBarModule {
|
|
690
837
|
}
|
|
@@ -707,8 +854,9 @@ class Configurations {
|
|
|
707
854
|
}
|
|
708
855
|
|
|
709
856
|
class SentryErrorHandler {
|
|
710
|
-
constructor(authorizerService, config) {
|
|
857
|
+
constructor(authorizerService, errorService, config) {
|
|
711
858
|
this.authorizerService = authorizerService;
|
|
859
|
+
this.errorService = errorService;
|
|
712
860
|
if (config?.sentryConfig) {
|
|
713
861
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
714
862
|
Sentry.init({
|
|
@@ -728,40 +876,58 @@ class SentryErrorHandler {
|
|
|
728
876
|
}
|
|
729
877
|
handleError(error) {
|
|
730
878
|
const ERROR = error?.originalError || error;
|
|
731
|
-
this.
|
|
879
|
+
this.handleChunkNotFoundError(ERROR);
|
|
732
880
|
Sentry.captureException(ERROR);
|
|
733
881
|
}
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
|
|
882
|
+
handleChunkNotFoundError(error) {
|
|
883
|
+
const failedMessage = /Loading chunk [\d]+ failed/;
|
|
884
|
+
if (failedMessage.test(error.message)) {
|
|
885
|
+
this.errorService.globalError$.next({
|
|
886
|
+
status: ErrorStatusCode.JSChunkUnavailable,
|
|
887
|
+
});
|
|
738
888
|
}
|
|
739
889
|
}
|
|
740
890
|
}
|
|
741
|
-
SentryErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler, deps: [{ token: i1.AuthorizerService }, { token: Configurations, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
891
|
+
SentryErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler, deps: [{ token: i1.AuthorizerService }, { token: GlobalErrorService }, { token: Configurations, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
742
892
|
SentryErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler });
|
|
743
893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler, decorators: [{
|
|
744
894
|
type: Injectable
|
|
745
|
-
}], ctorParameters: function () { return [{ type: i1.AuthorizerService }, { type: Configurations, decorators: [{
|
|
895
|
+
}], ctorParameters: function () { return [{ type: i1.AuthorizerService }, { type: GlobalErrorService }, { type: Configurations, decorators: [{
|
|
746
896
|
type: Optional
|
|
747
897
|
}] }]; } });
|
|
748
898
|
|
|
749
899
|
class HttpReqInterceptor {
|
|
750
|
-
constructor(errorService) {
|
|
900
|
+
constructor(errorService, snackBarService) {
|
|
751
901
|
this.errorService = errorService;
|
|
902
|
+
this.snackBarService = snackBarService;
|
|
752
903
|
}
|
|
753
904
|
intercept(req, next) {
|
|
754
|
-
return next.handle(req).pipe(timeout(API_TIMEOUT_TIME),
|
|
905
|
+
return next.handle(req).pipe(timeout(API_TIMEOUT_TIME), tap((event) => {
|
|
906
|
+
if (event instanceof HttpResponse) {
|
|
907
|
+
this.handleSoftErrors(event);
|
|
908
|
+
}
|
|
909
|
+
}), catchError((error) => {
|
|
755
910
|
this.errorService.handleError(error, req);
|
|
756
911
|
return throwError(error);
|
|
757
912
|
}));
|
|
758
913
|
}
|
|
914
|
+
handleSoftErrors(event) {
|
|
915
|
+
const xData = event.headers.get('X-Data');
|
|
916
|
+
if (xData) {
|
|
917
|
+
const parsedData = JSON.parse(xData);
|
|
918
|
+
const statusCode = parsedData.statusCode;
|
|
919
|
+
const statusMessage = parsedData.message;
|
|
920
|
+
if (statusCode && statusCode !== 0) {
|
|
921
|
+
this.snackBarService.show(statusMessage || 'Error occurred', 'error');
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
759
925
|
}
|
|
760
|
-
HttpReqInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, deps: [{ token: GlobalErrorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
926
|
+
HttpReqInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, deps: [{ token: GlobalErrorService }, { token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
761
927
|
HttpReqInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor });
|
|
762
928
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, decorators: [{
|
|
763
929
|
type: Injectable
|
|
764
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
930
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
765
931
|
|
|
766
932
|
const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
767
933
|
class VcErrorHandlersModule {
|
|
@@ -779,13 +945,13 @@ VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
779
945
|
SessionExpiredComponent,
|
|
780
946
|
ChunkUnavailableComponent,
|
|
781
947
|
ServerErrorComponent,
|
|
782
|
-
|
|
948
|
+
ErrorModalComponent], imports: [CommonModule, DialogModule, SnackBarModule], exports: [VcErrorHandlersComponent,
|
|
783
949
|
PageNotFoundComponent,
|
|
784
950
|
UnauthorizedComponent,
|
|
785
951
|
SessionExpiredComponent,
|
|
786
952
|
ChunkUnavailableComponent,
|
|
787
953
|
ServerErrorComponent,
|
|
788
|
-
|
|
954
|
+
ErrorModalComponent] });
|
|
789
955
|
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
790
956
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
791
957
|
{ provide: HTTP_INTERCEPTORS, useClass: HttpReqInterceptor, multi: true },
|
|
@@ -800,7 +966,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
800
966
|
SessionExpiredComponent,
|
|
801
967
|
ChunkUnavailableComponent,
|
|
802
968
|
ServerErrorComponent,
|
|
803
|
-
|
|
969
|
+
ErrorModalComponent,
|
|
804
970
|
],
|
|
805
971
|
imports: [CommonModule, DialogModule, SnackBarModule],
|
|
806
972
|
exports: [
|
|
@@ -810,7 +976,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
810
976
|
SessionExpiredComponent,
|
|
811
977
|
ChunkUnavailableComponent,
|
|
812
978
|
ServerErrorComponent,
|
|
813
|
-
|
|
979
|
+
ErrorModalComponent,
|
|
814
980
|
],
|
|
815
981
|
providers: [
|
|
816
982
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
@@ -828,5 +994,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
828
994
|
* Generated bundle index. Do not edit.
|
|
829
995
|
*/
|
|
830
996
|
|
|
831
|
-
export { AuthService, ChunkUnavailableComponent, FOR_ROOT_SENTRY_OPTIONS_TOKEN, GlobalErrorService, HttpReqInterceptor, PageNotFoundComponent, RouterService, ServerErrorComponent, SessionExpiredComponent,
|
|
997
|
+
export { AuthService, ChunkUnavailableComponent, ErrorModalComponent, FOR_ROOT_SENTRY_OPTIONS_TOKEN, GlobalErrorService, HttpReqInterceptor, PageNotFoundComponent, RouterService, ServerErrorComponent, SessionExpiredComponent, UnauthorizedComponent, VcErrorHandlersComponent, VcErrorHandlersModule, VcErrorHandlersService };
|
|
832
998
|
//# sourceMappingURL=vc-error-handlers.mjs.map
|