vc-error-handlers 0.1.93 → 0.1.95

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.
@@ -38,56 +38,6 @@ var ErrorStatusCode;
38
38
  ErrorStatusCode[ErrorStatusCode["JSChunkUnavailable"] = 600] = "JSChunkUnavailable";
39
39
  })(ErrorStatusCode || (ErrorStatusCode = {}));
40
40
 
41
- const VCOMPLY_LOGO_URL = 'https://cdn.v-comply.com/logo/prod/v-logo.svg';
42
- const API_TIMEOUT_TIME = 1000 * 15;
43
- const ERROR_CONFIG = {
44
- PAGE_NOT_FOUND: {
45
- imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
46
- title: 'Oops!',
47
- description: "The page you're looking for doesn't exist.",
48
- details: 'Please check the URL or return to the homepage.',
49
- buttonText: 'GO TO DASHBOARD',
50
- },
51
- UNAUTHORIZED: {
52
- imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
53
- title: 'Oops!',
54
- description: "You don't have permission to access this page.",
55
- details: 'If you believe this is an error, please contact',
56
- email: 'help@v-comply.com',
57
- support: 'for support',
58
- buttonText: 'CONTACT SUPPORT',
59
- mail: 'mailto:help@v-comply.com',
60
- },
61
- SESSION_EXPIRED: {
62
- heading: 'Session Expired!',
63
- description: 'Your session has expired. Please log in again to continue using the app.',
64
- buttonText: 'LOGIN',
65
- },
66
- CHUNK_UNAVAILABLE: {
67
- heading: 'Oops!',
68
- description: 'We are unable to load the data.',
69
- buttonText: 'REFRESH',
70
- },
71
- SERVER_ERROR: {
72
- imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
73
- title: 'Oops!',
74
- description: 'We are unable to load the data.',
75
- details: 'Please refresh this page or try again later.',
76
- buttonText: 'REFRESH',
77
- snackBarMessage: `Oops! Something went wrong. Please try again later.`,
78
- },
79
- COMPONENT_LEVEL_SERVER_ERROR: {
80
- imageUrl: 'https://cdn.v-comply.com/application/images/sad-emoji-icon.svg',
81
- title: 'Oops!',
82
- description: 'We are unable to load the data.',
83
- details: 'Please refresh this section or try again later.',
84
- buttonText: 'RETRY',
85
- },
86
- NETWORK_UNAVAILABLE: {
87
- offlineMessage: "You're currently offline.Please check your internet connection and try again.",
88
- },
89
- };
90
-
91
41
  const PAGE_LEVEL_API_CONFIG = [
92
42
  {
93
43
  method: 'POST',
@@ -129,6 +79,12 @@ const COMPONENT_LEVEL_API_CONFIG = [
129
79
  query: { type: 'inactive' },
130
80
  body: null,
131
81
  },
82
+ {
83
+ method: 'GET',
84
+ path: '/organization/?mode=organisationUsersList',
85
+ query: { type: 'power_users_small' },
86
+ body: null,
87
+ },
132
88
  {
133
89
  method: 'GET',
134
90
  path: '/Global-Dashboard/ManageDashboards',
@@ -143,7 +99,7 @@ const COMPONENT_LEVEL_API_CONFIG = [
143
99
  },
144
100
  {
145
101
  method: 'GET',
146
- path: '/grc_object/?mode=grcObject/getGRCTypeList',
102
+ path: '/grc_object/?mode=grc/getGRCList',
147
103
  query: null,
148
104
  body: null,
149
105
  },
@@ -172,13 +128,13 @@ const COMPONENT_LEVEL_API_CONFIG = [
172
128
  body: null,
173
129
  },
174
130
  {
175
- method: 'GET',
131
+ method: 'POST',
176
132
  path: '/compliance_post/?mode=rcProfile',
177
133
  query: null,
178
134
  body: null,
179
135
  },
180
136
  {
181
- method: 'GET',
137
+ method: 'POST',
182
138
  path: '/organization_post/?mode=userProfile',
183
139
  query: null,
184
140
  body: null,
@@ -207,6 +163,114 @@ const COMPONENT_LEVEL_API_CONFIG = [
207
163
  query: null,
208
164
  body: null,
209
165
  },
166
+ {
167
+ method: 'GET',
168
+ path: '/grc_object/?mode=activity/activityLogList',
169
+ query: null,
170
+ body: null,
171
+ },
172
+ {
173
+ method: 'GET',
174
+ path: '/grc_object/?mode=activity/viewList',
175
+ query: null,
176
+ body: null,
177
+ },
178
+ {
179
+ method: 'GET',
180
+ path: '/program/categoriesList?owner_list=1',
181
+ query: null,
182
+ body: null,
183
+ },
184
+ {
185
+ method: 'POST',
186
+ path: '/risk/?mode=category/list',
187
+ query: null,
188
+ body: null,
189
+ },
190
+ {
191
+ method: 'POST',
192
+ path: '/organization_post/?mode=memberDetailsbyIds',
193
+ query: null,
194
+ body: null,
195
+ },
196
+ {
197
+ method: 'GET',
198
+ path: '/organization?mode=signatureDetails',
199
+ query: null,
200
+ body: null,
201
+ },
202
+ {
203
+ method: 'GET',
204
+ path: '/program/responsibilityList',
205
+ query: null,
206
+ body: null,
207
+ },
208
+ {
209
+ method: 'GET',
210
+ path: '/program/getLinkedPolicies',
211
+ query: null,
212
+ body: null,
213
+ },
214
+ {
215
+ method: 'POST',
216
+ path: '/risk?mode=risk/list',
217
+ query: { queryPage: 'compliance_workroom' },
218
+ body: null,
219
+ },
220
+ {
221
+ method: 'GET',
222
+ path: '/program/assignee',
223
+ query: null,
224
+ body: null,
225
+ },
226
+ {
227
+ method: 'GET',
228
+ path: '/program/evidence/getEvidences/b-cycle-header',
229
+ query: null,
230
+ body: null,
231
+ },
232
+ {
233
+ method: 'GET',
234
+ path: '/program/activity-logs',
235
+ query: null,
236
+ body: null,
237
+ },
238
+ {
239
+ method: 'GET',
240
+ path: '/program/activity-logs-views',
241
+ query: null,
242
+ body: null,
243
+ },
244
+ {
245
+ method: 'POST',
246
+ path: '/Assessment/?mode=category/list',
247
+ query: null,
248
+ body: null,
249
+ },
250
+ {
251
+ method: 'POST',
252
+ path: '/Assessment/?mode=assessment/list',
253
+ query: null,
254
+ body: null,
255
+ },
256
+ {
257
+ method: 'GET',
258
+ path: '/Assessment/?mode=assessment/fetchQuestionsByAssessmentId',
259
+ query: null,
260
+ body: null,
261
+ },
262
+ {
263
+ method: 'POST',
264
+ path: '/Assessment/?mode=assessment/responseSummary',
265
+ query: null,
266
+ body: null,
267
+ },
268
+ {
269
+ method: 'GET',
270
+ path: '/Assessment/?mode=assessment/logs',
271
+ query: null,
272
+ body: null,
273
+ },
210
274
  ];
211
275
 
212
276
  class SnackBarService {
@@ -311,14 +375,13 @@ class GlobalErrorService {
311
375
  }
312
376
  handleServerError(error, request) {
313
377
  if (this.isPageLevelError(error, request)) {
378
+ console.log('page level error');
314
379
  this.publishGlobalError(error);
315
380
  }
316
381
  else if (this.isComponentLevelError(error, request)) {
382
+ console.log('component level error');
317
383
  this.publishLocalError(error, request);
318
384
  }
319
- else {
320
- this.showServerSnackBarError();
321
- }
322
385
  }
323
386
  publishGlobalError(error) {
324
387
  this.globalError$.next(error);
@@ -326,10 +389,6 @@ class GlobalErrorService {
326
389
  publishLocalError(error, request) {
327
390
  this.localError$.next({ error, request });
328
391
  }
329
- showServerSnackBarError() {
330
- const message = ERROR_CONFIG.SERVER_ERROR.snackBarMessage;
331
- this.snackBarService.show(message, 'error');
332
- }
333
392
  isPageLevelError(error, request) {
334
393
  const { method, path, query, body } = this.parseRequest(request);
335
394
  const pageCode = this.getPageCode();
@@ -354,9 +413,11 @@ class GlobalErrorService {
354
413
  params.keys().forEach((key) => {
355
414
  query[key] = params.get(key);
356
415
  });
416
+ console.log('query', query, 'body', body, 'path', path, 'method', method, 'params', params);
357
417
  const isConfigFound = this.componentLevelApiConfig.some((apiConfig) => {
358
418
  if (apiConfig.method !== method)
359
419
  return false;
420
+ console.log('apiConfig.path', apiConfig.path, path.includes(apiConfig.path));
360
421
  if (!path.includes(apiConfig.path))
361
422
  return false;
362
423
  const isQuerySubset = this.utilService.isJsonSubset(query, apiConfig.query);
@@ -428,6 +489,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
428
489
  }]
429
490
  }] });
430
491
 
492
+ const VCOMPLY_LOGO_URL = 'https://cdn.v-comply.com/logo/prod/v-logo.svg';
493
+ const API_TIMEOUT_TIME = 1000 * 15;
494
+ const ERROR_CONFIG = {
495
+ PAGE_NOT_FOUND: {
496
+ imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
497
+ title: 'Oops!',
498
+ description: "The page you're looking for doesn't exist.",
499
+ details: 'Please check the URL or return to the homepage.',
500
+ buttonText: 'GO TO DASHBOARD',
501
+ },
502
+ UNAUTHORIZED: {
503
+ imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
504
+ title: 'Oops!',
505
+ description: "You don't have permission to access this page.",
506
+ details: 'If you believe this is an error, please contact',
507
+ email: 'help@v-comply.com',
508
+ support: 'for support',
509
+ buttonText: 'CONTACT SUPPORT',
510
+ mail: 'mailto:help@v-comply.com',
511
+ },
512
+ SESSION_EXPIRED: {
513
+ heading: 'Session Expired!',
514
+ description: 'Your session has expired. Please log in again to continue using the app.',
515
+ buttonText: 'LOGIN',
516
+ },
517
+ CHUNK_UNAVAILABLE: {
518
+ heading: 'Oops!',
519
+ description: 'We are unable to load the data.',
520
+ buttonText: 'REFRESH',
521
+ },
522
+ SERVER_ERROR: {
523
+ imageUrl: 'https://cdn.v-comply.com/application/images/Error-page-illustration.svg',
524
+ title: 'Oops!',
525
+ description: 'We are unable to load the data.',
526
+ details: 'Please refresh this page or try again later.',
527
+ buttonText: 'REFRESH',
528
+ snackBarMessage: `Oops! Something went wrong. Please try again later.`,
529
+ },
530
+ COMPONENT_LEVEL_SERVER_ERROR: {
531
+ imageUrl: 'https://cdn.v-comply.com/application/images/sad-emoji-icon.svg',
532
+ title: 'Oops!',
533
+ description: 'We are unable to load the data.',
534
+ details: 'Please refresh this section or try again later.',
535
+ buttonText: 'RETRY',
536
+ },
537
+ NETWORK_UNAVAILABLE: {
538
+ offlineMessage: "You're currently offline. Please check your internet connection and try again.",
539
+ },
540
+ };
541
+
431
542
  class SnackBarComponent {
432
543
  constructor(snackbarService) {
433
544
  this.snackbarService = snackbarService;
@@ -1022,10 +1133,7 @@ class PageNotFoundComponent {
1022
1133
  this.currentYear = new Date().getFullYear();
1023
1134
  }
1024
1135
  redirectToHome() {
1025
- const currentUrl = window.location.href;
1026
- if (currentUrl.includes('organization')) {
1027
- this.router.navigate(['/global-dashboard/compliance_dashboard']);
1028
- }
1136
+ window.location.replace('/global-dashboard/compliance_dashboard');
1029
1137
  }
1030
1138
  }
1031
1139
  PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: PageNotFoundComponent, deps: [{ token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
@@ -1102,53 +1210,53 @@ class ComponentLevelServerErrorComponent {
1102
1210
  }
1103
1211
  ComponentLevelServerErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ComponentLevelServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1104
1212
  ComponentLevelServerErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ComponentLevelServerErrorComponent, selector: "lib-vc-error-component-server-error", outputs: { onClick: "onClick" }, ngImport: i0, template: `
1105
- <div class="errorPage">
1106
- <div class="errorPage-inner">
1107
- <div class="errorPage-inner-image">
1213
+ <div class="serverError">
1214
+ <div class="serverError-inner">
1215
+ <div class="serverError-inner-image">
1108
1216
  <img
1109
1217
  [src]="errorConfig.imageUrl"
1110
1218
  alt="Error Image"
1111
- width="246"
1112
- height="178"
1219
+ width="106"
1220
+ height="76"
1113
1221
  />
1114
1222
  </div>
1115
- <div class="errorPage-inner-bottom">
1116
- <div class="errorPage-heading">{{ errorConfig.title }}</div>
1117
- <div class="errorPage-text">{{ errorConfig.description }}</div>
1118
- <div class="errorPage-details">{{ errorConfig.details }}</div>
1119
- <button class="errorPage-btn" (click)="onClick.emit(true)">
1223
+ <div class="serverError-inner-bottom">
1224
+ <div class="serverError-heading">{{ errorConfig.title }}</div>
1225
+ <div class="serverError-text">{{ errorConfig.description }}</div>
1226
+ <div class="serverError-details">{{ errorConfig.details }}</div>
1227
+ <button class="serverError-btn" (click)="onClick.emit(true)">
1120
1228
  {{ errorConfig.buttonText }}
1121
1229
  <i class="icons">&#xe92b;</i>
1122
1230
  </button>
1123
1231
  </div>
1124
1232
  </div>
1125
1233
  </div>
1126
- `, isInline: true, styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";.errorPage{background:#fff;display:flex;align-items:center;justify-content:center;border-radius:2px;width:100%;height:100vh}.errorPage-inner{text-align:center}.errorPage-inner-image{width:16rem;margin:0 auto}.errorPage-inner-bottom{margin-top:1rem}.errorPage-inner-bottom .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-bottom .errorPage-text{color:#141724;font-size:19px;font-weight:500;line-height:1.75rem;margin-bottom:.5rem}.errorPage-inner-bottom .errorPage-details{color:#565a6f;font-size:13px;line-height:20px;margin-bottom:1.75rem}.errorPage-inner-bottom .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-bottom .errorPage-btn i{font-size:14px;margin-left:.25rem}\n"] });
1234
+ `, isInline: true, styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";.serverError{background:#fff;display:flex;align-items:center;justify-content:center;border-radius:2px;width:100%;height:100%}.serverError-inner{text-align:center}.serverError-inner-image{width:16rem;margin:0 auto}.serverError-inner-bottom{margin-top:1rem}.serverError-inner-bottom .serverError-heading{-webkit-text-fill-color:#e3e3e9;-webkit-text-stroke-color:#a9aab6;-webkit-text-stroke-width:1px;color:#e3e3e9;font-size:40px;font-weight:bold;line-height:56px;margin-bottom:1.5rem}.serverError-inner-bottom .serverError-text{color:#141724;font-size:19px;font-weight:500;line-height:1.75rem;margin-bottom:.5rem}.serverError-inner-bottom .serverError-details{color:#565a6f;font-size:13px;line-height:20px;margin-bottom:2rem}.serverError-inner-bottom .serverError-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}.serverError-inner-bottom .serverError-btn i{font-size:12px;margin-left:8px}\n"] });
1127
1235
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ComponentLevelServerErrorComponent, decorators: [{
1128
1236
  type: Component,
1129
1237
  args: [{ selector: 'lib-vc-error-component-server-error', template: `
1130
- <div class="errorPage">
1131
- <div class="errorPage-inner">
1132
- <div class="errorPage-inner-image">
1238
+ <div class="serverError">
1239
+ <div class="serverError-inner">
1240
+ <div class="serverError-inner-image">
1133
1241
  <img
1134
1242
  [src]="errorConfig.imageUrl"
1135
1243
  alt="Error Image"
1136
- width="246"
1137
- height="178"
1244
+ width="106"
1245
+ height="76"
1138
1246
  />
1139
1247
  </div>
1140
- <div class="errorPage-inner-bottom">
1141
- <div class="errorPage-heading">{{ errorConfig.title }}</div>
1142
- <div class="errorPage-text">{{ errorConfig.description }}</div>
1143
- <div class="errorPage-details">{{ errorConfig.details }}</div>
1144
- <button class="errorPage-btn" (click)="onClick.emit(true)">
1248
+ <div class="serverError-inner-bottom">
1249
+ <div class="serverError-heading">{{ errorConfig.title }}</div>
1250
+ <div class="serverError-text">{{ errorConfig.description }}</div>
1251
+ <div class="serverError-details">{{ errorConfig.details }}</div>
1252
+ <button class="serverError-btn" (click)="onClick.emit(true)">
1145
1253
  {{ errorConfig.buttonText }}
1146
1254
  <i class="icons">&#xe92b;</i>
1147
1255
  </button>
1148
1256
  </div>
1149
1257
  </div>
1150
1258
  </div>
1151
- `, styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";.errorPage{background:#fff;display:flex;align-items:center;justify-content:center;border-radius:2px;width:100%;height:100vh}.errorPage-inner{text-align:center}.errorPage-inner-image{width:16rem;margin:0 auto}.errorPage-inner-bottom{margin-top:1rem}.errorPage-inner-bottom .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-bottom .errorPage-text{color:#141724;font-size:19px;font-weight:500;line-height:1.75rem;margin-bottom:.5rem}.errorPage-inner-bottom .errorPage-details{color:#565a6f;font-size:13px;line-height:20px;margin-bottom:1.75rem}.errorPage-inner-bottom .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-bottom .errorPage-btn i{font-size:14px;margin-left:.25rem}\n"] }]
1259
+ `, styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";.serverError{background:#fff;display:flex;align-items:center;justify-content:center;border-radius:2px;width:100%;height:100%}.serverError-inner{text-align:center}.serverError-inner-image{width:16rem;margin:0 auto}.serverError-inner-bottom{margin-top:1rem}.serverError-inner-bottom .serverError-heading{-webkit-text-fill-color:#e3e3e9;-webkit-text-stroke-color:#a9aab6;-webkit-text-stroke-width:1px;color:#e3e3e9;font-size:40px;font-weight:bold;line-height:56px;margin-bottom:1.5rem}.serverError-inner-bottom .serverError-text{color:#141724;font-size:19px;font-weight:500;line-height:1.75rem;margin-bottom:.5rem}.serverError-inner-bottom .serverError-details{color:#565a6f;font-size:13px;line-height:20px;margin-bottom:2rem}.serverError-inner-bottom .serverError-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}.serverError-inner-bottom .serverError-btn i{font-size:12px;margin-left:8px}\n"] }]
1152
1260
  }], propDecorators: { onClick: [{
1153
1261
  type: Output
1154
1262
  }] } });