@hmcts/ccd-case-ui-toolkit 7.4.25-5516 → 7.4.25-exui-5450-rc2
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.
|
@@ -10819,6 +10819,62 @@ class ValidPageListCaseFieldsService {
|
|
|
10819
10819
|
type: Injectable
|
|
10820
10820
|
}], () => [{ type: FieldsUtils }], null); })();
|
|
10821
10821
|
|
|
10822
|
+
/** Uses current form-control visibility and the configured retention policy. */
|
|
10823
|
+
class HiddenFieldValues {
|
|
10824
|
+
static clearHiddenValues(data, control, parentHidden = false, collectionItem = false) {
|
|
10825
|
+
if (!control || data === null || data === undefined) {
|
|
10826
|
+
return data;
|
|
10827
|
+
}
|
|
10828
|
+
const field = control.caseField;
|
|
10829
|
+
const displayContext = field?.display_context?.toUpperCase();
|
|
10830
|
+
if (displayContext === 'READONLY' || displayContext === 'HIDDEN' ||
|
|
10831
|
+
displayContext === 'HIDDEN_TEMP' || field?.id === 'caseLinks') {
|
|
10832
|
+
return data;
|
|
10833
|
+
}
|
|
10834
|
+
const hidden = parentHidden || field?.hidden === true;
|
|
10835
|
+
if (hidden && field && !collectionItem) {
|
|
10836
|
+
if (!field.retain_hidden_value) {
|
|
10837
|
+
return control instanceof FormArray ? [] : null;
|
|
10838
|
+
}
|
|
10839
|
+
const hasComplexChildren = field.field_type?.type === 'Complex' ||
|
|
10840
|
+
(field.field_type?.type === 'Collection' && field.field_type.collection_field_type?.type === 'Complex');
|
|
10841
|
+
if (!hasComplexChildren) {
|
|
10842
|
+
// Documents, lists and other composite controls retain their whole value.
|
|
10843
|
+
return data;
|
|
10844
|
+
}
|
|
10845
|
+
// Complex children have their own retention settings; they do not inherit Yes.
|
|
10846
|
+
}
|
|
10847
|
+
if (control instanceof FormArray) {
|
|
10848
|
+
return this.clearCollectionValues(data, control, hidden);
|
|
10849
|
+
}
|
|
10850
|
+
if (control instanceof FormGroup) {
|
|
10851
|
+
const result = { ...data };
|
|
10852
|
+
Object.keys(result).forEach((key) => {
|
|
10853
|
+
result[key] = this.clearHiddenValues(result[key], control.controls[key], hidden);
|
|
10854
|
+
});
|
|
10855
|
+
return result;
|
|
10856
|
+
}
|
|
10857
|
+
return data;
|
|
10858
|
+
}
|
|
10859
|
+
static clearCollectionValues(data, control, hidden) {
|
|
10860
|
+
if (!Array.isArray(data)) {
|
|
10861
|
+
return data;
|
|
10862
|
+
}
|
|
10863
|
+
return data.map((item, index) => {
|
|
10864
|
+
const row = control.at(index);
|
|
10865
|
+
const valueControl = row instanceof FormGroup ? row.controls.value : undefined;
|
|
10866
|
+
if (valueControl && item && typeof item === 'object' && Object.hasOwn(item, 'value')) {
|
|
10867
|
+
return {
|
|
10868
|
+
...item,
|
|
10869
|
+
// The value group is a collection-item container, not another configurable case field.
|
|
10870
|
+
value: this.clearHiddenValues(item.value, valueControl, hidden, valueControl instanceof FormGroup)
|
|
10871
|
+
};
|
|
10872
|
+
}
|
|
10873
|
+
return this.clearHiddenValues(item, row, hidden);
|
|
10874
|
+
});
|
|
10875
|
+
}
|
|
10876
|
+
}
|
|
10877
|
+
|
|
10822
10878
|
function CaseEditComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
10823
10879
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
10824
10880
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
|
|
@@ -11080,8 +11136,11 @@ class CaseEditComponent {
|
|
|
11080
11136
|
return form.value.event.id;
|
|
11081
11137
|
}
|
|
11082
11138
|
generateCaseEventData({ eventTrigger, form }) {
|
|
11083
|
-
|
|
11139
|
+
let formData = this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields);
|
|
11084
11140
|
this.formValueService.sanitiseDynamicLists(eventTrigger.case_fields, { data: formData });
|
|
11141
|
+
if (!this.isCaseFlagSubmission) {
|
|
11142
|
+
formData = HiddenFieldValues.clearHiddenValues(formData, form.get('data'));
|
|
11143
|
+
}
|
|
11085
11144
|
const caseEventData = {
|
|
11086
11145
|
data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(formData, this.isCaseFlagSubmission)),
|
|
11087
11146
|
event: form.value.event
|
|
@@ -11407,7 +11466,7 @@ class CaseEditComponent {
|
|
|
11407
11466
|
}], submitted: [{
|
|
11408
11467
|
type: Output
|
|
11409
11468
|
}] }); })();
|
|
11410
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber:
|
|
11469
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 40 }); })();
|
|
11411
11470
|
|
|
11412
11471
|
const EVENT_START_FIRST_PAGE_REDIRECT = 'eventStartFirstPageRedirect';
|
|
11413
11472
|
function convertNonASCIICharacter(character) {
|
|
@@ -13301,6 +13360,9 @@ class CaseEditPageComponent {
|
|
|
13301
13360
|
const formFields = this.formValueService.filterCurrentPageFields(caseFields, formValue);
|
|
13302
13361
|
// Sort out the dynamic lists.
|
|
13303
13362
|
this.formValueService.sanitiseDynamicLists(caseFields, formFields);
|
|
13363
|
+
if (!this.caseEdit.isCaseFlagSubmission) {
|
|
13364
|
+
formFields.data = HiddenFieldValues.clearHiddenValues(formFields.data, this.editForm.get('data'));
|
|
13365
|
+
}
|
|
13304
13366
|
// Get hold of the CaseEventData.
|
|
13305
13367
|
const caseEventData = this.formValueService.sanitise(formFields);
|
|
13306
13368
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
@@ -13404,7 +13466,7 @@ class CaseEditPageComponent {
|
|
|
13404
13466
|
type: ViewChildren,
|
|
13405
13467
|
args: [CaseEditFormComponent]
|
|
13406
13468
|
}] }); })();
|
|
13407
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber:
|
|
13469
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 39 }); })();
|
|
13408
13470
|
|
|
13409
13471
|
class CallbackErrorsContext {
|
|
13410
13472
|
triggerText;
|