commons-shared-web-ui 0.0.70 → 0.0.71
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.
|
@@ -5831,6 +5831,15 @@ class SmartFormComponent {
|
|
|
5831
5831
|
};
|
|
5832
5832
|
if (visibilityExpression)
|
|
5833
5833
|
areaTypeField['visibilityExpression'] = visibilityExpression;
|
|
5834
|
+
// Area Type is synthetic — it has no single MDM class code of its own to read a
|
|
5835
|
+
// `required` override from, unlike every other level built via the `nodeOvr['required']`
|
|
5836
|
+
// check above. Field Configuration can only address it indirectly, by marking each
|
|
5837
|
+
// branch child (e.g. Urban/Rural) required instead — so derive Area Type's own
|
|
5838
|
+
// required-ness from whether any of its branch children were marked required.
|
|
5839
|
+
if (children.some(c => !!(cfg.nodes[c] || {})['required'])) {
|
|
5840
|
+
areaTypeField['required'] = true;
|
|
5841
|
+
areaTypeField['errorMessage'] = `Please select ${areaTypeField.label.toLowerCase()}`;
|
|
5842
|
+
}
|
|
5834
5843
|
fields.push(areaTypeField);
|
|
5835
5844
|
// Skip structural branch-type nodes (e.g. RURAL, URABN) — they carry no MDM data.
|
|
5836
5845
|
// Walk their descendants with `fieldName` (the linear parent before the fork, e.g. State)
|