@hmcts/ccd-case-ui-toolkit 7.0.0-rc6 → 7.0.0-rc8
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/app.config.mjs +1 -1
- package/esm2020/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +3 -3
- package/esm2020/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +2 -2
- package/esm2020/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.mjs +6 -3
- package/esm2020/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.mjs +7 -7
- package/esm2020/lib/shared/components/case-viewer/services/case.resolver.mjs +16 -9
- package/esm2020/lib/shared/domain/http/http-error.model.mjs +8 -1
- package/esm2020/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.mjs +2 -2
- package/esm2020/lib/shared/services/form/form-value.service.mjs +2 -2
- package/esm2020/lib/shared/services/http/http-error.service.mjs +3 -5
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +39 -25
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +38 -25
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/app.config.d.ts +2 -0
- package/lib/app.config.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts +2 -0
- package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts +2 -2
- package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts +3 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
- package/lib/shared/domain/http/http-error.model.d.ts.map +1 -1
- package/lib/shared/services/http/http-error.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1247,6 +1247,13 @@ class HttpError {
|
|
|
1247
1247
|
error[key] = response.error.hasOwnProperty(key) && response.error[key] ? response.error[key] : error[key];
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
|
+
// Error object in HttpErrorResponse will be empty for 403 errors
|
|
1251
|
+
// Set the error properties of HttpError accordingly
|
|
1252
|
+
if (response?.status === 403) {
|
|
1253
|
+
error.error = response.statusText;
|
|
1254
|
+
error.status = response.status;
|
|
1255
|
+
error.message = response.message;
|
|
1256
|
+
}
|
|
1250
1257
|
return error;
|
|
1251
1258
|
}
|
|
1252
1259
|
}
|
|
@@ -1292,9 +1299,7 @@ class HttpErrorService {
|
|
|
1292
1299
|
}
|
|
1293
1300
|
let httpError = new HttpError();
|
|
1294
1301
|
if (error instanceof HttpErrorResponse) {
|
|
1295
|
-
if (error.headers
|
|
1296
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE)
|
|
1297
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
1302
|
+
if (error.headers?.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
1298
1303
|
try {
|
|
1299
1304
|
httpError = HttpError.from(error);
|
|
1300
1305
|
}
|
|
@@ -1328,7 +1333,7 @@ class HttpErrorService {
|
|
|
1328
1333
|
console.error('Handling error in http error service.');
|
|
1329
1334
|
console.error(error);
|
|
1330
1335
|
const httpError = HttpErrorService.convertToHttpError(error);
|
|
1331
|
-
if (redirectIfNotAuthorised &&
|
|
1336
|
+
if (redirectIfNotAuthorised && httpError.status === 401) {
|
|
1332
1337
|
this.authService.signIn();
|
|
1333
1338
|
}
|
|
1334
1339
|
return throwError(httpError);
|
|
@@ -5430,7 +5435,7 @@ class FormValueService {
|
|
|
5430
5435
|
// Retain anything that is readonly and not a label.
|
|
5431
5436
|
continue;
|
|
5432
5437
|
}
|
|
5433
|
-
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.id !== 'caseLinks') {
|
|
5438
|
+
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.id !== 'caseLinks' && !field.retain_hidden_value) {
|
|
5434
5439
|
// Delete anything that is hidden (that is NOT readonly), and that
|
|
5435
5440
|
// hasn't had its display_context overridden to make it hidden.
|
|
5436
5441
|
delete data[field.id];
|
|
@@ -8393,13 +8398,13 @@ class ValidPageListCaseFieldsService {
|
|
|
8393
8398
|
constructor(fieldsUtils) {
|
|
8394
8399
|
this.fieldsUtils = fieldsUtils;
|
|
8395
8400
|
}
|
|
8396
|
-
isShown(page, eventTriggerFields,
|
|
8401
|
+
isShown(page, eventTriggerFields, formFields) {
|
|
8397
8402
|
const fields = this.fieldsUtils
|
|
8398
|
-
.mergeCaseFieldsAndFormFields(eventTriggerFields,
|
|
8403
|
+
.mergeCaseFieldsAndFormFields(eventTriggerFields, formFields);
|
|
8399
8404
|
return page.parsedShowCondition.match(fields);
|
|
8400
8405
|
}
|
|
8401
|
-
deleteNonValidatedFields(validPageList, caseEventDatadata, eventTriggerFields, fromPreviousPage
|
|
8402
|
-
const pageListCaseFields = this.validPageListCaseFields(validPageList,
|
|
8406
|
+
deleteNonValidatedFields(validPageList, caseEventDatadata, eventTriggerFields, fromPreviousPage, formFields) {
|
|
8407
|
+
const pageListCaseFields = this.validPageListCaseFields(validPageList, eventTriggerFields, formFields);
|
|
8403
8408
|
if (!fromPreviousPage && pageListCaseFields.length > 0) {
|
|
8404
8409
|
Object.keys(caseEventDatadata).forEach(key => {
|
|
8405
8410
|
if (pageListCaseFields.findIndex((element) => element.id === key) < 0) {
|
|
@@ -8408,10 +8413,10 @@ class ValidPageListCaseFieldsService {
|
|
|
8408
8413
|
});
|
|
8409
8414
|
}
|
|
8410
8415
|
}
|
|
8411
|
-
validPageListCaseFields(validPageList,
|
|
8416
|
+
validPageListCaseFields(validPageList, eventTriggerFields, formFields) {
|
|
8412
8417
|
const validPageListCaseFields = [];
|
|
8413
8418
|
validPageList.forEach(page => {
|
|
8414
|
-
if (this.isShown(page, eventTriggerFields,
|
|
8419
|
+
if (this.isShown(page, eventTriggerFields, formFields)) {
|
|
8415
8420
|
page.case_fields.forEach(field => validPageListCaseFields.push(field));
|
|
8416
8421
|
}
|
|
8417
8422
|
});
|
|
@@ -8609,8 +8614,8 @@ class CaseEditComponent {
|
|
|
8609
8614
|
// Remove "Launcher"-type fields (these have no values and are not intended to be persisted)
|
|
8610
8615
|
this.formValueService.removeCaseFieldsOfType(caseEventData.data, eventTrigger.case_fields, ['FlagLauncher', 'ComponentLauncher']);
|
|
8611
8616
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
8612
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, eventTrigger.case_fields, false);
|
|
8613
|
-
const pageListCaseFields = this.validPageListCaseFieldsService.validPageListCaseFields(this.validPageList,
|
|
8617
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, eventTrigger.case_fields, false, form.controls['data'].value);
|
|
8618
|
+
const pageListCaseFields = this.validPageListCaseFieldsService.validPageListCaseFields(this.validPageList, eventTrigger.case_fields, form.controls['data'].value);
|
|
8614
8619
|
// Remove unnecessary case fields which are hidden, only if the submission is *not* for Case Flags
|
|
8615
8620
|
if (!this.isCaseFlagSubmission) {
|
|
8616
8621
|
this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true);
|
|
@@ -9822,7 +9827,7 @@ class CaseEditPageComponent {
|
|
|
9822
9827
|
// Get hold of the CaseEventData.
|
|
9823
9828
|
const caseEventData = this.formValueService.sanitise(formFields);
|
|
9824
9829
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
9825
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage);
|
|
9830
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage, this.editForm.controls['data'].value);
|
|
9826
9831
|
// Tidy it up before we return it.
|
|
9827
9832
|
this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
|
|
9828
9833
|
return caseEventData;
|
|
@@ -21961,7 +21966,7 @@ class ReadFieldsFilterPipe {
|
|
|
21961
21966
|
let checkConditionalShowAgainst = values;
|
|
21962
21967
|
let formGroupAvailable = false;
|
|
21963
21968
|
if (formGroup) {
|
|
21964
|
-
checkConditionalShowAgainst = formGroup.parent.getRawValue().data;
|
|
21969
|
+
checkConditionalShowAgainst = formGroup.value ? formGroup.parent.getRawValue().data : formGroup;
|
|
21965
21970
|
formGroupAvailable = true;
|
|
21966
21971
|
if (idPrefix !== undefined) {
|
|
21967
21972
|
if (idPrefix !== '') {
|
|
@@ -22905,7 +22910,7 @@ function CaseEditSubmitComponent_div_0_ng_container_11_ng_container_7_ng_contain
|
|
|
22905
22910
|
const page_r13 = i0.ɵɵnextContext().$implicit;
|
|
22906
22911
|
const ctx_r14 = i0.ɵɵnextContext(3);
|
|
22907
22912
|
i0.ɵɵadvance(1);
|
|
22908
|
-
i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 1, i0.ɵɵpipeBindV(3, 3, i0.ɵɵpureFunction2(12, _c0$f, i0.ɵɵpipeBind2(4, 9, page_r13, ctx_r14.editForm), ctx_r14.
|
|
22913
|
+
i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 1, i0.ɵɵpipeBindV(3, 3, i0.ɵɵpureFunction2(12, _c0$f, i0.ɵɵpipeBind2(4, 9, page_r13, ctx_r14.editForm), ctx_r14.allFieldsValues))));
|
|
22909
22914
|
} }
|
|
22910
22915
|
function CaseEditSubmitComponent_div_0_ng_container_11_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
22911
22916
|
i0.ɵɵelementContainerStart(0);
|
|
@@ -23110,6 +23115,9 @@ class CaseEditSubmitComponent {
|
|
|
23110
23115
|
this.showSummaryFields = this.sortFieldsByShowSummaryContent(this.eventTrigger.case_fields);
|
|
23111
23116
|
this.caseEdit.isSubmitting = false;
|
|
23112
23117
|
this.contextFields = this.getCaseFields();
|
|
23118
|
+
this.metadataFieldsObject = this.caseEdit?.caseDetails?.metadataFields?.
|
|
23119
|
+
reduce((o, key) => Object.assign(o, { [key.id]: key.value }), {});
|
|
23120
|
+
this.allFieldsValues = Object.assign(this.metadataFieldsObject ? this.metadataFieldsObject : {}, this.editForm.getRawValue().data);
|
|
23113
23121
|
// Indicates if the submission is for a Case Flag, as opposed to a "regular" form submission, by the presence of
|
|
23114
23122
|
// a FlagLauncher field in the event trigger
|
|
23115
23123
|
this.caseEdit.isCaseFlagSubmission =
|
|
@@ -23286,7 +23294,7 @@ CaseEditSubmitComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Cas
|
|
|
23286
23294
|
} }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
|
|
23287
23295
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
|
|
23288
23296
|
type: Component,
|
|
23289
|
-
args: [{ selector: 'ccd-case-edit-submit', template: "<div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{ eventTrigger.name}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :
|
|
23297
|
+
args: [{ selector: 'ccd-case-edit-submit', template: "<div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{ eventTrigger.name}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\"><span class=\"text-16\">{{field.label}}</span></th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\"><span class=\"text-16\" attr.aria-label=\"Change {{ field.label }}\">Change</span></a>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\" *ngIf=\"profile && !isSolicitor()\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">Previous</button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">{{triggerText}}</button>\n </div>\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText()}}</a></p>\n </form>\n</div>\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.case-field-change{width:5%}\n"] }]
|
|
23290
23298
|
}], function () { return [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$2.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }]; }, null); })();
|
|
23291
23299
|
|
|
23292
23300
|
function CaseProgressComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -25795,12 +25803,13 @@ CaseTimelineModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Commo
|
|
|
25795
25803
|
i0.ɵɵsetComponentScope(CaseTimelineComponent, function () { return [i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, CaseHistoryComponent, EventLogComponent]; }, function () { return [i1$1.RpxTranslatePipe]; });
|
|
25796
25804
|
|
|
25797
25805
|
class CaseResolver {
|
|
25798
|
-
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage) {
|
|
25806
|
+
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage, appConfig) {
|
|
25799
25807
|
this.caseNotifier = caseNotifier;
|
|
25800
25808
|
this.draftService = draftService;
|
|
25801
25809
|
this.navigationNotifierService = navigationNotifierService;
|
|
25802
25810
|
this.router = router;
|
|
25803
25811
|
this.sessionStorage = sessionStorage;
|
|
25812
|
+
this.appConfig = appConfig;
|
|
25804
25813
|
router.events.pipe(filter(event => event instanceof NavigationEnd))
|
|
25805
25814
|
.subscribe((event) => {
|
|
25806
25815
|
this.previousUrl = event.url;
|
|
@@ -25845,7 +25854,7 @@ class CaseResolver {
|
|
|
25845
25854
|
else {
|
|
25846
25855
|
console.info('getAndCacheCaseView - Path B.');
|
|
25847
25856
|
return this.caseNotifier.fetchAndRefresh(cid)
|
|
25848
|
-
.pipe(catchError(error => this.processErrorInCaseFetch(error)))
|
|
25857
|
+
.pipe(catchError(error => this.processErrorInCaseFetch(error, cid)))
|
|
25849
25858
|
.toPromise();
|
|
25850
25859
|
}
|
|
25851
25860
|
}
|
|
@@ -25857,9 +25866,9 @@ class CaseResolver {
|
|
|
25857
25866
|
this.caseNotifier.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
25858
25867
|
this.caseNotifier.announceCase(this.caseNotifier.cachedCaseView);
|
|
25859
25868
|
return this.caseNotifier.cachedCaseView;
|
|
25860
|
-
}), catchError(error => this.processErrorInCaseFetch(error))).toPromise();
|
|
25869
|
+
}), catchError(error => this.processErrorInCaseFetch(error, cid))).toPromise();
|
|
25861
25870
|
}
|
|
25862
|
-
processErrorInCaseFetch(error) {
|
|
25871
|
+
processErrorInCaseFetch(error, caseReference) {
|
|
25863
25872
|
console.error('!!! processErrorInCaseFetch !!!');
|
|
25864
25873
|
console.error(error);
|
|
25865
25874
|
// TODO Should be logged to remote logging infrastructure
|
|
@@ -25867,12 +25876,16 @@ class CaseResolver {
|
|
|
25867
25876
|
this.router.navigate(['/search/noresults']);
|
|
25868
25877
|
return of(null);
|
|
25869
25878
|
}
|
|
25870
|
-
console.error(error);
|
|
25871
25879
|
if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
|
|
25872
25880
|
this.router.navigate(['/list/case']);
|
|
25873
25881
|
return of(null);
|
|
25874
25882
|
}
|
|
25875
|
-
|
|
25883
|
+
// Error 403 and enable-restricted-case-access Launch Darkly flag is enabled, navigate to restricted case access page
|
|
25884
|
+
if (error.status === 403 && this.appConfig.getEnableRestrictedCaseAccessConfig()) {
|
|
25885
|
+
this.router.navigate([`/cases/restricted-case-access/${caseReference}`]);
|
|
25886
|
+
return of(null);
|
|
25887
|
+
}
|
|
25888
|
+
if (error.status !== 401) {
|
|
25876
25889
|
this.router.navigate(['/error']);
|
|
25877
25890
|
}
|
|
25878
25891
|
this.goToDefaultPage();
|
|
@@ -25898,11 +25911,11 @@ CaseResolver.PARAM_CASE_ID = 'cid';
|
|
|
25898
25911
|
CaseResolver.CASE_CREATED_MSG = 'The case has been created successfully';
|
|
25899
25912
|
CaseResolver.defaultWAPage = '/work/my-work/list';
|
|
25900
25913
|
CaseResolver.defaultPage = '/cases';
|
|
25901
|
-
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(SessionStorageService)); };
|
|
25914
|
+
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(AbstractAppConfig)); };
|
|
25902
25915
|
CaseResolver.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
|
|
25903
25916
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseResolver, [{
|
|
25904
25917
|
type: Injectable
|
|
25905
|
-
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$2.Router }, { type: SessionStorageService }]; }, null); })();
|
|
25918
|
+
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$2.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null); })();
|
|
25906
25919
|
|
|
25907
25920
|
class EventTriggerResolver {
|
|
25908
25921
|
constructor(casesService, alertService, profileService, profileNotifier) {
|