@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
|
@@ -15,9 +15,7 @@ export class HttpErrorService {
|
|
|
15
15
|
}
|
|
16
16
|
let httpError = new HttpError();
|
|
17
17
|
if (error instanceof HttpErrorResponse) {
|
|
18
|
-
if (error.headers
|
|
19
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE)
|
|
20
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
18
|
+
if (error.headers?.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
21
19
|
try {
|
|
22
20
|
httpError = HttpError.from(error);
|
|
23
21
|
}
|
|
@@ -51,7 +49,7 @@ export class HttpErrorService {
|
|
|
51
49
|
console.error('Handling error in http error service.');
|
|
52
50
|
console.error(error);
|
|
53
51
|
const httpError = HttpErrorService.convertToHttpError(error);
|
|
54
|
-
if (redirectIfNotAuthorised &&
|
|
52
|
+
if (redirectIfNotAuthorised && httpError.status === 401) {
|
|
55
53
|
this.authService.signIn();
|
|
56
54
|
}
|
|
57
55
|
return throwError(httpError);
|
|
@@ -64,4 +62,4 @@ HttpErrorService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HttpErr
|
|
|
64
62
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpErrorService, [{
|
|
65
63
|
type: Injectable
|
|
66
64
|
}], function () { return [{ type: i1.AuthService }]; }, null); })();
|
|
67
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
65
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cC1lcnJvci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9zZXJ2aWNlcy9odHRwL2h0dHAtZXJyb3Iuc2VydmljZS50cyJdLCJu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biAgICByZXR1cm4gZXJyb3I7XG4gIH1cblxuICBwdWJsaWMgaGFuZGxlKGVycm9yOiBIdHRwRXJyb3JSZXNwb25zZSB8IGFueSwgcmVkaXJlY3RJZk5vdEF1dGhvcmlzZWQgPSB0cnVlKTogT2JzZXJ2YWJsZTxuZXZlcj4ge1xuICAgIGNvbnNvbGUuZXJyb3IoJ0hhbmRsaW5nIGVycm9yIGluIGh0dHAgZXJyb3Igc2VydmljZS4nKTtcbiAgICBjb25zb2xlLmVycm9yKGVycm9yKTtcbiAgICBjb25zdCBodHRwRXJyb3I6IEh0dHBFcnJvciA9IEh0dHBFcnJvclNlcnZpY2UuY29udmVydFRvSHR0cEVycm9yKGVycm9yKTtcbiAgICBpZiAocmVkaXJlY3RJZk5vdEF1dGhvcmlzZWQgJiYgaHR0cEVycm9yLnN0YXR1cyA9PT0gNDAxKSB7XG4gICAgICB0aGlzLmF1dGhTZXJ2aWNlLnNpZ25JbigpO1xuICAgIH1cbiAgICByZXR1cm4gdGhyb3dFcnJvcihodHRwRXJyb3IpO1xuICB9XG59XG4iXX0=
|
|
@@ -1339,6 +1339,13 @@ class HttpError {
|
|
|
1339
1339
|
error[key] = response.error.hasOwnProperty(key) && response.error[key] ? response.error[key] : error[key];
|
|
1340
1340
|
});
|
|
1341
1341
|
}
|
|
1342
|
+
// Error object in HttpErrorResponse will be empty for 403 errors
|
|
1343
|
+
// Set the error properties of HttpError accordingly
|
|
1344
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
|
|
1345
|
+
error.error = response.statusText;
|
|
1346
|
+
error.status = response.status;
|
|
1347
|
+
error.message = response.message;
|
|
1348
|
+
}
|
|
1342
1349
|
return error;
|
|
1343
1350
|
}
|
|
1344
1351
|
}
|
|
@@ -1429,14 +1436,13 @@ class HttpErrorService {
|
|
|
1429
1436
|
this.authService = authService;
|
|
1430
1437
|
}
|
|
1431
1438
|
static convertToHttpError(error) {
|
|
1439
|
+
var _a;
|
|
1432
1440
|
if (error instanceof HttpError) {
|
|
1433
1441
|
return error;
|
|
1434
1442
|
}
|
|
1435
1443
|
let httpError = new HttpError();
|
|
1436
1444
|
if (error instanceof HttpErrorResponse) {
|
|
1437
|
-
if (error.headers
|
|
1438
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE)
|
|
1439
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
1445
|
+
if (((_a = error.headers) === null || _a === void 0 ? void 0 : _a.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON)) !== -1) {
|
|
1440
1446
|
try {
|
|
1441
1447
|
httpError = HttpError.from(error);
|
|
1442
1448
|
}
|
|
@@ -1470,7 +1476,7 @@ class HttpErrorService {
|
|
|
1470
1476
|
console.error('Handling error in http error service.');
|
|
1471
1477
|
console.error(error);
|
|
1472
1478
|
const httpError = HttpErrorService.convertToHttpError(error);
|
|
1473
|
-
if (redirectIfNotAuthorised &&
|
|
1479
|
+
if (redirectIfNotAuthorised && httpError.status === 401) {
|
|
1474
1480
|
this.authService.signIn();
|
|
1475
1481
|
}
|
|
1476
1482
|
return throwError(httpError);
|
|
@@ -5440,7 +5446,7 @@ class FormValueService {
|
|
|
5440
5446
|
// Retain anything that is readonly and not a label.
|
|
5441
5447
|
continue;
|
|
5442
5448
|
}
|
|
5443
|
-
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.id !== 'caseLinks') {
|
|
5449
|
+
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.id !== 'caseLinks' && !field.retain_hidden_value) {
|
|
5444
5450
|
// Delete anything that is hidden (that is NOT readonly), and that
|
|
5445
5451
|
// hasn't had its display_context overridden to make it hidden.
|
|
5446
5452
|
delete data[field.id];
|
|
@@ -8688,13 +8694,13 @@ class ValidPageListCaseFieldsService {
|
|
|
8688
8694
|
constructor(fieldsUtils) {
|
|
8689
8695
|
this.fieldsUtils = fieldsUtils;
|
|
8690
8696
|
}
|
|
8691
|
-
isShown(page, eventTriggerFields,
|
|
8697
|
+
isShown(page, eventTriggerFields, formFields) {
|
|
8692
8698
|
const fields = this.fieldsUtils
|
|
8693
|
-
.mergeCaseFieldsAndFormFields(eventTriggerFields,
|
|
8699
|
+
.mergeCaseFieldsAndFormFields(eventTriggerFields, formFields);
|
|
8694
8700
|
return page.parsedShowCondition.match(fields);
|
|
8695
8701
|
}
|
|
8696
|
-
deleteNonValidatedFields(validPageList, caseEventDatadata, eventTriggerFields, fromPreviousPage
|
|
8697
|
-
const pageListCaseFields = this.validPageListCaseFields(validPageList,
|
|
8702
|
+
deleteNonValidatedFields(validPageList, caseEventDatadata, eventTriggerFields, fromPreviousPage, formFields) {
|
|
8703
|
+
const pageListCaseFields = this.validPageListCaseFields(validPageList, eventTriggerFields, formFields);
|
|
8698
8704
|
if (!fromPreviousPage && pageListCaseFields.length > 0) {
|
|
8699
8705
|
Object.keys(caseEventDatadata).forEach(key => {
|
|
8700
8706
|
if (pageListCaseFields.findIndex((element) => element.id === key) < 0) {
|
|
@@ -8703,10 +8709,10 @@ class ValidPageListCaseFieldsService {
|
|
|
8703
8709
|
});
|
|
8704
8710
|
}
|
|
8705
8711
|
}
|
|
8706
|
-
validPageListCaseFields(validPageList,
|
|
8712
|
+
validPageListCaseFields(validPageList, eventTriggerFields, formFields) {
|
|
8707
8713
|
const validPageListCaseFields = [];
|
|
8708
8714
|
validPageList.forEach(page => {
|
|
8709
|
-
if (this.isShown(page, eventTriggerFields,
|
|
8715
|
+
if (this.isShown(page, eventTriggerFields, formFields)) {
|
|
8710
8716
|
page.case_fields.forEach(field => validPageListCaseFields.push(field));
|
|
8711
8717
|
}
|
|
8712
8718
|
});
|
|
@@ -8906,8 +8912,8 @@ class CaseEditComponent {
|
|
|
8906
8912
|
// Remove "Launcher"-type fields (these have no values and are not intended to be persisted)
|
|
8907
8913
|
this.formValueService.removeCaseFieldsOfType(caseEventData.data, eventTrigger.case_fields, ['FlagLauncher', 'ComponentLauncher']);
|
|
8908
8914
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
8909
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, eventTrigger.case_fields, false);
|
|
8910
|
-
const pageListCaseFields = this.validPageListCaseFieldsService.validPageListCaseFields(this.validPageList,
|
|
8915
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, eventTrigger.case_fields, false, form.controls['data'].value);
|
|
8916
|
+
const pageListCaseFields = this.validPageListCaseFieldsService.validPageListCaseFields(this.validPageList, eventTrigger.case_fields, form.controls['data'].value);
|
|
8911
8917
|
// Remove unnecessary case fields which are hidden, only if the submission is *not* for Case Flags
|
|
8912
8918
|
if (!this.isCaseFlagSubmission) {
|
|
8913
8919
|
this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true);
|
|
@@ -10209,7 +10215,7 @@ class CaseEditPageComponent {
|
|
|
10209
10215
|
// Get hold of the CaseEventData.
|
|
10210
10216
|
const caseEventData = this.formValueService.sanitise(formFields);
|
|
10211
10217
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
10212
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage);
|
|
10218
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage, this.editForm.controls['data'].value);
|
|
10213
10219
|
// Tidy it up before we return it.
|
|
10214
10220
|
this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
|
|
10215
10221
|
return caseEventData;
|
|
@@ -23690,7 +23696,7 @@ class ReadFieldsFilterPipe {
|
|
|
23690
23696
|
let checkConditionalShowAgainst = values;
|
|
23691
23697
|
let formGroupAvailable = false;
|
|
23692
23698
|
if (formGroup) {
|
|
23693
|
-
checkConditionalShowAgainst = formGroup.parent.getRawValue().data;
|
|
23699
|
+
checkConditionalShowAgainst = formGroup.value ? formGroup.parent.getRawValue().data : formGroup;
|
|
23694
23700
|
formGroupAvailable = true;
|
|
23695
23701
|
if (idPrefix !== undefined) {
|
|
23696
23702
|
if (idPrefix !== '') {
|
|
@@ -24714,7 +24720,7 @@ function CaseEditSubmitComponent_div_0_ng_container_11_ng_container_7_ng_contain
|
|
|
24714
24720
|
const page_r13 = i0.ɵɵnextContext().$implicit;
|
|
24715
24721
|
const ctx_r14 = i0.ɵɵnextContext(3);
|
|
24716
24722
|
i0.ɵɵadvance(1);
|
|
24717
|
-
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.
|
|
24723
|
+
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))));
|
|
24718
24724
|
}
|
|
24719
24725
|
}
|
|
24720
24726
|
function CaseEditSubmitComponent_div_0_ng_container_11_ng_container_7_Template(rf, ctx) {
|
|
@@ -24941,6 +24947,7 @@ class CaseEditSubmitComponent {
|
|
|
24941
24947
|
return this.caseEdit.isSubmitting || this.hasErrors;
|
|
24942
24948
|
}
|
|
24943
24949
|
ngOnInit() {
|
|
24950
|
+
var _a, _b, _c;
|
|
24944
24951
|
this.profileSubscription = this.profileNotifier.profile.subscribe(_ => this.profile = _);
|
|
24945
24952
|
this.eventTrigger = this.caseEdit.eventTrigger;
|
|
24946
24953
|
this.triggerText = this.eventTrigger.end_button_label || CallbackErrorsComponent.TRIGGER_TEXT_SUBMIT;
|
|
@@ -24949,6 +24956,8 @@ class CaseEditSubmitComponent {
|
|
|
24949
24956
|
this.showSummaryFields = this.sortFieldsByShowSummaryContent(this.eventTrigger.case_fields);
|
|
24950
24957
|
this.caseEdit.isSubmitting = false;
|
|
24951
24958
|
this.contextFields = this.getCaseFields();
|
|
24959
|
+
this.metadataFieldsObject = (_c = (_b = (_a = this.caseEdit) === null || _a === void 0 ? void 0 : _a.caseDetails) === null || _b === void 0 ? void 0 : _b.metadataFields) === null || _c === void 0 ? void 0 : _c.reduce((o, key) => Object.assign(o, { [key.id]: key.value }), {});
|
|
24960
|
+
this.allFieldsValues = Object.assign(this.metadataFieldsObject ? this.metadataFieldsObject : {}, this.editForm.getRawValue().data);
|
|
24952
24961
|
// Indicates if the submission is for a Case Flag, as opposed to a "regular" form submission, by the presence of
|
|
24953
24962
|
// a FlagLauncher field in the event trigger
|
|
24954
24963
|
this.caseEdit.isCaseFlagSubmission =
|
|
@@ -25130,7 +25139,7 @@ CaseEditSubmitComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Cas
|
|
|
25130
25139
|
(function () {
|
|
25131
25140
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
|
|
25132
25141
|
type: Component,
|
|
25133
|
-
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 :
|
|
25142
|
+
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"] }]
|
|
25134
25143
|
}], function () { return [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$2.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }]; }, null);
|
|
25135
25144
|
})();
|
|
25136
25145
|
|
|
@@ -27901,12 +27910,13 @@ CaseTimelineModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Commo
|
|
|
27901
27910
|
i0.ɵɵsetComponentScope(CaseTimelineComponent, function () { return [i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, CaseHistoryComponent, EventLogComponent]; }, function () { return [i1$1.RpxTranslatePipe]; });
|
|
27902
27911
|
|
|
27903
27912
|
class CaseResolver {
|
|
27904
|
-
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage) {
|
|
27913
|
+
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage, appConfig) {
|
|
27905
27914
|
this.caseNotifier = caseNotifier;
|
|
27906
27915
|
this.draftService = draftService;
|
|
27907
27916
|
this.navigationNotifierService = navigationNotifierService;
|
|
27908
27917
|
this.router = router;
|
|
27909
27918
|
this.sessionStorage = sessionStorage;
|
|
27919
|
+
this.appConfig = appConfig;
|
|
27910
27920
|
router.events.pipe(filter(event => event instanceof NavigationEnd))
|
|
27911
27921
|
.subscribe((event) => {
|
|
27912
27922
|
this.previousUrl = event.url;
|
|
@@ -27951,7 +27961,7 @@ class CaseResolver {
|
|
|
27951
27961
|
else {
|
|
27952
27962
|
console.info('getAndCacheCaseView - Path B.');
|
|
27953
27963
|
return this.caseNotifier.fetchAndRefresh(cid)
|
|
27954
|
-
.pipe(catchError(error => this.processErrorInCaseFetch(error)))
|
|
27964
|
+
.pipe(catchError(error => this.processErrorInCaseFetch(error, cid)))
|
|
27955
27965
|
.toPromise();
|
|
27956
27966
|
}
|
|
27957
27967
|
}
|
|
@@ -27963,9 +27973,9 @@ class CaseResolver {
|
|
|
27963
27973
|
this.caseNotifier.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
27964
27974
|
this.caseNotifier.announceCase(this.caseNotifier.cachedCaseView);
|
|
27965
27975
|
return this.caseNotifier.cachedCaseView;
|
|
27966
|
-
}), catchError(error => this.processErrorInCaseFetch(error))).toPromise();
|
|
27976
|
+
}), catchError(error => this.processErrorInCaseFetch(error, cid))).toPromise();
|
|
27967
27977
|
}
|
|
27968
|
-
processErrorInCaseFetch(error) {
|
|
27978
|
+
processErrorInCaseFetch(error, caseReference) {
|
|
27969
27979
|
console.error('!!! processErrorInCaseFetch !!!');
|
|
27970
27980
|
console.error(error);
|
|
27971
27981
|
// TODO Should be logged to remote logging infrastructure
|
|
@@ -27973,12 +27983,16 @@ class CaseResolver {
|
|
|
27973
27983
|
this.router.navigate(['/search/noresults']);
|
|
27974
27984
|
return of(null);
|
|
27975
27985
|
}
|
|
27976
|
-
console.error(error);
|
|
27977
27986
|
if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
|
|
27978
27987
|
this.router.navigate(['/list/case']);
|
|
27979
27988
|
return of(null);
|
|
27980
27989
|
}
|
|
27981
|
-
|
|
27990
|
+
// Error 403 and enable-restricted-case-access Launch Darkly flag is enabled, navigate to restricted case access page
|
|
27991
|
+
if (error.status === 403 && this.appConfig.getEnableRestrictedCaseAccessConfig()) {
|
|
27992
|
+
this.router.navigate([`/cases/restricted-case-access/${caseReference}`]);
|
|
27993
|
+
return of(null);
|
|
27994
|
+
}
|
|
27995
|
+
if (error.status !== 401) {
|
|
27982
27996
|
this.router.navigate(['/error']);
|
|
27983
27997
|
}
|
|
27984
27998
|
this.goToDefaultPage();
|
|
@@ -28004,12 +28018,12 @@ CaseResolver.PARAM_CASE_ID = 'cid';
|
|
|
28004
28018
|
CaseResolver.CASE_CREATED_MSG = 'The case has been created successfully';
|
|
28005
28019
|
CaseResolver.defaultWAPage = '/work/my-work/list';
|
|
28006
28020
|
CaseResolver.defaultPage = '/cases';
|
|
28007
|
-
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)); };
|
|
28021
|
+
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)); };
|
|
28008
28022
|
CaseResolver.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
|
|
28009
28023
|
(function () {
|
|
28010
28024
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseResolver, [{
|
|
28011
28025
|
type: Injectable
|
|
28012
|
-
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$2.Router }, { type: SessionStorageService }]; }, null);
|
|
28026
|
+
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$2.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null);
|
|
28013
28027
|
})();
|
|
28014
28028
|
|
|
28015
28029
|
class EventTriggerResolver {
|