@hmcts/ccd-case-ui-toolkit 7.0.32 → 7.0.33-dynamic-multi-list-fix
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/shared/components/palette/yes-no/read-yes-no-field.component.mjs +3 -3
- package/esm2020/lib/shared/domain/definition/case-field.model.mjs +4 -2
- package/esm2020/lib/shared/services/form/field-type-sanitiser.mjs +13 -2
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +21 -4
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +17 -4
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/domain/definition/case-field.model.d.ts.map +1 -1
- package/lib/shared/services/form/field-type-sanitiser.d.ts +1 -0
- package/lib/shared/services/form/field-type-sanitiser.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3043,7 +3043,9 @@ class CaseField {
|
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
3045
|
set list_items(items) {
|
|
3046
|
-
this._list_items
|
|
3046
|
+
if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
|
|
3047
|
+
this._list_items = items;
|
|
3048
|
+
}
|
|
3047
3049
|
}
|
|
3048
3050
|
get dateTimeEntryFormat() {
|
|
3049
3051
|
if (this.isComplexDisplay()) {
|
|
@@ -5216,7 +5218,8 @@ class FieldTypeSanitiser {
|
|
|
5216
5218
|
if (!data || !caseFields) {
|
|
5217
5219
|
return;
|
|
5218
5220
|
}
|
|
5219
|
-
caseFields.
|
|
5221
|
+
caseFields = this.ensureDynamicMultiSelectListPopulated(caseFields);
|
|
5222
|
+
caseFields.forEach((caseField) => {
|
|
5220
5223
|
// tslint:disable-next-line:switch-default
|
|
5221
5224
|
switch (caseField.field_type.type) {
|
|
5222
5225
|
case FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_MULTISELECT_LIST:
|
|
@@ -5239,6 +5242,16 @@ class FieldTypeSanitiser {
|
|
|
5239
5242
|
}
|
|
5240
5243
|
});
|
|
5241
5244
|
}
|
|
5245
|
+
ensureDynamicMultiSelectListPopulated(caseFields) {
|
|
5246
|
+
return caseFields.map((field) => {
|
|
5247
|
+
if (field.field_type.type !== 'Complex') {
|
|
5248
|
+
return field;
|
|
5249
|
+
}
|
|
5250
|
+
const complexFieldsUpdated = field.field_type.complex_fields.map((complexField) => complexField.field_type.type === FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_MULTISELECT_LIST && complexField.display_context !== 'HIDDEN' && field._value?.[complexField.id]
|
|
5251
|
+
? { ...complexField, list_items: field._value[complexField.id]?.list_items } : complexField);
|
|
5252
|
+
return { ...field, field_type: { ...field.field_type, complex_fields: complexFieldsUpdated } };
|
|
5253
|
+
});
|
|
5254
|
+
}
|
|
5242
5255
|
convertArrayToDynamicListOutput(field, data) {
|
|
5243
5256
|
const values = data[field.id];
|
|
5244
5257
|
if (Array.isArray(values)) {
|
|
@@ -20439,13 +20452,13 @@ ReadYesNoFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Rea
|
|
|
20439
20452
|
i0.ɵɵelementEnd();
|
|
20440
20453
|
} if (rf & 2) {
|
|
20441
20454
|
i0.ɵɵadvance(1);
|
|
20442
|
-
i0.ɵɵtextInterpolate(ctx.formattedValue ? i0.ɵɵpipeBind3(2, 1, ctx.
|
|
20455
|
+
i0.ɵɵtextInterpolate(ctx.formattedValue ? i0.ɵɵpipeBind3(2, 1, ctx.formattedValue, null, ctx.formattedValue) : null);
|
|
20443
20456
|
} }, dependencies: [i1.RpxTranslatePipe], encapsulation: 2 });
|
|
20444
20457
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadYesNoFieldComponent, [{
|
|
20445
20458
|
type: Component,
|
|
20446
20459
|
args: [{
|
|
20447
20460
|
selector: 'ccd-read-yes-no-field',
|
|
20448
|
-
template: `<span class="text-16">{{formattedValue ? (
|
|
20461
|
+
template: `<span class="text-16">{{formattedValue ? (formattedValue | rpxTranslate : null : formattedValue) : null}}</span>`
|
|
20449
20462
|
}]
|
|
20450
20463
|
}], function () { return [{ type: YesNoService }]; }, null); })();
|
|
20451
20464
|
|