@iapps/ng-dhis2-ui 1.2.0 → 1.2.1
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.
|
@@ -3133,12 +3133,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
3133
3133
|
}], ctorParameters: () => [{ type: i1.NgxDhis2HttpClientService }] });
|
|
3134
3134
|
|
|
3135
3135
|
const getTrackedEntityTableData = (response, programId, pager, metaData) => {
|
|
3136
|
-
|
|
3136
|
+
const teisRaw = response.data
|
|
3137
3137
|
.trackedEntityInstances;
|
|
3138
3138
|
const teis = Array.isArray(teisRaw)
|
|
3139
3139
|
? teisRaw
|
|
3140
3140
|
: [teisRaw];
|
|
3141
|
-
const programTrackedEntityAttributes = metaData.programTrackedEntityAttributes;
|
|
3142
3141
|
const orgUnitLabel = metaData.orgUnitLabel;
|
|
3143
3142
|
const orgUnitMap = response.data
|
|
3144
3143
|
.orgUnitsMap;
|
|
@@ -3183,15 +3182,14 @@ const getTrackedEntityTableData = (response, programId, pager, metaData) => {
|
|
|
3183
3182
|
index: { value: (pager.page - 1) * pager.pageSize + idx + 1 },
|
|
3184
3183
|
};
|
|
3185
3184
|
const matchingEnrollment = tei.latestEnrollment;
|
|
3186
|
-
//let disaplayInListAttributes = metaData.displayInListTrackedEntityAttributes;
|
|
3187
3185
|
let attributesData = matchingEnrollment.attributes;
|
|
3188
|
-
|
|
3186
|
+
const dataElementsData = matchingEnrollment.events.flatMap((event) => event.dataValues);
|
|
3189
3187
|
attributesData = attributesData.map((attr) => {
|
|
3190
3188
|
if (attr?.valueType?.toLowerCase() === 'date') {
|
|
3191
3189
|
try {
|
|
3192
3190
|
return {
|
|
3193
3191
|
...attr,
|
|
3194
|
-
value: format(parse$1(attr.value, 'yyyy-MM-dd', new Date()), 'dd
|
|
3192
|
+
value: format(parse$1(attr.value, 'yyyy-MM-dd', new Date()), 'dd/MM/yyyy'),
|
|
3195
3193
|
};
|
|
3196
3194
|
}
|
|
3197
3195
|
catch {
|
|
@@ -3226,6 +3224,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData) => {
|
|
|
3226
3224
|
row['orgUnit'] = {
|
|
3227
3225
|
value: orgUnitMap?.get(matchingEnrollment.orgUnit) || '-',
|
|
3228
3226
|
};
|
|
3227
|
+
row['responseData'] = { value: tei.toObject() };
|
|
3229
3228
|
return row;
|
|
3230
3229
|
});
|
|
3231
3230
|
return {
|
|
@@ -3453,9 +3452,13 @@ const TableCell = ({ cell, getTextColorFromBackGround, }) => {
|
|
|
3453
3452
|
const TableRow = ({ row, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }) => (React__default.createElement(DataTableRow, { key: row.index.value }, columns.map((col) => {
|
|
3454
3453
|
if (col.key === 'actions') {
|
|
3455
3454
|
return (React__default.createElement(DataTableCell, { key: col.key }, actionOptions && (React__default.createElement(DataTableActions, { actionOptions: actionOptions, actionOptionOrientation: actionOptionOrientation, onClick: (option) => {
|
|
3455
|
+
const data = row['responseData']?.['value'];
|
|
3456
3456
|
if (option.onClick)
|
|
3457
|
-
option.onClick(
|
|
3458
|
-
actionSelected.emit({
|
|
3457
|
+
option.onClick(data);
|
|
3458
|
+
actionSelected.emit({
|
|
3459
|
+
action: option.label,
|
|
3460
|
+
data,
|
|
3461
|
+
});
|
|
3459
3462
|
} }))));
|
|
3460
3463
|
}
|
|
3461
3464
|
return (React__default.createElement(TableCell, { key: col.key, cell: row[col.key], getTextColorFromBackGround: getTextColorFromBackGround }));
|
|
@@ -3695,13 +3698,13 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3695
3698
|
constructor() {
|
|
3696
3699
|
super(...arguments);
|
|
3697
3700
|
this.actionOptionOrientation = 'DROPDOWN';
|
|
3698
|
-
this.actionSelected = new EventEmitter();
|
|
3699
|
-
this.reactStateUpdaters = null;
|
|
3700
|
-
this.approvalSelected = new EventEmitter();
|
|
3701
3701
|
this.isButtonLoading = false;
|
|
3702
3702
|
this.filterRootOrgUnit = false;
|
|
3703
3703
|
this.showFilters = false;
|
|
3704
3704
|
this.isOptionSetNameVisible = false;
|
|
3705
|
+
this.actionSelected = new EventEmitter();
|
|
3706
|
+
this.approvalSelected = new EventEmitter();
|
|
3707
|
+
this.reactStateUpdaters = null;
|
|
3705
3708
|
this.setReactStateUpdaters = (updaters) => {
|
|
3706
3709
|
this.reactStateUpdaters = updaters;
|
|
3707
3710
|
};
|
|
@@ -3828,7 +3831,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3828
3831
|
else {
|
|
3829
3832
|
//TODO: TO IMPLEMEMNT EVENT QUERY FOR FILTERING EVENTS WHEN PROGRAM STAGE IS PASSED OR DEALING WITH EVENT PROGRAM USING TRACKER SDK QUERY
|
|
3830
3833
|
}
|
|
3831
|
-
;
|
|
3832
3834
|
}, [
|
|
3833
3835
|
metaData,
|
|
3834
3836
|
programIdState,
|
|
@@ -3997,10 +3999,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
3997
3999
|
type: Input
|
|
3998
4000
|
}], ouMode: [{
|
|
3999
4001
|
type: Input
|
|
4000
|
-
}], actionSelected: [{
|
|
4001
|
-
type: Output
|
|
4002
|
-
}], approvalSelected: [{
|
|
4003
|
-
type: Output
|
|
4004
4002
|
}], isButtonLoading: [{
|
|
4005
4003
|
type: Input
|
|
4006
4004
|
}], buttonFilter: [{
|
|
@@ -4011,6 +4009,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
4011
4009
|
type: Input
|
|
4012
4010
|
}], isOptionSetNameVisible: [{
|
|
4013
4011
|
type: Input
|
|
4012
|
+
}], actionSelected: [{
|
|
4013
|
+
type: Output
|
|
4014
|
+
}], approvalSelected: [{
|
|
4015
|
+
type: Output
|
|
4014
4016
|
}] } });
|
|
4015
4017
|
|
|
4016
4018
|
class LineListModule {
|