@iapps/ng-dhis2-ui 1.2.163 → 1.2.165
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.
|
@@ -4310,6 +4310,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
|
|
|
4310
4310
|
? teisRaw
|
|
4311
4311
|
: [teisRaw];
|
|
4312
4312
|
const orgUnitLabel = metaData.orgUnitLabel;
|
|
4313
|
+
const incidentDateLabel = metaData.incidentDateLabel;
|
|
4313
4314
|
const orgUnitMap = response.data
|
|
4314
4315
|
.orgUnitsMap;
|
|
4315
4316
|
const attributeColumns = metaData.displayInListTrackedEntityAttributes
|
|
@@ -4369,6 +4370,14 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
|
|
|
4369
4370
|
label: orgUnitLabel || 'Registering unit',
|
|
4370
4371
|
key: 'orgUnit',
|
|
4371
4372
|
},
|
|
4373
|
+
...(metaData.displayIncidentDate
|
|
4374
|
+
? [
|
|
4375
|
+
{
|
|
4376
|
+
label: incidentDateLabel || 'Incident date',
|
|
4377
|
+
key: 'incidentDate',
|
|
4378
|
+
},
|
|
4379
|
+
]
|
|
4380
|
+
: []),
|
|
4372
4381
|
...attributeColumns,
|
|
4373
4382
|
...dataElementColumns,
|
|
4374
4383
|
];
|
|
@@ -4468,6 +4477,11 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
|
|
|
4468
4477
|
const orgUnitName = orgUnitMap?.get(orgUnitId) || '-';
|
|
4469
4478
|
row['orgUnitId'] = { value: orgUnitId || '-' };
|
|
4470
4479
|
row['orgUnit'] = { value: orgUnitName };
|
|
4480
|
+
row['incidentDate'] = {
|
|
4481
|
+
value: enrollment.incidentDate
|
|
4482
|
+
? formatDate(enrollment.incidentDate)
|
|
4483
|
+
: '-',
|
|
4484
|
+
};
|
|
4471
4485
|
const teiObject = typeof tei.toObject === 'function' ? tei.toObject() : null;
|
|
4472
4486
|
row['responseData'] = {
|
|
4473
4487
|
value: teiObject || null,
|
|
@@ -7403,7 +7417,7 @@ function getNumericLevelForSemanticLevel(level, keywordToLevel = DEFAULT_KEYWORD
|
|
|
7403
7417
|
return keyword ? keywordToLevel[keyword] : undefined;
|
|
7404
7418
|
}
|
|
7405
7419
|
const OrgUnitFormField = (props) => {
|
|
7406
|
-
const { onSelectOrgUnit, label, required, selected, disabled, key, field, customOrgUnitRoots, } = props;
|
|
7420
|
+
const { onSelectOrgUnit, label, required, selected, disabled, key, field, customOrgUnitRoots, orgUnitRoots, } = props;
|
|
7407
7421
|
const d2 = window?.d2Web;
|
|
7408
7422
|
const classes = useDynamicStyles$2(orgUnitFieldStyles);
|
|
7409
7423
|
const config = useMemo(() => d2.systemInfo?.toInitObject(), []);
|
|
@@ -7673,11 +7687,15 @@ const OrgUnitFormField = (props) => {
|
|
|
7673
7687
|
}
|
|
7674
7688
|
return configuredRootInfo;
|
|
7675
7689
|
}
|
|
7690
|
+
if (orgUnitRoots?.length) {
|
|
7691
|
+
return orgUnitRoots.map((id) => ({ id }));
|
|
7692
|
+
}
|
|
7676
7693
|
return d2.currentUser?.organisationUnits || [];
|
|
7677
7694
|
}, [
|
|
7678
7695
|
useCustomRoots,
|
|
7679
7696
|
configuredRootsLoading,
|
|
7680
7697
|
configuredRootInfo,
|
|
7698
|
+
orgUnitRoots,
|
|
7681
7699
|
d2.currentUser,
|
|
7682
7700
|
]);
|
|
7683
7701
|
const getExpandedItems = () => {
|
|
@@ -9157,7 +9175,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
9157
9175
|
case 'textarea':
|
|
9158
9176
|
return (React__default.createElement(TextAreaField, { error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, required: f.required, name: f.id, disabled: disabled, label: this.label(), rows: 5, placeholder: this.placeholder(), value: value, onChange: (event) => onValueChange(event.value), onBlur: () => checkValueUniqueness() }));
|
|
9159
9177
|
case 'org-unit':
|
|
9160
|
-
return (React__default.createElement(OrgUnitFormField, { label: this.label(), key: f.id, field: f.id, required: f.required, disabled: disabled, customOrgUnitRoots: this.customOrgUnitRoots(), onSelectOrgUnit: (selectedOrgUnit) => onValueChange(selectedOrgUnit), selected: value }));
|
|
9178
|
+
return (React__default.createElement(OrgUnitFormField, { label: this.label(), key: f.id, field: f.id, required: f.required, disabled: disabled, customOrgUnitRoots: this.customOrgUnitRoots(), orgUnitRoots: f.extension?.orgUnitRoots, onSelectOrgUnit: (selectedOrgUnit) => onValueChange(selectedOrgUnit), selected: value }));
|
|
9161
9179
|
case 'transfer':
|
|
9162
9180
|
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) }));
|
|
9163
9181
|
case 'checkbox':
|