@hmcts/ccd-case-ui-toolkit 6.19.15 → 6.19.16-exui-1152-rc1
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/bundles/hmcts-ccd-case-ui-toolkit.umd.js +51 -24
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
- package/esm2015/lib/app.config.js +1 -1
- package/esm2015/lib/shared/components/case-editor/case-edit/case-edit.component.js +2 -2
- package/esm2015/lib/shared/components/case-editor/services/wizard-page-field-to-case-field.mapper.js +4 -3
- package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +16 -9
- package/esm2015/lib/shared/domain/http/http-error.model.js +8 -1
- package/esm2015/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.js +4 -2
- package/esm2015/lib/shared/pipes/complex/fields-filter.pipe.js +4 -2
- package/esm2015/lib/shared/services/fields/fields.utils.js +6 -1
- package/esm2015/lib/shared/services/form/form-value.service.js +13 -7
- package/esm2015/lib/shared/services/http/http-error.service.js +4 -5
- package/esm2015/lib/shared/services/utils/retry/retry.service.js +1 -2
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js +50 -24
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js.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/services/wizard-page-field-to-case-field.mapper.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/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
- package/lib/shared/pipes/complex/fields-filter.pipe.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.utils.d.ts +1 -0
- package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
- package/lib/shared/services/form/form-value.service.d.ts +1 -1
- package/lib/shared/services/form/form-value.service.d.ts.map +1 -1
- package/lib/shared/services/http/http-error.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1985,6 +1985,13 @@
|
|
|
1985
1985
|
error[key] = response.error.hasOwnProperty(key) && response.error[key] ? response.error[key] : error[key];
|
|
1986
1986
|
});
|
|
1987
1987
|
}
|
|
1988
|
+
// Error object in HttpErrorResponse will be empty for 403 errors
|
|
1989
|
+
// Set the error properties of HttpError accordingly
|
|
1990
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
|
|
1991
|
+
error.error = response.statusText;
|
|
1992
|
+
error.status = response.status;
|
|
1993
|
+
error.message = response.message;
|
|
1994
|
+
}
|
|
1988
1995
|
return error;
|
|
1989
1996
|
};
|
|
1990
1997
|
return HttpError;
|
|
@@ -2083,14 +2090,13 @@
|
|
|
2083
2090
|
this.authService = authService;
|
|
2084
2091
|
}
|
|
2085
2092
|
HttpErrorService.convertToHttpError = function (error) {
|
|
2093
|
+
var _a;
|
|
2086
2094
|
if (error instanceof HttpError) {
|
|
2087
2095
|
return error;
|
|
2088
2096
|
}
|
|
2089
2097
|
var httpError = new HttpError();
|
|
2090
2098
|
if (error instanceof i1$2.HttpErrorResponse) {
|
|
2091
|
-
if (error.headers
|
|
2092
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE)
|
|
2093
|
-
&& error.headers.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
|
|
2099
|
+
if (((_a = error.headers) === null || _a === void 0 ? void 0 : _a.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON)) !== -1) {
|
|
2094
2100
|
try {
|
|
2095
2101
|
httpError = HttpError.from(error);
|
|
2096
2102
|
}
|
|
@@ -2125,7 +2131,7 @@
|
|
|
2125
2131
|
console.error('Handling error in http error service.');
|
|
2126
2132
|
console.error(error);
|
|
2127
2133
|
var httpError = HttpErrorService.convertToHttpError(error);
|
|
2128
|
-
if (redirectIfNotAuthorised &&
|
|
2134
|
+
if (redirectIfNotAuthorised && httpError.status === 401) {
|
|
2129
2135
|
this.authService.signIn();
|
|
2130
2136
|
}
|
|
2131
2137
|
return rxjs.throwError(httpError);
|
|
@@ -4107,6 +4113,11 @@
|
|
|
4107
4113
|
var FieldsUtils = /** @class */ (function () {
|
|
4108
4114
|
function FieldsUtils() {
|
|
4109
4115
|
}
|
|
4116
|
+
FieldsUtils.isValidDisplayContext = function (ctx) {
|
|
4117
|
+
return (ctx === 'MANDATORY' || ctx === 'READONLY'
|
|
4118
|
+
|| ctx === 'OPTIONAL' || ctx === 'HIDDEN'
|
|
4119
|
+
|| ctx === 'COMPLEX');
|
|
4120
|
+
};
|
|
4110
4121
|
FieldsUtils.convertToCaseField = function (obj) {
|
|
4111
4122
|
if (!(obj instanceof CaseField)) {
|
|
4112
4123
|
return classTransformer.plainToClassFromExist(new CaseField(), obj);
|
|
@@ -6387,12 +6398,13 @@
|
|
|
6387
6398
|
* @param clearEmpty Whether or not we should clear out empty, optional, complex objects.
|
|
6388
6399
|
* @param clearNonCase Whether or not we should clear out non-case fields at the top level.
|
|
6389
6400
|
*/
|
|
6390
|
-
FormValueService.prototype.removeUnnecessaryFields = function (data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, currentPageCaseFields) {
|
|
6401
|
+
FormValueService.prototype.removeUnnecessaryFields = function (data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, currentPageCaseFields, isCalledFromSubmit) {
|
|
6391
6402
|
var e_8, _a;
|
|
6392
6403
|
if (clearEmpty === void 0) { clearEmpty = false; }
|
|
6393
6404
|
if (clearNonCase === void 0) { clearNonCase = false; }
|
|
6394
6405
|
if (fromPreviousPage === void 0) { fromPreviousPage = false; }
|
|
6395
6406
|
if (currentPageCaseFields === void 0) { currentPageCaseFields = []; }
|
|
6407
|
+
if (isCalledFromSubmit === void 0) { isCalledFromSubmit = false; }
|
|
6396
6408
|
if (data && caseFields && caseFields.length > 0) {
|
|
6397
6409
|
// check if there is any data at the top level of the form that's not in the caseFields
|
|
6398
6410
|
if (clearNonCase) {
|
|
@@ -6403,10 +6415,16 @@
|
|
|
6403
6415
|
if (!FormValueService.isLabel(field) && FormValueService.isReadOnly(field)) {
|
|
6404
6416
|
return "continue";
|
|
6405
6417
|
}
|
|
6406
|
-
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.
|
|
6418
|
+
if (field.hidden === true && field.display_context !== 'HIDDEN' && field.display_context !== 'HIDDEN_TEMP' && field.id !== 'caseLinks') {
|
|
6407
6419
|
// Delete anything that is hidden (that is NOT readonly), and that
|
|
6408
6420
|
// hasn't had its display_context overridden to make it hidden.
|
|
6409
|
-
|
|
6421
|
+
// in event submission check for field's retain_hidden_value defore deletion
|
|
6422
|
+
if (isCalledFromSubmit && !field.retain_hidden_value) {
|
|
6423
|
+
delete data[field.id];
|
|
6424
|
+
}
|
|
6425
|
+
else {
|
|
6426
|
+
delete data[field.id];
|
|
6427
|
+
}
|
|
6410
6428
|
}
|
|
6411
6429
|
else if (field.field_type) {
|
|
6412
6430
|
switch (field.field_type.type) {
|
|
@@ -6420,7 +6438,7 @@
|
|
|
6420
6438
|
}
|
|
6421
6439
|
break;
|
|
6422
6440
|
case 'Complex':
|
|
6423
|
-
this_1.removeUnnecessaryFields(data[field.id], field.field_type.complex_fields, clearEmpty);
|
|
6441
|
+
this_1.removeUnnecessaryFields(data[field.id], field.field_type.complex_fields, clearEmpty, false, false, [], isCalledFromSubmit);
|
|
6424
6442
|
// Also remove any optional complex objects that are completely empty.
|
|
6425
6443
|
// EUI-4244: Ritesh's fix, passing true instead of clearEmpty.
|
|
6426
6444
|
if (FormValueService.clearOptionalEmpty(true, data[field.id], field)) {
|
|
@@ -6445,8 +6463,8 @@
|
|
|
6445
6463
|
// Iterate through the elements and remove any unnecessary fields within.
|
|
6446
6464
|
for (var collection_3 = (e_9 = void 0, __values(collection)), collection_3_1 = collection_3.next(); !collection_3_1.done; collection_3_1 = collection_3.next()) {
|
|
6447
6465
|
var item = collection_3_1.value;
|
|
6448
|
-
this_1.removeUnnecessaryFields(item, field.field_type.collection_field_type.complex_fields, clearEmpty);
|
|
6449
|
-
this_1.removeUnnecessaryFields(item.value, field.field_type.collection_field_type.complex_fields, false);
|
|
6466
|
+
this_1.removeUnnecessaryFields(item, field.field_type.collection_field_type.complex_fields, clearEmpty, false, false, [], isCalledFromSubmit);
|
|
6467
|
+
this_1.removeUnnecessaryFields(item.value, field.field_type.collection_field_type.complex_fields, false, false, false, [], isCalledFromSubmit);
|
|
6450
6468
|
}
|
|
6451
6469
|
}
|
|
6452
6470
|
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
@@ -8095,7 +8113,6 @@
|
|
|
8095
8113
|
this.artificialDelayOn = true;
|
|
8096
8114
|
this.selectedDelay = this.selectActualDelayTime();
|
|
8097
8115
|
}
|
|
8098
|
-
;
|
|
8099
8116
|
ArtificialDelayContext.prototype.switchArtificialDelays = function (status) {
|
|
8100
8117
|
this.artificialDelayOn = status;
|
|
8101
8118
|
this.selectedDelay = this.selectActualDelayTime();
|
|
@@ -8700,7 +8717,8 @@
|
|
|
8700
8717
|
childrenCaseFields.forEach(function (e) { return _this.hideParentIfAllChildrenHidden(e); });
|
|
8701
8718
|
if (childrenCaseFields.length > 0 && this.allCaseFieldsHidden(childrenCaseFields)) {
|
|
8702
8719
|
caseField.hidden = true;
|
|
8703
|
-
|
|
8720
|
+
// marking display_context as special hidden so field not being deleted in event submission
|
|
8721
|
+
caseField.display_context = 'HIDDEN_TEMP';
|
|
8704
8722
|
}
|
|
8705
8723
|
};
|
|
8706
8724
|
WizardPageFieldToCaseFieldMapper.prototype.getCaseFieldChildren = function (caseField) {
|
|
@@ -8714,7 +8732,7 @@
|
|
|
8714
8732
|
return childrenCaseFields;
|
|
8715
8733
|
};
|
|
8716
8734
|
WizardPageFieldToCaseFieldMapper.prototype.allCaseFieldsHidden = function (children) {
|
|
8717
|
-
return
|
|
8735
|
+
return children.every(function (e) { return e.display_context === 'HIDDEN' || e.display_context === 'HIDDEN_TEMP'; });
|
|
8718
8736
|
};
|
|
8719
8737
|
return WizardPageFieldToCaseFieldMapper;
|
|
8720
8738
|
}());
|
|
@@ -10117,7 +10135,7 @@
|
|
|
10117
10135
|
var pageListCaseFields = this.validPageListCaseFieldsService.validPageListCaseFields(this.validPageList, eventTrigger.case_fields, form.controls['data'].value);
|
|
10118
10136
|
// Remove unnecessary case fields which are hidden, only if the submission is *not* for Case Flags
|
|
10119
10137
|
if (!this.isCaseFlagSubmission) {
|
|
10120
|
-
this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true);
|
|
10138
|
+
this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true, false, [], true);
|
|
10121
10139
|
}
|
|
10122
10140
|
caseEventData.event_token = eventTrigger.event_token;
|
|
10123
10141
|
caseEventData.ignore_warning = this.ignoreWarning;
|
|
@@ -14164,7 +14182,9 @@
|
|
|
14164
14182
|
.filter(function (f) { return keepEmpty || FieldsFilterPipe.keepField(f); })
|
|
14165
14183
|
.map(function (f) {
|
|
14166
14184
|
if (!f.display_context) {
|
|
14167
|
-
|
|
14185
|
+
if (FieldsUtils.isValidDisplayContext(complexField.display_context)) {
|
|
14186
|
+
f.display_context = complexField.display_context;
|
|
14187
|
+
}
|
|
14168
14188
|
}
|
|
14169
14189
|
return f;
|
|
14170
14190
|
});
|
|
@@ -26581,7 +26601,9 @@
|
|
|
26581
26601
|
})
|
|
26582
26602
|
.map(function (f) {
|
|
26583
26603
|
if (!f.display_context) {
|
|
26584
|
-
|
|
26604
|
+
if (FieldsUtils.isValidDisplayContext(complexField.display_context)) {
|
|
26605
|
+
f.display_context = complexField.display_context;
|
|
26606
|
+
}
|
|
26585
26607
|
}
|
|
26586
26608
|
if (setupHidden) {
|
|
26587
26609
|
ReadFieldsFilterPipe.evaluateConditionalShow(f, checkConditionalShowAgainst, path, formGroupAvailable, complexField.id);
|
|
@@ -31081,13 +31103,14 @@
|
|
|
31081
31103
|
i0__namespace.ɵɵsetComponentScope(CaseTimelineComponent, [i2__namespace.NgIf, i2__namespace.NgSwitch, i2__namespace.NgSwitchCase, EventLogComponent, CaseHistoryComponent], [i1__namespace.RpxTranslatePipe]);
|
|
31082
31104
|
|
|
31083
31105
|
var CaseResolver = /** @class */ (function () {
|
|
31084
|
-
function CaseResolver(caseNotifier, draftService, navigationNotifierService, router, sessionStorage) {
|
|
31106
|
+
function CaseResolver(caseNotifier, draftService, navigationNotifierService, router, sessionStorage, appConfig) {
|
|
31085
31107
|
var _this = this;
|
|
31086
31108
|
this.caseNotifier = caseNotifier;
|
|
31087
31109
|
this.draftService = draftService;
|
|
31088
31110
|
this.navigationNotifierService = navigationNotifierService;
|
|
31089
31111
|
this.router = router;
|
|
31090
31112
|
this.sessionStorage = sessionStorage;
|
|
31113
|
+
this.appConfig = appConfig;
|
|
31091
31114
|
router.events.pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }))
|
|
31092
31115
|
.subscribe(function (event) {
|
|
31093
31116
|
_this.previousUrl = event.url;
|
|
@@ -31133,7 +31156,7 @@
|
|
|
31133
31156
|
else {
|
|
31134
31157
|
console.info('getAndCacheCaseView - Path B.');
|
|
31135
31158
|
return this.caseNotifier.fetchAndRefresh(cid)
|
|
31136
|
-
.pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); }))
|
|
31159
|
+
.pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); }))
|
|
31137
31160
|
.toPromise();
|
|
31138
31161
|
}
|
|
31139
31162
|
}
|
|
@@ -31146,9 +31169,9 @@
|
|
|
31146
31169
|
_this.caseNotifier.cachedCaseView = classTransformer.plainToClassFromExist(new CaseView(), caseView);
|
|
31147
31170
|
_this.caseNotifier.announceCase(_this.caseNotifier.cachedCaseView);
|
|
31148
31171
|
return _this.caseNotifier.cachedCaseView;
|
|
31149
|
-
}), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); })).toPromise();
|
|
31172
|
+
}), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); })).toPromise();
|
|
31150
31173
|
};
|
|
31151
|
-
CaseResolver.prototype.processErrorInCaseFetch = function (error) {
|
|
31174
|
+
CaseResolver.prototype.processErrorInCaseFetch = function (error, caseReference) {
|
|
31152
31175
|
console.error('!!! processErrorInCaseFetch !!!');
|
|
31153
31176
|
console.error(error);
|
|
31154
31177
|
// TODO Should be logged to remote logging infrastructure
|
|
@@ -31156,12 +31179,16 @@
|
|
|
31156
31179
|
this.router.navigate(['/search/noresults']);
|
|
31157
31180
|
return rxjs.of(null);
|
|
31158
31181
|
}
|
|
31159
|
-
console.error(error);
|
|
31160
31182
|
if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
|
|
31161
31183
|
this.router.navigate(['/list/case']);
|
|
31162
31184
|
return rxjs.of(null);
|
|
31163
31185
|
}
|
|
31164
|
-
|
|
31186
|
+
// Error 403 and enable-restricted-case-access Launch Darkly flag is enabled, navigate to restricted case access page
|
|
31187
|
+
if (error.status === 403 && this.appConfig.getEnableRestrictedCaseAccessConfig()) {
|
|
31188
|
+
this.router.navigate(["/cases/restricted-case-access/" + caseReference]);
|
|
31189
|
+
return rxjs.of(null);
|
|
31190
|
+
}
|
|
31191
|
+
if (error.status !== 401) {
|
|
31165
31192
|
this.router.navigate(['/error']);
|
|
31166
31193
|
}
|
|
31167
31194
|
this.goToDefaultPage();
|
|
@@ -31188,12 +31215,12 @@
|
|
|
31188
31215
|
CaseResolver.CASE_CREATED_MSG = 'The case has been created successfully';
|
|
31189
31216
|
CaseResolver.defaultWAPage = '/work/my-work/list';
|
|
31190
31217
|
CaseResolver.defaultPage = '/cases';
|
|
31191
|
-
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0__namespace.ɵɵinject(CaseNotifier), i0__namespace.ɵɵinject(DraftService), i0__namespace.ɵɵinject(NavigationNotifierService), i0__namespace.ɵɵinject(i1__namespace$1.Router), i0__namespace.ɵɵinject(SessionStorageService)); };
|
|
31218
|
+
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0__namespace.ɵɵinject(CaseNotifier), i0__namespace.ɵɵinject(DraftService), i0__namespace.ɵɵinject(NavigationNotifierService), i0__namespace.ɵɵinject(i1__namespace$1.Router), i0__namespace.ɵɵinject(SessionStorageService), i0__namespace.ɵɵinject(AbstractAppConfig)); };
|
|
31192
31219
|
CaseResolver.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
|
|
31193
31220
|
(function () {
|
|
31194
31221
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseResolver, [{
|
|
31195
31222
|
type: i0.Injectable
|
|
31196
|
-
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1__namespace$1.Router }, { type: SessionStorageService }]; }, null);
|
|
31223
|
+
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1__namespace$1.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null);
|
|
31197
31224
|
})();
|
|
31198
31225
|
|
|
31199
31226
|
var EventTriggerResolver = /** @class */ (function () {
|