vc-error-handlers 0.1.6 → 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 -9
- package/esm2020/lib/vc-error-handlers.module.mjs +9 -8
- package/esm2020/public-api.mjs +2 -2
- package/fesm2015/vc-error-handlers.mjs +358 -192
- package/fesm2015/vc-error-handlers.mjs.map +1 -1
- package/fesm2020/vc-error-handlers.mjs +357 -192
- 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 +5 -4
- 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 -49
- package/lib/shared/components/session-expired-modal/session-expired-modal.component.d.ts +0 -19
|
@@ -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,60 +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.
|
|
140
|
-
this.animation = false;
|
|
232
|
+
this.errorType = 'session_expired';
|
|
141
233
|
this.data = {
|
|
142
|
-
|
|
234
|
+
heading: 'Message',
|
|
143
235
|
description: 'Description',
|
|
144
236
|
buttonText: 'Click Action',
|
|
145
237
|
};
|
|
146
|
-
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;
|
|
147
244
|
}
|
|
148
245
|
onContinueAction() {
|
|
149
|
-
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
|
+
}
|
|
150
253
|
}
|
|
151
254
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<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>
|
|
155
258
|
<div class="error-dialog-box-mid">
|
|
156
|
-
{{
|
|
259
|
+
{{ data.description }}
|
|
157
260
|
</div>
|
|
158
261
|
<div class="error-dialog-box-bottom">
|
|
159
262
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
160
|
-
{{
|
|
263
|
+
{{ data.buttonText }}
|
|
161
264
|
</button>
|
|
162
265
|
</div>
|
|
163
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"] });
|
|
164
|
-
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: [{
|
|
165
268
|
type: Component,
|
|
166
|
-
args: [{ selector: 'lib-vc-error-
|
|
167
|
-
<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>
|
|
168
271
|
<div class="error-dialog-box-mid">
|
|
169
|
-
{{
|
|
272
|
+
{{ data.description }}
|
|
170
273
|
</div>
|
|
171
274
|
<div class="error-dialog-box-bottom">
|
|
172
275
|
<button (click)="onContinueAction()" class="logIn-btn">
|
|
173
|
-
{{
|
|
276
|
+
{{ data.buttonText }}
|
|
174
277
|
</button>
|
|
175
278
|
</div>
|
|
176
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"] }]
|
|
177
|
-
}], ctorParameters: function () { return [{ type: DialogConfig }, { type: RouterService }]; }
|
|
280
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: DialogConfig }, { type: RouterService }]; }, propDecorators: { errorType: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}] } });
|
|
178
283
|
|
|
179
284
|
class InsertionDirective {
|
|
180
285
|
constructor(viewContainerRef) {
|
|
@@ -268,7 +373,7 @@ class DialogComponent {
|
|
|
268
373
|
}
|
|
269
374
|
}
|
|
270
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 });
|
|
271
|
-
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]" }] });
|
|
272
377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DialogComponent, decorators: [{
|
|
273
378
|
type: Component,
|
|
274
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"] }]
|
|
@@ -353,24 +458,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
353
458
|
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
354
459
|
|
|
355
460
|
class SessionExpiredComponent {
|
|
356
|
-
constructor(
|
|
357
|
-
this.authService = authService;
|
|
461
|
+
constructor(dialogService) {
|
|
358
462
|
this.dialogService = dialogService;
|
|
359
463
|
this.errorConfig = ERROR_CONFIG.SESSION_EXPIRED;
|
|
360
464
|
}
|
|
361
465
|
ngOnInit() {
|
|
362
|
-
// this.authService.logoutUser();
|
|
363
466
|
this.openSessionExpiredModal();
|
|
364
467
|
}
|
|
365
468
|
openSessionExpiredModal() {
|
|
366
|
-
this.dialogService.open(
|
|
367
|
-
data:
|
|
469
|
+
this.dialogService.open(ErrorModalComponent, {
|
|
470
|
+
data: {
|
|
471
|
+
errorType: 'session_expired',
|
|
472
|
+
errorConfig: this.errorConfig,
|
|
473
|
+
},
|
|
368
474
|
position: 'center',
|
|
369
475
|
background: 'whiteBlur',
|
|
370
476
|
});
|
|
371
477
|
}
|
|
372
478
|
}
|
|
373
|
-
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 });
|
|
374
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 });
|
|
375
481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SessionExpiredComponent, decorators: [{
|
|
376
482
|
type: Component,
|
|
@@ -378,25 +484,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
378
484
|
selector: 'lib-vc-error-session-expired',
|
|
379
485
|
template: ``,
|
|
380
486
|
}]
|
|
381
|
-
}], ctorParameters: function () { return [{ type:
|
|
487
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; } });
|
|
382
488
|
|
|
383
489
|
class UnauthorizedComponent {
|
|
384
490
|
constructor() {
|
|
491
|
+
this.currentYear = new Date().getFullYear();
|
|
385
492
|
this.errorConfig = ERROR_CONFIG.UNAUTHORIZED;
|
|
386
|
-
this.
|
|
493
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
494
|
+
}
|
|
495
|
+
redirectToSupport() {
|
|
496
|
+
window.location.href = this.errorConfig.mail;
|
|
387
497
|
}
|
|
388
|
-
redirectToSupport() { }
|
|
389
498
|
}
|
|
390
499
|
UnauthorizedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
391
500
|
UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: UnauthorizedComponent, selector: "lib-vc-error-unauthorized", ngImport: i0, template: `
|
|
392
501
|
<div class="errorPage">
|
|
393
502
|
<div class="errorPage-top">
|
|
394
|
-
<img
|
|
395
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
396
|
-
alt="VComply"
|
|
397
|
-
width="24"
|
|
398
|
-
height="24"
|
|
399
|
-
/>
|
|
503
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
400
504
|
</div>
|
|
401
505
|
<div class="errorPage-container">
|
|
402
506
|
<div class="errorPage-inner">
|
|
@@ -404,8 +508,8 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
404
508
|
<img
|
|
405
509
|
[src]="errorConfig.imageUrl"
|
|
406
510
|
alt="Error Image"
|
|
407
|
-
width="
|
|
408
|
-
height="
|
|
511
|
+
width="246"
|
|
512
|
+
height="178"
|
|
409
513
|
/>
|
|
410
514
|
</div>
|
|
411
515
|
<div class="errorPage-inner-right">
|
|
@@ -421,20 +525,18 @@ UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
421
525
|
</button>
|
|
422
526
|
</div>
|
|
423
527
|
</div>
|
|
528
|
+
<div class="errorPage-copyright">
|
|
529
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
530
|
+
</div>
|
|
424
531
|
</div>
|
|
425
532
|
</div>
|
|
426
|
-
`, 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"] });
|
|
427
534
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: UnauthorizedComponent, decorators: [{
|
|
428
535
|
type: Component,
|
|
429
536
|
args: [{ selector: 'lib-vc-error-unauthorized', template: `
|
|
430
537
|
<div class="errorPage">
|
|
431
538
|
<div class="errorPage-top">
|
|
432
|
-
<img
|
|
433
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
434
|
-
alt="VComply"
|
|
435
|
-
width="24"
|
|
436
|
-
height="24"
|
|
437
|
-
/>
|
|
539
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
438
540
|
</div>
|
|
439
541
|
<div class="errorPage-container">
|
|
440
542
|
<div class="errorPage-inner">
|
|
@@ -442,8 +544,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
442
544
|
<img
|
|
443
545
|
[src]="errorConfig.imageUrl"
|
|
444
546
|
alt="Error Image"
|
|
445
|
-
width="
|
|
446
|
-
height="
|
|
547
|
+
width="246"
|
|
548
|
+
height="178"
|
|
447
549
|
/>
|
|
448
550
|
</div>
|
|
449
551
|
<div class="errorPage-inner-right">
|
|
@@ -459,19 +561,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
459
561
|
</button>
|
|
460
562
|
</div>
|
|
461
563
|
</div>
|
|
564
|
+
<div class="errorPage-copyright">
|
|
565
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
566
|
+
</div>
|
|
462
567
|
</div>
|
|
463
568
|
</div>
|
|
464
|
-
`, 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"] }]
|
|
465
570
|
}] });
|
|
466
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
|
+
|
|
467
601
|
class VcErrorHandlersComponent {
|
|
468
|
-
constructor(errorService) {
|
|
602
|
+
constructor(errorService, snackBarService) {
|
|
469
603
|
this.errorService = errorService;
|
|
604
|
+
this.snackBarService = snackBarService;
|
|
605
|
+
this.errorConfig = ERROR_CONFIG.NETWORK_UNAVAILABLE;
|
|
470
606
|
this.unauthorized = false;
|
|
471
607
|
this.sessionExpired = false;
|
|
472
|
-
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
|
+
};
|
|
473
618
|
this.subscribeGlobalError();
|
|
474
619
|
}
|
|
620
|
+
ngOnInit() {
|
|
621
|
+
this.subscribeNetworkDetection();
|
|
622
|
+
}
|
|
623
|
+
ngOnDestroy() {
|
|
624
|
+
window.removeEventListener('online', this.onNetworkOnline);
|
|
625
|
+
window.removeEventListener('offline', this.onNetworkOffline);
|
|
626
|
+
}
|
|
475
627
|
subscribeGlobalError() {
|
|
476
628
|
this.errorService.globalError$.subscribe((error) => {
|
|
477
629
|
this.handleError(error);
|
|
@@ -484,50 +636,76 @@ class VcErrorHandlersComponent {
|
|
|
484
636
|
else if (error.status === ErrorStatusCode.UnauthorizedAccess) {
|
|
485
637
|
this.unauthorized = true;
|
|
486
638
|
}
|
|
639
|
+
else if (error.status === ErrorStatusCode.JSChunkUnavailable) {
|
|
640
|
+
this.chunkUnavailable = true;
|
|
641
|
+
}
|
|
487
642
|
else if (error.status === ErrorStatusCode.NetworkUnavailable) {
|
|
488
|
-
this.
|
|
643
|
+
this.handleNetworkError();
|
|
489
644
|
}
|
|
490
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
|
+
}
|
|
491
661
|
}
|
|
492
|
-
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 });
|
|
493
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>
|
|
494
665
|
<lib-vc-error-session-expired
|
|
495
666
|
*ngIf="sessionExpired"
|
|
496
667
|
></lib-vc-error-session-expired>
|
|
497
668
|
<lib-vc-error-unauthorized *ngIf="unauthorized"></lib-vc-error-unauthorized>
|
|
498
|
-
|
|
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"] }] });
|
|
499
673
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersComponent, decorators: [{
|
|
500
674
|
type: Component,
|
|
501
675
|
args: [{
|
|
502
676
|
selector: 'lib-vc-error-handlers',
|
|
503
677
|
template: `
|
|
678
|
+
<app-snack-bar></app-snack-bar>
|
|
504
679
|
<lib-vc-error-session-expired
|
|
505
680
|
*ngIf="sessionExpired"
|
|
506
681
|
></lib-vc-error-session-expired>
|
|
507
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>
|
|
508
686
|
`,
|
|
509
687
|
}]
|
|
510
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
688
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
511
689
|
|
|
512
690
|
class PageNotFoundComponent {
|
|
513
|
-
constructor() {
|
|
691
|
+
constructor(router) {
|
|
692
|
+
this.router = router;
|
|
514
693
|
this.errorConfig = ERROR_CONFIG.PAGE_NOT_FOUND;
|
|
515
|
-
this.
|
|
694
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
695
|
+
this.currentYear = new Date().getFullYear();
|
|
516
696
|
}
|
|
517
697
|
redirectToHome() {
|
|
518
|
-
|
|
698
|
+
const currentUrl = window.location.href;
|
|
699
|
+
if (currentUrl.includes('organization')) {
|
|
700
|
+
this.router.navigate(['/global-dashboard/compliance_dashboard']);
|
|
701
|
+
}
|
|
519
702
|
}
|
|
520
703
|
}
|
|
521
|
-
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 });
|
|
522
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: `
|
|
523
706
|
<div class="errorPage">
|
|
524
707
|
<div class="errorPage-top">
|
|
525
|
-
<img
|
|
526
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
527
|
-
alt="VComply"
|
|
528
|
-
width="24"
|
|
529
|
-
height="24"
|
|
530
|
-
/>
|
|
708
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
531
709
|
</div>
|
|
532
710
|
<div class="errorPage-container">
|
|
533
711
|
<div class="errorPage-inner">
|
|
@@ -535,8 +713,8 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
535
713
|
<img
|
|
536
714
|
[src]="errorConfig.imageUrl"
|
|
537
715
|
alt="Error Image"
|
|
538
|
-
width="
|
|
539
|
-
height="
|
|
716
|
+
width="246"
|
|
717
|
+
height="178"
|
|
540
718
|
/>
|
|
541
719
|
</div>
|
|
542
720
|
<div class="errorPage-inner-right">
|
|
@@ -548,20 +726,18 @@ PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
548
726
|
</button>
|
|
549
727
|
</div>
|
|
550
728
|
</div>
|
|
729
|
+
<div class="errorPage-copyright">
|
|
730
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
731
|
+
</div>
|
|
551
732
|
</div>
|
|
552
733
|
</div>
|
|
553
|
-
`, 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"] });
|
|
554
735
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
|
555
736
|
type: Component,
|
|
556
737
|
args: [{ selector: 'lib-vc-error-page-not-found', template: `
|
|
557
738
|
<div class="errorPage">
|
|
558
739
|
<div class="errorPage-top">
|
|
559
|
-
<img
|
|
560
|
-
src="https://cdn.v-comply.com/logo/prod/v-logo.svg"
|
|
561
|
-
alt="VComply"
|
|
562
|
-
width="24"
|
|
563
|
-
height="24"
|
|
564
|
-
/>
|
|
740
|
+
<img [src]="VcomplyLogo" alt="VComply" width="24" height="24" />
|
|
565
741
|
</div>
|
|
566
742
|
<div class="errorPage-container">
|
|
567
743
|
<div class="errorPage-inner">
|
|
@@ -569,8 +745,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
569
745
|
<img
|
|
570
746
|
[src]="errorConfig.imageUrl"
|
|
571
747
|
alt="Error Image"
|
|
572
|
-
width="
|
|
573
|
-
height="
|
|
748
|
+
width="246"
|
|
749
|
+
height="178"
|
|
574
750
|
/>
|
|
575
751
|
</div>
|
|
576
752
|
<div class="errorPage-inner-right">
|
|
@@ -582,110 +758,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
582
758
|
</button>
|
|
583
759
|
</div>
|
|
584
760
|
</div>
|
|
761
|
+
<div class="errorPage-copyright">
|
|
762
|
+
© {{ currentYear }}, VCOMPLY TECHNOLOGIES, INC.
|
|
763
|
+
</div>
|
|
585
764
|
</div>
|
|
586
765
|
</div>
|
|
587
|
-
`, 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"] }]
|
|
588
|
-
}] });
|
|
589
|
-
|
|
590
|
-
class ChunkUnavailableComponent {
|
|
591
|
-
constructor() { }
|
|
592
|
-
ngOnInit() {
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
ChunkUnavailableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
-
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: [""] });
|
|
597
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChunkUnavailableComponent, decorators: [{
|
|
598
|
-
type: Component,
|
|
599
|
-
args: [{ selector: 'lib-chunk-unavailable', template: "<p>chunk-unavailable works!</p>\r\n", styles: [""] }]
|
|
600
|
-
}], 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 }]; } });
|
|
601
768
|
|
|
602
769
|
class ServerErrorComponent {
|
|
603
|
-
constructor() { }
|
|
604
|
-
ngOnInit() {
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
ServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
608
|
-
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: [""] });
|
|
609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ServerErrorComponent, decorators: [{
|
|
610
|
-
type: Component,
|
|
611
|
-
args: [{ selector: 'lib-server-error', template: "<p>server-error works!</p>\r\n", styles: [""] }]
|
|
612
|
-
}], ctorParameters: function () { return []; } });
|
|
613
|
-
|
|
614
|
-
class SnackBarService {
|
|
615
770
|
constructor() {
|
|
616
|
-
this.
|
|
617
|
-
this.
|
|
771
|
+
this.errorConfig = ERROR_CONFIG.SERVER_ERROR;
|
|
772
|
+
this.VcomplyLogo = VCOMPLY_LOGO_URL;
|
|
618
773
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
show: true,
|
|
622
|
-
message,
|
|
623
|
-
icon: type,
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
hide() {
|
|
627
|
-
this.snackbarSubject.next({
|
|
628
|
-
show: false,
|
|
629
|
-
message: '',
|
|
630
|
-
icon: '',
|
|
631
|
-
});
|
|
774
|
+
refreshPage() {
|
|
775
|
+
window.location.reload();
|
|
632
776
|
}
|
|
633
777
|
}
|
|
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
|
-
}
|
|
664
|
-
this.message = state.message;
|
|
665
|
-
this.show = state.show;
|
|
666
|
-
this.setAutoClose();
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
setAutoClose() {
|
|
670
|
-
setTimeout(() => {
|
|
671
|
-
this.show = false;
|
|
672
|
-
this.close();
|
|
673
|
-
}, 3000);
|
|
674
|
-
}
|
|
675
|
-
close() {
|
|
676
|
-
this.show = false;
|
|
677
|
-
this.snackbarService.hide();
|
|
678
|
-
}
|
|
679
|
-
ngOnDestroy() {
|
|
680
|
-
this.snackbarSubscription.unsubscribe();
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SnackBarComponent, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
684
|
-
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"] }] });
|
|
685
|
-
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: [{
|
|
686
807
|
type: Component,
|
|
687
|
-
args: [{ selector: '
|
|
688
|
-
|
|
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
|
+
}] });
|
|
689
836
|
|
|
690
837
|
class SnackBarModule {
|
|
691
838
|
}
|
|
@@ -708,8 +855,9 @@ class Configurations {
|
|
|
708
855
|
}
|
|
709
856
|
|
|
710
857
|
class SentryErrorHandler {
|
|
711
|
-
constructor(authorizerService, config) {
|
|
858
|
+
constructor(authorizerService, errorService, config) {
|
|
712
859
|
this.authorizerService = authorizerService;
|
|
860
|
+
this.errorService = errorService;
|
|
713
861
|
if (config === null || config === void 0 ? void 0 : config.sentryConfig) {
|
|
714
862
|
const SENTRY_CONFIG = config.sentryConfig;
|
|
715
863
|
Sentry.init({
|
|
@@ -729,42 +877,60 @@ class SentryErrorHandler {
|
|
|
729
877
|
}
|
|
730
878
|
handleError(error) {
|
|
731
879
|
const ERROR = (error === null || error === void 0 ? void 0 : error.originalError) || error;
|
|
732
|
-
this.
|
|
880
|
+
this.handleChunkNotFoundError(ERROR);
|
|
733
881
|
Sentry.captureException(ERROR);
|
|
734
882
|
}
|
|
735
|
-
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
|
|
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
|
+
});
|
|
739
889
|
}
|
|
740
890
|
}
|
|
741
891
|
}
|
|
742
|
-
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 });
|
|
743
893
|
SentryErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler });
|
|
744
894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SentryErrorHandler, decorators: [{
|
|
745
895
|
type: Injectable
|
|
746
896
|
}], ctorParameters: function () {
|
|
747
|
-
return [{ type: i1.AuthorizerService }, { type: Configurations, decorators: [{
|
|
897
|
+
return [{ type: i1.AuthorizerService }, { type: GlobalErrorService }, { type: Configurations, decorators: [{
|
|
748
898
|
type: Optional
|
|
749
899
|
}] }];
|
|
750
900
|
} });
|
|
751
901
|
|
|
752
902
|
class HttpReqInterceptor {
|
|
753
|
-
constructor(errorService) {
|
|
903
|
+
constructor(errorService, snackBarService) {
|
|
754
904
|
this.errorService = errorService;
|
|
905
|
+
this.snackBarService = snackBarService;
|
|
755
906
|
}
|
|
756
907
|
intercept(req, next) {
|
|
757
|
-
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) => {
|
|
758
913
|
this.errorService.handleError(error, req);
|
|
759
914
|
return throwError(error);
|
|
760
915
|
}));
|
|
761
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
|
+
}
|
|
762
928
|
}
|
|
763
|
-
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 });
|
|
764
930
|
HttpReqInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor });
|
|
765
931
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HttpReqInterceptor, decorators: [{
|
|
766
932
|
type: Injectable
|
|
767
|
-
}], ctorParameters: function () { return [{ type: GlobalErrorService }]; } });
|
|
933
|
+
}], ctorParameters: function () { return [{ type: GlobalErrorService }, { type: SnackBarService }]; } });
|
|
768
934
|
|
|
769
935
|
const FOR_ROOT_SENTRY_OPTIONS_TOKEN = new InjectionToken('forRoot() SentryErrorHandler options');
|
|
770
936
|
class VcErrorHandlersModule {
|
|
@@ -782,17 +948,17 @@ VcErrorHandlersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
782
948
|
SessionExpiredComponent,
|
|
783
949
|
ChunkUnavailableComponent,
|
|
784
950
|
ServerErrorComponent,
|
|
785
|
-
|
|
951
|
+
ErrorModalComponent], imports: [CommonModule, DialogModule, SnackBarModule], exports: [VcErrorHandlersComponent,
|
|
786
952
|
PageNotFoundComponent,
|
|
787
953
|
UnauthorizedComponent,
|
|
788
954
|
SessionExpiredComponent,
|
|
789
955
|
ChunkUnavailableComponent,
|
|
790
956
|
ServerErrorComponent,
|
|
791
|
-
|
|
957
|
+
ErrorModalComponent] });
|
|
792
958
|
VcErrorHandlersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, providers: [
|
|
793
959
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
794
960
|
{ provide: HTTP_INTERCEPTORS, useClass: HttpReqInterceptor, multi: true },
|
|
795
|
-
], imports: [[DialogModule, SnackBarModule]] });
|
|
961
|
+
], imports: [[CommonModule, DialogModule, SnackBarModule]] });
|
|
796
962
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: VcErrorHandlersModule, decorators: [{
|
|
797
963
|
type: NgModule,
|
|
798
964
|
args: [{
|
|
@@ -803,9 +969,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
803
969
|
SessionExpiredComponent,
|
|
804
970
|
ChunkUnavailableComponent,
|
|
805
971
|
ServerErrorComponent,
|
|
806
|
-
|
|
972
|
+
ErrorModalComponent,
|
|
807
973
|
],
|
|
808
|
-
imports: [DialogModule, SnackBarModule],
|
|
974
|
+
imports: [CommonModule, DialogModule, SnackBarModule],
|
|
809
975
|
exports: [
|
|
810
976
|
VcErrorHandlersComponent,
|
|
811
977
|
PageNotFoundComponent,
|
|
@@ -813,7 +979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
813
979
|
SessionExpiredComponent,
|
|
814
980
|
ChunkUnavailableComponent,
|
|
815
981
|
ServerErrorComponent,
|
|
816
|
-
|
|
982
|
+
ErrorModalComponent,
|
|
817
983
|
],
|
|
818
984
|
providers: [
|
|
819
985
|
{ provide: ErrorHandler, useClass: SentryErrorHandler },
|
|
@@ -831,5 +997,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
831
997
|
* Generated bundle index. Do not edit.
|
|
832
998
|
*/
|
|
833
999
|
|
|
834
|
-
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 };
|
|
835
1001
|
//# sourceMappingURL=vc-error-handlers.mjs.map
|