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,165 @@ 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 === null || state === void 0 ? void 0 : state.icon)) {
|
|
196
|
+
this.icon = this.icons[state.icon];
|
|
197
|
+
this.type = state === null || state === void 0 ? void 0 : 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
|
+
var _a, _b;
|
|
242
|
+
this.data = (_a = this.dialogConfig.data) === null || _a === void 0 ? void 0 : _a.errorConfig;
|
|
243
|
+
this.errorType = (_b = this.dialogConfig.data) === null || _b === void 0 ? void 0 : _b.errorType;
|
|
146
244
|
}
|
|
147
245
|
onContinueAction() {
|
|
148
|
-
this.
|
|
246
|
+
if (this.errorType === 'session_expired') {
|
|
247
|
+
this.authService.logoutUser();
|
|
248
|
+
this.routerService.redirectToLogin();
|
|
249
|
+
}
|
|
250
|
+
else if (this.errorType === 'chunk_not_found') {
|
|
251
|
+
window.location.reload();
|
|
252
|
+
}
|
|
149
253
|
}
|
|
150
254
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<div class="error-dialog-box-top">{{
|
|
255
|
+
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 });
|
|
256
|
+
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">
|
|
257
|
+
<div class="error-dialog-box-top">{{ data.heading }}</div>
|
|
154
258
|
<div class="error-dialog-box-mid">
|
|
155
|
-
{{
|
|
259
|
+
{{ data.description }}
|
|
156
260
|
</div>
|
|
157
261
|
<div class="error-dialog-box-bottom">
|
|
158
262
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
159
|
-
{{
|
|
263
|
+
{{ data.buttonText }}
|
|
160
264
|
</button>
|
|
161
265
|
</div>
|
|
162
266
|
</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:
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ErrorModalComponent, decorators: [{
|
|
164
268
|
type: Component,
|
|
165
|
-
args: [{ selector: 'lib-vc-error-
|
|
166
|
-
<div class="error-dialog-box-top">{{
|
|
269
|
+
args: [{ selector: 'lib-vc-error-modal', template: ` <div class="error-dialog-box">
|
|
270
|
+
<div class="error-dialog-box-top">{{ data.heading }}</div>
|
|
167
271
|
<div class="error-dialog-box-mid">
|
|
168
|
-
{{
|
|
272
|
+
{{ data.description }}
|
|
169
273
|
</div>
|
|
170
274
|
<div class="error-dialog-box-bottom">
|
|
171
275
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
172
|
-
{{
|
|
276
|
+
{{ data.buttonText }}
|
|
173
277
|
</button>
|
|
174
278
|
</div>
|
|
175
279
|
</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 }]; }
|
|
280
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: DialogConfig }, { type: RouterService }]; }, propDecorators: { errorType: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}] } });
|
|
177
283
|
|
|
178
284
|
class InsertionDirective {
|
|
179
285
|
constructor(viewContainerRef) {
|
|
@@ -267,7 +373,7 @@ class DialogComponent {
|
|
|
267
373
|
}
|
|
268
374
|
}
|
|
269
375
|
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:
|
|
376
|
+
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
377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DialogComponent, decorators: [{
|
|
272
378
|
type: Component,
|
|
273
379
|
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 +458,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
352
458
|
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
353
459
|
|
|
354
460
|
class SessionExpiredComponent {
|
|
355
|
-
constructor(
|
|
356
|
-
this.authService = authService;
|
|
461
|
+
constructor(dialogService) {
|
|
357
462
|
this.dialogService = dialogService;
|
|
358
463
|
this.errorConfig = ERROR_CONFIG.SESSION_EXPIRED;
|
|
359
464
|
}
|
|
360
465
|
ngOnInit() {
|
|
361
|
-
this.authService.logoutUser();
|
|
362
466
|
this.openSessionExpiredModal();
|
|
363
467
|
}
|
|
364
468
|
openSessionExpiredModal() {
|
|
365
|
-
this.dialogService.open(
|
|
366
|
-
data:
|
|
469
|
+
this.dialogService.open(ErrorModalComponent, {
|
|
470
|
+
data: {
|
|
471
|
+
errorType: 'session_expired',
|
|
472
|
+
errorConfig: this.errorConfig,
|
|
473
|
+
},
|
|
367
474
|
position: 'center',
|
|
368
475
|
background: 'whiteBlur',
|
|
369
476
|
});
|
|
370
477
|
}
|
|
371
478
|
}
|
|
372
|
-
SessionExpiredComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, deps: [{ token:
|
|
479
|
+
SessionExpiredComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
373
480
|
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
481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, decorators: [{
|
|
375
482
|
type: Component,
|
|
@@ -377,25 +484,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
377
484
|
selector: 'lib-vc-error-session-expired',
|
|
378
485
|
template: ``,
|
|
379
486
|
}]
|
|
380
|
-
}], ctorParameters: function () { return [{ type:
|
|
487
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; } });
|
|
381
488
|
|
|
382
489
|
class UnauthorizedComponent {
|
|
383
490
|
constructor() {
|
|
491
|
+
this.currentYear = new Date().getFullYear();
|
|
384
492
|
this.errorConfig = ERROR_CONFIG.UNAUTHORIZED;
|
|
385
|
-
this.
|
|
493
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
494
|
+
}
|
|
495
|
+
redirectToSupport() {
|
|
496
|
+
window.location.href = this.errorConfig.mail;
|
|
386
497
|
}
|
|
387
|
-
redirectToSupport() { }
|
|
388
498
|
}
|
|
389
499
|
UnauthorizedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
390
500
|
UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: UnauthorizedComponent, selector: "lib-vc-error-unauthorized", ngImport: i0, template: `
|
|
391
501
|
<div class="errorPage">
|
|
392
502
|
<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
|
-
/>
|
|
503
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
399
504
|
</div>
|
|
400
505
|
<div class="errorPage-container">
|
|
401
506
|
<div class="errorPage-inner">
|
|
@@ -403,8 +508,8 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
403
508
|
<img
|
|
404
509
|
[src]="errorConfig.imageUrl"
|
|
405
510
|
alt="Error Image"
|
|
406
|
-
width="
|
|
407
|
-
height="
|
|
511
|
+
width="246"
|
|
512
|
+
height="178"
|
|
408
513
|
/>
|
|
409
514
|
</div>
|
|
410
515
|
<div class="errorPage-inner-right">
|
|
@@ -420,20 +525,18 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
420
525
|
</button>
|
|
421
526
|
</div>
|
|
422
527
|
</div>
|
|
528
|
+
<div class="errorPage-copyright">
|
|
529
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
530
|
+
</div>
|
|
423
531
|
</div>
|
|
424
532
|
</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"] });
|
|
533
|
+
`, 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
534
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, decorators: [{
|
|
427
535
|
type: Component,
|
|
428
536
|
args: [{ selector: 'lib-vc-error-unauthorized', template: `
|
|
429
537
|
<div class="errorPage">
|
|
430
538
|
<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
|
-
/>
|
|
539
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
437
540
|
</div>
|
|
438
541
|
<div class="errorPage-container">
|
|
439
542
|
<div class="errorPage-inner">
|
|
@@ -441,8 +544,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
441
544
|
<img
|
|
442
545
|
[src]="errorConfig.imageUrl"
|
|
443
546
|
alt="Error Image"
|
|
444
|
-
width="
|
|
445
|
-
height="
|
|
547
|
+
width="246"
|
|
548
|
+
height="178"
|
|
446
549
|
/>
|
|
447
550
|
</div>
|
|
448
551
|
<div class="errorPage-inner-right">
|
|
@@ -458,19 +561,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
458
561
|
</button>
|
|
459
562
|
</div>
|
|
460
563
|
</div>
|
|
564
|
+
<div class="errorPage-copyright">
|
|
565
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
566
|
+
</div>
|
|
461
567
|
</div>
|
|
462
568
|
</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"] }]
|
|
569
|
+
`, 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
570
|
}] });
|
|
465
571
|
|
|
572
|
+
class ChunkUnavailableComponent {
|
|
573
|
+
constructor(dialogService) {
|
|
574
|
+
this.dialogService = dialogService;
|
|
575
|
+
this.errorConfig = ERROR_CONFIG.CHUNK_UNAVAILABLE;
|
|
576
|
+
}
|
|
577
|
+
ngOnInit() {
|
|
578
|
+
this.openSessionExpiredModal();
|
|
579
|
+
}
|
|
580
|
+
openSessionExpiredModal() {
|
|
581
|
+
this.dialogService.open(ErrorModalComponent, {
|
|
582
|
+
data: {
|
|
583
|
+
errorType: 'chunk_not_found',
|
|
584
|
+
errorConfig: this.errorConfig,
|
|
585
|
+
},
|
|
586
|
+
position: 'center',
|
|
587
|
+
background: 'whiteBlur',
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
ChunkUnavailableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
592
|
+
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 });
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, decorators: [{
|
|
594
|
+
type: Component,
|
|
595
|
+
args: [{
|
|
596
|
+
selector: 'lib-vc-error-chunk-unavailable',
|
|
597
|
+
template: ``,
|
|
598
|
+
}]
|
|
599
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; } });
|
|
600
|
+
|
|
466
601
|
class VcErrorHandlersComponent {
|
|
467
|
-
constructor(errorService) {
|
|
602
|
+
constructor(errorService, snackBarService) {
|
|
468
603
|
this.errorService = errorService;
|
|
604
|
+
this.snackBarService = snackBarService;
|
|
605
|
+
this.errorConfig = ERROR_CONFIG.NETWORK_UNAVAILABLE;
|
|
469
606
|
this.unauthorized = false;
|
|
470
607
|
this.sessionExpired = false;
|
|
471
|
-
this.
|
|
608
|
+
this.chunkUnavailable = false;
|
|
609
|
+
this.isOnline = navigator.onLine;
|
|
610
|
+
this.onNetworkOnline = () => {
|
|
611
|
+
this.isOnline = true;
|
|
612
|
+
this.hideSnackBar();
|
|
613
|
+
};
|
|
614
|
+
this.onNetworkOffline = () => {
|
|
615
|
+
this.isOnline = false;
|
|
616
|
+
this.showOfflineSnackBar();
|
|
617
|
+
};
|
|
472
618
|
this.subscribeGlobalError();
|
|
473
619
|
}
|
|
620
|
+
ngOnInit() {
|
|
621
|
+
this.subscribeNetworkDetection();
|
|
622
|
+
}
|
|
623
|
+
ngOnDestroy() {
|
|
624
|
+
window.removeEventListener('online', this.onNetworkOnline);
|
|
625
|
+
window.removeEventListener('offline', this.onNetworkOffline);
|
|
626
|
+
}
|
|
474
627
|
subscribeGlobalError() {
|
|
475
628
|
this.errorService.globalError$.subscribe((error) => {
|
|
476
629
|
this.handleError(error);
|
|
@@ -483,50 +636,76 @@ class VcErrorHandlersComponent {
|
|
|
483
636
|
else if (error.status === ErrorStatusCode.UnauthorizedAccess) {
|
|
484
637
|
this.unauthorized = true;
|
|
485
638
|
}
|
|
639
|
+
else if (error.status === ErrorStatusCode.JSChunkUnavailable) {
|
|
640
|
+
this.chunkUnavailable = true;
|
|
641
|
+
}
|
|
486
642
|
else if (error.status === ErrorStatusCode.NetworkUnavailable) {
|
|
487
|
-
this.
|
|
643
|
+
this.handleNetworkError();
|
|
488
644
|
}
|
|
489
645
|
}
|
|
646
|
+
subscribeNetworkDetection() {
|
|
647
|
+
window.addEventListener('online', this.onNetworkOnline);
|
|
648
|
+
window.addEventListener('offline', this.onNetworkOffline);
|
|
649
|
+
}
|
|
650
|
+
handleNetworkError() {
|
|
651
|
+
if (!this.isOnline) {
|
|
652
|
+
this.showOfflineSnackBar();
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
showOfflineSnackBar() {
|
|
656
|
+
this.snackBarService.show(this.errorConfig.offlineMessage, 'error');
|
|
657
|
+
}
|
|
658
|
+
hideSnackBar() {
|
|
659
|
+
this.snackBarService.hide();
|
|
660
|
+
}
|
|
490
661
|
}
|
|
491
|
-
VcErrorHandlersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, deps: [{ token: GlobalErrorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
662
|
+
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
663
|
VcErrorHandlersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: VcErrorHandlersComponent, selector: "lib-vc-error-handlers", ngImport: i0, template: `
|
|
664
|
+
<app-snack-bar></app-snack-bar>
|
|
493
665
|
<lib-vc-error-session-expired
|
|
494
666
|
*ngIf="sessionExpired"
|
|
495
667
|
></lib-vc-error-session-expired>
|
|
496
668
|
<lib-vc-error-unauthorized *ngIf="unauthorized"></lib-vc-error-unauthorized>
|
|
497
|
-
|
|
669
|
+
<lib-vc-error-chunk-unavailable
|
|
670
|
+
*ngIf="chunkUnavailable"
|
|
671
|
+
></lib-vc-error-chunk-unavailable>
|
|
672
|
+
`, 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
673
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, decorators: [{
|
|
499
674
|
type: Component,
|
|
500
675
|
args: [{
|
|
501
676
|
selector: 'lib-vc-error-handlers',
|
|
502
677
|
template: `
|
|
678
|
+
<app-snack-bar></app-snack-bar>
|
|
503
679
|
<lib-vc-error-session-expired
|
|
504
680
|
*ngIf="sessionExpired"
|
|
505
681
|
></lib-vc-error-session-expired>
|
|
506
682
|
<lib-vc-error-unauthorized *ngIf="unauthorized"></lib-vc-error-unauthorized>
|
|
683
|
+
<lib-vc-error-chunk-unavailable
|
|
684
|
+
*ngIf="chunkUnavailable"
|
|
685
|
+
></lib-vc-error-chunk-unavailable>
|
|
507
686
|
`,
|
|
508
687
|
}]
|
|
509
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
688
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
510
689
|
|
|
511
690
|
class PageNotFoundComponent {
|
|
512
|
-
constructor() {
|
|
691
|
+
constructor(router) {
|
|
692
|
+
this.router = router;
|
|
513
693
|
this.errorConfig = ERROR_CONFIG.PAGE_NOT_FOUND;
|
|
514
|
-
this.
|
|
694
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
695
|
+
this.currentYear = new Date().getFullYear();
|
|
515
696
|
}
|
|
516
697
|
redirectToHome() {
|
|
517
|
-
|
|
698
|
+
const currentUrl = window.location.href;
|
|
699
|
+
if (currentUrl.includes('organization')) {
|
|
700
|
+
this.router.navigate(['/global-dashboard/compliance_dashboard']);
|
|
701
|
+
}
|
|
518
702
|
}
|
|
519
703
|
}
|
|
520
|
-
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
704
|
+
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
705
|
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
706
|
<div class="errorPage">
|
|
523
707
|
<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
|
-
/>
|
|
708
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
530
709
|
</div>
|
|
531
710
|
<div class="errorPage-container">
|
|
532
711
|
<div class="errorPage-inner">
|
|
@@ -534,8 +713,8 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
534
713
|
<img
|
|
535
714
|
[src]="errorConfig.imageUrl"
|
|
536
715
|
alt="Error Image"
|
|
537
|
-
width="
|
|
538
|
-
height="
|
|
716
|
+
width="246"
|
|
717
|
+
height="178"
|
|
539
718
|
/>
|
|
540
719
|
</div>
|
|
541
720
|
<div class="errorPage-inner-right">
|
|
@@ -547,20 +726,18 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
547
726
|
</button>
|
|
548
727
|
</div>
|
|
549
728
|
</div>
|
|
729
|
+
<div class="errorPage-copyright">
|
|
730
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
731
|
+
</div>
|
|
550
732
|
</div>
|
|
551
733
|
</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"] });
|
|
734
|
+
`, 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
735
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
|
554
736
|
type: Component,
|
|
555
737
|
args: [{ selector: 'lib-vc-error-page-not-found', template: `
|
|
556
738
|
<div class="errorPage">
|
|
557
739
|
<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
|
-
/>
|
|
740
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
564
741
|
</div>
|
|
565
742
|
<div class="errorPage-container">
|
|
566
743
|
<div class="errorPage-inner">
|
|
@@ -568,8 +745,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
568
745
|
<img
|
|
569
746
|
[src]="errorConfig.imageUrl"
|
|
570
747
|
alt="Error Image"
|
|
571
|
-
width="
|
|
572
|
-
height="
|
|
748
|
+
width="246"
|
|
749
|
+
height="178"
|
|
573
750
|
/>
|
|
574
751
|
</div>
|
|
575
752
|
<div class="errorPage-inner-right">
|
|
@@ -581,110 +758,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
581
758
|
</button>
|
|
582
759
|
</div>
|
|
583
760
|
</div>
|
|
761
|
+
<div class="errorPage-copyright">
|
|
762
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
763
|
+
</div>
|
|
584
764
|
</div>
|
|
585
765
|
</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 []; } });
|
|
766
|
+
`, 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"] }]
|
|
767
|
+
}], ctorParameters: function () { return [{ type: i3.Router }]; } });
|
|
600
768
|
|
|
601
769
|
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
770
|
constructor() {
|
|
615
|
-
this.
|
|
616
|
-
this.
|
|
771
|
+
this.errorConfig = ERROR_CONFIG.SERVER_ERROR;
|
|
772
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
617
773
|
}
|
|
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
|
-
});
|
|
774
|
+
refreshPage() {
|
|
775
|
+
window.location.reload();
|
|
631
776
|
}
|
|
632
777
|
}
|
|
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: [{
|
|
778
|
+
ServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
779
|
+
ServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ServerErrorComponent, selector: "lib-vc-error-server-error", ngImport: i0, template: `
|
|
780
|
+
<div class="errorPage">
|
|
781
|
+
<div class="errorPage-top">
|
|
782
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
783
|
+
</div>
|
|
784
|
+
<div class="errorPage-container">
|
|
785
|
+
<div class="errorPage-inner">
|
|
786
|
+
<div class="errorPage-inner-image">
|
|
787
|
+
<img
|
|
788
|
+
[src]="errorConfig.imageUrl"
|
|
789
|
+
alt="Error Image"
|
|
790
|
+
width="246"
|
|
791
|
+
height="178"
|
|
792
|
+
/>
|
|
793
|
+
</div>
|
|
794
|
+
<div class="errorPage-inner-right">
|
|
795
|
+
<div class="errorPage-heading">{{ errorConfig.title }}</div>
|
|
796
|
+
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
797
|
+
<div class="errorPage-details">{{ errorConfig.details }}</div>
|
|
798
|
+
<button class="errorPage-btn" (click)="refreshPage()">
|
|
799
|
+
{{ errorConfig.buttonText }} <i class="icons"></i>
|
|
800
|
+
</button>
|
|
801
|
+
</div>
|
|
802
|
+
</div>
|
|
803
|
+
</div>
|
|
804
|
+
</div>
|
|
805
|
+
`, 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"] });
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, decorators: [{
|
|
685
807
|
type: Component,
|
|
686
|
-
args: [{ selector: '
|
|
687
|
-
|
|
808
|
+
args: [{ selector: 'lib-vc-error-server-error', template: `
|
|
809
|
+
<div class="errorPage">
|
|
810
|
+
<div class="errorPage-top">
|
|
811
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
812
|
+
</div>
|
|
813
|
+
<div class="errorPage-container">
|
|
814
|
+
<div class="errorPage-inner">
|
|
815
|
+
<div class="errorPage-inner-image">
|
|
816
|
+
<img
|
|
817
|
+
[src]="errorConfig.imageUrl"
|
|
818
|
+
alt="Error Image"
|
|
819
|
+
width="246"
|
|
820
|
+
height="178"
|
|
821
|
+
/>
|
|
822
|
+
</div>
|
|
823
|
+
<div class="errorPage-inner-right">
|
|
824
|
+
<div class="errorPage-heading">{{ errorConfig.title }}</div>
|
|
825
|
+
<div class="errorPage-text">{{ errorConfig.description }}</div>
|
|
826
|
+
<div class="errorPage-details">{{ errorConfig.details }}</div>
|
|
827
|
+
<button class="errorPage-btn" (click)="refreshPage()">
|
|
828
|
+
{{ errorConfig.buttonText }} <i class="icons"></i>
|
|
829
|
+
</button>
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
</div>
|
|
833
|
+
</div>
|
|
834
|
+
`, 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"] }]
|
|
835
|
+
}] });
|
|
688
836
|
|
|
689
837
|
class SnackBarModule {
|
|
690
838
|
}
|
|
@@ -707,8 +855,9 @@ class Configurations {
|
|
|
707
855
|
}
|
|
708
856
|
|
|
709
857
|
class SentryErrorHandler {
|
|
710
|
-
constructor(authorizerService, config) {
|
|
858
|
+
constructor(authorizerService, errorService, config) {
|
|
711
859
|
this.authorizerService = authorizerService;
|
|
860
|
+
this.errorService = errorService;
|
|
712
861
|
if (config === null || config === void 0 ? void 0 : config.sentryConfig) {
|
|
713
862
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
714
863
|
Sentry.init({
|
|
@@ -728,42 +877,60 @@ class SentryErrorHandler {
|
|
|
728
877
|
}
|
|
729
878
|
handleError(error) {
|
|
730
879
|
const ERROR = (error === null || error === void 0 ? void 0 : error.originalError) || error;
|
|
731
|
-
this.
|
|
880
|
+
this.handleChunkNotFoundError(ERROR);
|
|
732
881
|
Sentry.captureException(ERROR);
|
|
733
882
|
}
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
|
|
883
|
+
handleChunkNotFoundError(error) {
|
|
884
|
+
const failedMessage = /Loading chunk [\d]+ failed/;
|
|
885
|
+
if (failedMessage.test(error.message)) {
|
|
886
|
+
this.errorService.globalError$.next({
|
|
887
|
+
status: ErrorStatusCode.JSChunkUnavailable,
|
|
888
|
+
});
|
|
738
889
|
}
|
|
739
890
|
}
|
|
740
891
|
}
|
|
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 });
|
|
892
|
+
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
893
|
SentryErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler });
|
|
743
894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler, decorators: [{
|
|
744
895
|
type: Injectable
|
|
745
896
|
}], ctorParameters: function () {
|
|
746
|
-
return [{ type: i1.AuthorizerService }, { type: Configurations, decorators: [{
|
|
897
|
+
return [{ type: i1.AuthorizerService }, { type: GlobalErrorService }, { type: Configurations, decorators: [{
|
|
747
898
|
type: Optional
|
|
748
899
|
}] }];
|
|
749
900
|
} });
|
|
750
901
|
|
|
751
902
|
class HttpReqInterceptor {
|
|
752
|
-
constructor(errorService) {
|
|
903
|
+
constructor(errorService, snackBarService) {
|
|
753
904
|
this.errorService = errorService;
|
|
905
|
+
this.snackBarService = snackBarService;
|
|
754
906
|
}
|
|
755
907
|
intercept(req, next) {
|
|
756
|
-
return next.handle(req).pipe(timeout(API_TIMEOUT_TIME),
|
|
908
|
+
return next.handle(req).pipe(timeout(API_TIMEOUT_TIME), tap((event) => {
|
|
909
|
+
if (event instanceof HttpResponse) {
|
|
910
|
+
this.handleSoftErrors(event);
|
|
911
|
+
}
|
|
912
|
+
}), catchError((error) => {
|
|
757
913
|
this.errorService.handleError(error, req);
|
|
758
914
|
return throwError(error);
|
|
759
915
|
}));
|
|
760
916
|
}
|
|
917
|
+
handleSoftErrors(event) {
|
|
918
|
+
const xData = event.headers.get('X-Data');
|
|
919
|
+
if (xData) {
|
|
920
|
+
const parsedData = JSON.parse(xData);
|
|
921
|
+
const statusCode = parsedData.statusCode;
|
|
922
|
+
const statusMessage = parsedData.message;
|
|
923
|
+
if (statusCode && statusCode !== 0) {
|
|
924
|
+
this.snackBarService.show(statusMessage || 'Error occurred', 'error');
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
761
928
|
}
|
|
762
|
-
HttpReqInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, deps: [{ token: GlobalErrorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
929
|
+
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 });
|
|
763
930
|
HttpReqInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor });
|
|
764
931
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, decorators: [{
|
|
765
932
|
type: Injectable
|
|
766
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
933
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
767
934
|
|
|
768
935
|
const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
769
936
|
class VcErrorHandlersModule {
|
|
@@ -781,13 +948,13 @@ VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
781
948
|
SessionExpiredComponent,
|
|
782
949
|
ChunkUnavailableComponent,
|
|
783
950
|
ServerErrorComponent,
|
|
784
|
-
|
|
951
|
+
ErrorModalComponent], imports: [CommonModule, DialogModule, SnackBarModule], exports: [VcErrorHandlersComponent,
|
|
785
952
|
PageNotFoundComponent,
|
|
786
953
|
UnauthorizedComponent,
|
|
787
954
|
SessionExpiredComponent,
|
|
788
955
|
ChunkUnavailableComponent,
|
|
789
956
|
ServerErrorComponent,
|
|
790
|
-
|
|
957
|
+
ErrorModalComponent] });
|
|
791
958
|
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
792
959
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
793
960
|
{ provide: HTTP_INTERCEPTORS, useClass: HttpReqInterceptor, multi: true },
|
|
@@ -802,7 +969,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
802
969
|
SessionExpiredComponent,
|
|
803
970
|
ChunkUnavailableComponent,
|
|
804
971
|
ServerErrorComponent,
|
|
805
|
-
|
|
972
|
+
ErrorModalComponent,
|
|
806
973
|
],
|
|
807
974
|
imports: [CommonModule, DialogModule, SnackBarModule],
|
|
808
975
|
exports: [
|
|
@@ -812,7 +979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
812
979
|
SessionExpiredComponent,
|
|
813
980
|
ChunkUnavailableComponent,
|
|
814
981
|
ServerErrorComponent,
|
|
815
|
-
|
|
982
|
+
ErrorModalComponent,
|
|
816
983
|
],
|
|
817
984
|
providers: [
|
|
818
985
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
@@ -830,5 +997,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
830
997
|
* Generated bundle index. Do not edit.
|
|
831
998
|
*/
|
|
832
999
|
|
|
833
|
-
export { AuthService, ChunkUnavailableComponent, FOR_ROOT_SENTRY_OPTIONS_TOKEN, GlobalErrorService, HttpReqInterceptor, PageNotFoundComponent, RouterService, ServerErrorComponent, SessionExpiredComponent,
|
|
1000
|
+
export { AuthService, ChunkUnavailableComponent, ErrorModalComponent, FOR_ROOT_SENTRY_OPTIONS_TOKEN, GlobalErrorService, HttpReqInterceptor, PageNotFoundComponent, RouterService, ServerErrorComponent, SessionExpiredComponent, UnauthorizedComponent, VcErrorHandlersComponent, VcErrorHandlersModule, VcErrorHandlersService };
|
|
834
1001
|
//# sourceMappingURL=vc-error-handlers.mjs.map
|