@iapps/ng-dhis2-ui 1.3.5 → 1.3.6
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.
|
@@ -9139,7 +9139,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
9139
9139
|
case 'transfer':
|
|
9140
9140
|
return (React__default.createElement(Transfer, { filterable: true, filterPlaceholder: "Search", selected: selected, leftHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.availableOptionsLabel), rightHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.selectedOptionsLabel), options: f.options, onChange: (event) => onValueChange(event.selected) }));
|
|
9141
9141
|
case 'checkbox':
|
|
9142
|
-
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: f.id, disabled: disabled, onChange: (event) => onValueChange(event.checked), onBlur: () => checkValueUniqueness() }));
|
|
9142
|
+
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: f.id, disabled: disabled, onChange: (event) => onValueChange(event.checked ? true : null), onBlur: () => checkValueUniqueness() }));
|
|
9143
9143
|
case 'dropdown':
|
|
9144
9144
|
return (React__default.createElement(FieldSet, null,
|
|
9145
9145
|
React__default.createElement(FormFieldLabel, { field: this.field(), fieldConfig: this.fieldConfig() }),
|
|
@@ -11895,6 +11895,7 @@ class ProgramEntryFormConfig {
|
|
|
11895
11895
|
this.cancelButtonLabel = 'Cancel';
|
|
11896
11896
|
this.fieldDescriptionLabel = 'Description';
|
|
11897
11897
|
this.updateTeiOrgUnit = false;
|
|
11898
|
+
this.enableCustomFieldConfigurations = false;
|
|
11898
11899
|
Object.assign(this, config);
|
|
11899
11900
|
}
|
|
11900
11901
|
}
|
|
@@ -12981,8 +12982,10 @@ class ProgramEntryFormMetaData {
|
|
|
12981
12982
|
};
|
|
12982
12983
|
}
|
|
12983
12984
|
async #getCustomFieldConfigurations() {
|
|
12985
|
+
console.log('Fetching custom field configurations...');
|
|
12984
12986
|
try {
|
|
12985
12987
|
const response = await this.d2.httpInstance.get('dataStore/field-extensions?fields=id,fieldOptionsDependsOn,optionSet&paging=false', { useIndexDb: true });
|
|
12988
|
+
console.log('Fetching custom field configurations...', response?.data);
|
|
12986
12989
|
const responseData = response?.data;
|
|
12987
12990
|
const entries = Array.isArray(responseData)
|
|
12988
12991
|
? responseData
|
|
@@ -13012,8 +13015,9 @@ class ProgramEntryFormMetaData {
|
|
|
13012
13015
|
if (program) {
|
|
13013
13016
|
this.program = program;
|
|
13014
13017
|
// TODO FIND ANOTHER WAY TO PASS IN CUSTOM FIELD CONFIGURATIONS, AVOID TIGHT COUPLING HERE
|
|
13015
|
-
|
|
13016
|
-
|
|
13018
|
+
this.customFieldConfigurations = this.config.enableCustomFieldConfigurations === true
|
|
13019
|
+
? await this.#getCustomFieldConfigurations()
|
|
13020
|
+
: {};
|
|
13017
13021
|
if (this.config?.formFieldExtensions &&
|
|
13018
13022
|
this.config.formFieldExtensions.length > 0 &&
|
|
13019
13023
|
this.config.formFieldExtensions[0]?.optionsSourceCode) {
|