@openmrs/esm-form-engine-lib 3.1.5-pre.2090 → 3.1.5-pre.2095
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/package.json
CHANGED
|
@@ -39,9 +39,21 @@ export const FormFieldRenderer = ({ fieldId, valueAdapter, repeatOptions }: Form
|
|
|
39
39
|
const [warnings, setWarnings] = useState<ValidationResult[]>([]);
|
|
40
40
|
const [historicalValue, setHistoricalValue] = useState<ValueAndDisplay>(null);
|
|
41
41
|
const context = useFormProviderContext();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
|
|
43
|
+
// Try to get config from external module, fallback to default if not available
|
|
44
|
+
let hideUnansweredQuestionsInReadonlyForms = false;
|
|
45
|
+
try {
|
|
46
|
+
const config = useConfig({
|
|
47
|
+
externalModuleName: '@openmrs/esm-form-engine-app',
|
|
48
|
+
});
|
|
49
|
+
hideUnansweredQuestionsInReadonlyForms = config?.hideUnansweredQuestionsInReadonlyForms ?? false;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
// If external module config is not available, use default value
|
|
52
|
+
console.warn(
|
|
53
|
+
'Failed to load @openmrs/esm-form engine-app config - using hideUnansweredQuestionsInReadonlyForms=false (empty fields will be visible in readonly mode): ',
|
|
54
|
+
error,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
45
57
|
|
|
46
58
|
const {
|
|
47
59
|
methods: { control, getValues, getFieldState },
|