@dhis2/analytics 26.6.7 → 26.6.9
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.
|
@@ -28,7 +28,8 @@ const OrgUnitDimension = _ref => {
|
|
|
28
28
|
hideGroupSelect,
|
|
29
29
|
hideLevelSelect,
|
|
30
30
|
hideUserOrgUnits,
|
|
31
|
-
warning
|
|
31
|
+
warning,
|
|
32
|
+
displayNameProp
|
|
32
33
|
} = _ref;
|
|
33
34
|
const [ouLevels, setOuLevels] = (0, _react.useState)([]);
|
|
34
35
|
const [ouGroups, setOuGroups] = (0, _react.useState)([]);
|
|
@@ -71,12 +72,12 @@ const OrgUnitDimension = _ref => {
|
|
|
71
72
|
setOuLevels(result);
|
|
72
73
|
};
|
|
73
74
|
const doFetchOuGroups = async () => {
|
|
74
|
-
const result = await (0, _organisationUnits.apiFetchOrganisationUnitGroups)(dataEngine);
|
|
75
|
+
const result = await (0, _organisationUnits.apiFetchOrganisationUnitGroups)(dataEngine, displayNameProp);
|
|
75
76
|
setOuGroups(result);
|
|
76
77
|
};
|
|
77
78
|
!hideLevelSelect && doFetchOuLevels();
|
|
78
79
|
!hideGroupSelect && doFetchOuGroups();
|
|
79
|
-
}, [dataEngine, hideLevelSelect, hideGroupSelect]);
|
|
80
|
+
}, [dataEngine, hideLevelSelect, hideGroupSelect, displayNameProp]);
|
|
80
81
|
const onLevelChange = ids => {
|
|
81
82
|
const items = ids.map(id => ({
|
|
82
83
|
id: _index2.ouIdHelper.addLevelPrefix(id),
|
|
@@ -261,6 +262,7 @@ OrgUnitDimension.defaultProps = {
|
|
|
261
262
|
hideUserOrgUnits: false
|
|
262
263
|
};
|
|
263
264
|
OrgUnitDimension.propTypes = {
|
|
265
|
+
displayNameProp: _propTypes.default.string,
|
|
264
266
|
hideGroupSelect: _propTypes.default.bool,
|
|
265
267
|
hideLevelSelect: _propTypes.default.bool,
|
|
266
268
|
hideUserOrgUnits: _propTypes.default.bool,
|
|
@@ -372,7 +372,15 @@ class PivotTableEngine {
|
|
|
372
372
|
return undefined;
|
|
373
373
|
}
|
|
374
374
|
const cellValue = this.data[row][column];
|
|
375
|
-
if (
|
|
375
|
+
if (!cellValue) {
|
|
376
|
+
// Empty cell
|
|
377
|
+
// The cell still needs to get the valueType to render correctly 0 and cumulative values
|
|
378
|
+
return {
|
|
379
|
+
valueType: _valueTypes.VALUE_TYPE_NUMBER,
|
|
380
|
+
totalAggregationType: _pivotTableConstants.AGGREGATE_TYPE_SUM
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
if (!Array.isArray(cellValue)) {
|
|
376
384
|
// This is a total cell
|
|
377
385
|
return {
|
|
378
386
|
valueType: cellValue.valueType,
|
|
@@ -399,11 +407,6 @@ class PivotTableEngine {
|
|
|
399
407
|
};
|
|
400
408
|
}
|
|
401
409
|
|
|
402
|
-
// Empty cell
|
|
403
|
-
// The cell still needs to get the valueType to render correctly 0 and cumulative values
|
|
404
|
-
//
|
|
405
|
-
// OR
|
|
406
|
-
//
|
|
407
410
|
// Data is in Filter
|
|
408
411
|
// TODO : This assumes the server ignores text types, we should confirm this is the case
|
|
409
412
|
return {
|
|
@@ -19,7 +19,8 @@ const OrgUnitDimension = _ref => {
|
|
|
19
19
|
hideGroupSelect,
|
|
20
20
|
hideLevelSelect,
|
|
21
21
|
hideUserOrgUnits,
|
|
22
|
-
warning
|
|
22
|
+
warning,
|
|
23
|
+
displayNameProp
|
|
23
24
|
} = _ref;
|
|
24
25
|
const [ouLevels, setOuLevels] = useState([]);
|
|
25
26
|
const [ouGroups, setOuGroups] = useState([]);
|
|
@@ -62,12 +63,12 @@ const OrgUnitDimension = _ref => {
|
|
|
62
63
|
setOuLevels(result);
|
|
63
64
|
};
|
|
64
65
|
const doFetchOuGroups = async () => {
|
|
65
|
-
const result = await apiFetchOrganisationUnitGroups(dataEngine);
|
|
66
|
+
const result = await apiFetchOrganisationUnitGroups(dataEngine, displayNameProp);
|
|
66
67
|
setOuGroups(result);
|
|
67
68
|
};
|
|
68
69
|
!hideLevelSelect && doFetchOuLevels();
|
|
69
70
|
!hideGroupSelect && doFetchOuGroups();
|
|
70
|
-
}, [dataEngine, hideLevelSelect, hideGroupSelect]);
|
|
71
|
+
}, [dataEngine, hideLevelSelect, hideGroupSelect, displayNameProp]);
|
|
71
72
|
const onLevelChange = ids => {
|
|
72
73
|
const items = ids.map(id => ({
|
|
73
74
|
id: ouIdHelper.addLevelPrefix(id),
|
|
@@ -252,6 +253,7 @@ OrgUnitDimension.defaultProps = {
|
|
|
252
253
|
hideUserOrgUnits: false
|
|
253
254
|
};
|
|
254
255
|
OrgUnitDimension.propTypes = {
|
|
256
|
+
displayNameProp: PropTypes.string,
|
|
255
257
|
hideGroupSelect: PropTypes.bool,
|
|
256
258
|
hideLevelSelect: PropTypes.bool,
|
|
257
259
|
hideUserOrgUnits: PropTypes.bool,
|
|
@@ -365,7 +365,15 @@ export class PivotTableEngine {
|
|
|
365
365
|
return undefined;
|
|
366
366
|
}
|
|
367
367
|
const cellValue = this.data[row][column];
|
|
368
|
-
if (
|
|
368
|
+
if (!cellValue) {
|
|
369
|
+
// Empty cell
|
|
370
|
+
// The cell still needs to get the valueType to render correctly 0 and cumulative values
|
|
371
|
+
return {
|
|
372
|
+
valueType: VALUE_TYPE_NUMBER,
|
|
373
|
+
totalAggregationType: AGGREGATE_TYPE_SUM
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
if (!Array.isArray(cellValue)) {
|
|
369
377
|
// This is a total cell
|
|
370
378
|
return {
|
|
371
379
|
valueType: cellValue.valueType,
|
|
@@ -392,11 +400,6 @@ export class PivotTableEngine {
|
|
|
392
400
|
};
|
|
393
401
|
}
|
|
394
402
|
|
|
395
|
-
// Empty cell
|
|
396
|
-
// The cell still needs to get the valueType to render correctly 0 and cumulative values
|
|
397
|
-
//
|
|
398
|
-
// OR
|
|
399
|
-
//
|
|
400
403
|
// Data is in Filter
|
|
401
404
|
// TODO : This assumes the server ignores text types, we should confirm this is the case
|
|
402
405
|
return {
|