@dhis2/analytics 21.0.0-alpha.3 → 21.0.2

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.
Files changed (208) hide show
  1. package/CHANGELOG.md +2789 -0
  2. package/build/cjs/__demo__/Filter.stories.js +2 -2
  3. package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
  4. package/build/cjs/__demo__/OpenFileDialog.stories.js +1 -1
  5. package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
  6. package/build/cjs/__demo__/PivotTable.stories.js +2 -2
  7. package/build/cjs/api/analytics/AnalyticsBase.js +1 -1
  8. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -1
  9. package/build/cjs/api/analytics/AnalyticsRequestBase.js +3 -3
  10. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  11. package/build/cjs/api/analytics/AnalyticsResponse.js +2 -2
  12. package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +1 -11
  13. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  14. package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  15. package/build/cjs/api/analytics/utils.js +1 -1
  16. package/build/cjs/api/dimensions.js +37 -37
  17. package/build/cjs/api/organisationUnits.js +5 -5
  18. package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +228 -0
  19. package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +13 -0
  20. package/build/cjs/components/DataDimension/DataTypesSelector.js +3 -3
  21. package/build/cjs/components/DataDimension/DetailSelector.js +2 -2
  22. package/build/cjs/components/DataDimension/GroupSelector.js +9 -9
  23. package/build/cjs/components/DataDimension/ItemSelector.js +19 -19
  24. package/build/cjs/components/DataDimension/MetricSelector.js +3 -3
  25. package/build/cjs/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  26. package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -1
  27. package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -1
  28. package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -1
  29. package/build/cjs/components/DimensionMenu.js +10 -10
  30. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +2 -2
  31. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +5 -5
  32. package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +2 -2
  33. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +10 -10
  34. package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  35. package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  36. package/build/cjs/components/DynamicDimension/DynamicDimension.js +4 -4
  37. package/build/cjs/components/DynamicDimension/ItemSelector.js +8 -8
  38. package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  39. package/build/cjs/components/FileMenu/DeleteDialog.js +2 -2
  40. package/build/cjs/components/FileMenu/FileMenu.js +5 -5
  41. package/build/cjs/components/FileMenu/FileMenu.styles.js +2 -2
  42. package/build/cjs/components/FileMenu/GetLinkDialog.js +1 -1
  43. package/build/cjs/components/FileMenu/RenameDialog.js +2 -2
  44. package/build/cjs/components/FileMenu/SaveAsDialog.js +2 -2
  45. package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  46. package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  47. package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  48. package/build/cjs/components/FileMenu/utils.js +3 -3
  49. package/build/cjs/components/Filter/Filter.js +1 -1
  50. package/build/cjs/components/Filter/styles/Filter.style.js +1 -1
  51. package/build/cjs/components/LegendKey/LegendKey.js +9 -9
  52. package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -1
  53. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -2
  54. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +21 -21
  55. package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  56. package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  57. package/build/cjs/components/Options/VisualizationOptions.js +2 -2
  58. package/build/cjs/components/Options/styles/VisualizationOptions.style.js +10 -10
  59. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +23 -22
  60. package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +2 -2
  61. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  62. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +4 -4
  63. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +11 -11
  64. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  65. package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  66. package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  67. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  68. package/build/cjs/components/PivotTable/PivotTable.js +2 -2
  69. package/build/cjs/components/PivotTable/PivotTableCell.js +3 -3
  70. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  71. package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -2
  72. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +2 -2
  73. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +2 -2
  74. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +4 -4
  75. package/build/cjs/components/PivotTable/PivotTableValueCell.js +2 -2
  76. package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -3
  77. package/build/cjs/components/TransferOption.js +5 -5
  78. package/build/cjs/components/styles/DimensionSelector.style.js +1 -1
  79. package/build/cjs/components/styles/TransferOption.style.js +1 -1
  80. package/build/cjs/index.js +10 -2
  81. package/build/cjs/locales/en/translations.json +18 -2
  82. package/build/cjs/modules/axis.js +1 -1
  83. package/build/cjs/modules/layoutUiRules/rules.js +1 -1
  84. package/build/cjs/modules/list.js +25 -0
  85. package/build/cjs/modules/ouIdHelper/index.js +2 -2
  86. package/build/cjs/modules/pivotTable/PivotTableEngine.js +3 -3
  87. package/build/cjs/modules/pivotTable/measureText.js +1 -1
  88. package/build/cjs/modules/visTypes.js +1 -1
  89. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  90. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  91. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  92. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
  93. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +8 -19
  94. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  95. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  96. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  97. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  98. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  99. package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  100. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  101. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  102. package/build/cjs/visualizations/config/generators/dhis/singleValue.js +5 -5
  103. package/build/cjs/visualizations/config/index.js +3 -3
  104. package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  105. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  106. package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  107. package/build/cjs/visualizations/store/index.js +2 -2
  108. package/build/cjs/visualizations/util/__tests__/getFilterText.spec.js +1 -1
  109. package/build/cjs/visualizations/util/axisId.js +1 -1
  110. package/build/cjs/visualizations/util/getFilterText.js +4 -12
  111. package/build/es/__demo__/OpenFileDialog.stories.js +1 -1
  112. package/build/es/api/analytics/AnalyticsBase.js +1 -1
  113. package/build/es/api/analytics/AnalyticsRequest.js +1 -1
  114. package/build/es/api/analytics/AnalyticsRequestBase.js +3 -3
  115. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  116. package/build/es/api/analytics/AnalyticsResponse.js +2 -2
  117. package/build/es/api/analytics/__tests__/AnalyticsAggregate.spec.js +1 -11
  118. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  119. package/build/es/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  120. package/build/es/api/analytics/utils.js +1 -1
  121. package/build/es/api/dimensions.js +39 -39
  122. package/build/es/api/organisationUnits.js +5 -5
  123. package/build/es/components/AboutAOUnit/AboutAOUnit.js +204 -0
  124. package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +4 -0
  125. package/build/es/components/DataDimension/DataTypesSelector.js +3 -3
  126. package/build/es/components/DataDimension/DetailSelector.js +2 -2
  127. package/build/es/components/DataDimension/GroupSelector.js +7 -7
  128. package/build/es/components/DataDimension/ItemSelector.js +17 -17
  129. package/build/es/components/DataDimension/MetricSelector.js +3 -3
  130. package/build/es/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  131. package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
  132. package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
  133. package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
  134. package/build/es/components/DimensionMenu.js +10 -10
  135. package/build/es/components/DimensionsPanel/List/DimensionItem.js +3 -3
  136. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  137. package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  138. package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  139. package/build/es/components/DynamicDimension/DynamicDimension.js +4 -4
  140. package/build/es/components/DynamicDimension/ItemSelector.js +6 -6
  141. package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  142. package/build/es/components/FileMenu/FileMenu.js +3 -3
  143. package/build/es/components/FileMenu/FileMenu.styles.js +2 -2
  144. package/build/es/components/FileMenu/GetLinkDialog.js +1 -1
  145. package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  146. package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  147. package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  148. package/build/es/components/FileMenu/utils.js +3 -3
  149. package/build/es/components/Filter/Filter.js +1 -1
  150. package/build/es/components/Filter/styles/Filter.style.js +1 -1
  151. package/build/es/components/LegendKey/LegendKey.js +9 -9
  152. package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
  153. package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -2
  154. package/build/es/components/OpenFileDialog/OpenFileDialog.js +19 -19
  155. package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  156. package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  157. package/build/es/components/Options/styles/VisualizationOptions.style.js +10 -10
  158. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +20 -20
  159. package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +2 -2
  160. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  161. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +8 -8
  162. package/build/es/components/PeriodDimension/PeriodTransfer.js +9 -9
  163. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  164. package/build/es/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  165. package/build/es/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  166. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  167. package/build/es/components/PivotTable/PivotTableCell.js +3 -3
  168. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  169. package/build/es/components/PivotTable/PivotTableContainer.js +2 -2
  170. package/build/es/components/PivotTable/PivotTableSortIcon.js +2 -2
  171. package/build/es/components/PivotTable/PivotTableTitleRow.js +2 -2
  172. package/build/es/components/PivotTable/styles/PivotTable.style.js +3 -3
  173. package/build/es/components/TransferOption.js +17 -17
  174. package/build/es/components/styles/DimensionSelector.style.js +1 -1
  175. package/build/es/components/styles/TransferOption.style.js +1 -1
  176. package/build/es/index.js +2 -1
  177. package/build/es/locales/en/translations.json +18 -2
  178. package/build/es/modules/axis.js +1 -1
  179. package/build/es/modules/layoutUiRules/rules.js +1 -1
  180. package/build/es/modules/list.js +13 -0
  181. package/build/es/modules/ouIdHelper/index.js +2 -2
  182. package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
  183. package/build/es/modules/pivotTable/measureText.js +1 -1
  184. package/build/es/modules/visTypes.js +1 -1
  185. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  186. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  187. package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  188. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +8 -19
  189. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  190. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  191. package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  192. package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  193. package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  194. package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  195. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  196. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  197. package/build/es/visualizations/config/generators/dhis/singleValue.js +5 -5
  198. package/build/es/visualizations/config/index.js +3 -3
  199. package/build/es/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  200. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  201. package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  202. package/build/es/visualizations/store/index.js +2 -2
  203. package/build/es/visualizations/util/__tests__/getFilterText.spec.js +1 -1
  204. package/build/es/visualizations/util/axisId.js +1 -1
  205. package/build/es/visualizations/util/getFilterText.js +5 -13
  206. package/package.json +3 -4
  207. package/build/cjs/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -244
  208. package/build/es/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -220
@@ -76,7 +76,7 @@ function getTwoCategoryTrendLines(layout, series, isStacked) {
76
76
  });
77
77
  } else {
78
78
  series.forEach(seriesObj => {
79
- const trendlineSerieId = `trendline-${seriesObj.id}`;
79
+ const trendlineSerieId = "trendline-".concat(seriesObj.id);
80
80
  newSeries.push(seriesObj);
81
81
 
82
82
  if (!seriesObj.custom.isTwoCategoryFakeSerie) {
@@ -18,7 +18,7 @@ const getPlotLineLabelStyle = fontStyle => ({
18
18
  y: -7,
19
19
  style: {
20
20
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
21
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
21
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
22
22
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
23
23
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
24
24
  }
@@ -103,7 +103,7 @@ export const getLabels = axis => {
103
103
  return {
104
104
  style: {
105
105
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
106
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
106
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
107
107
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
108
108
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
109
109
  },
@@ -8,7 +8,7 @@ const getTitleStyle = (fontStyle, titleType, visType) => fontStyle ? {
8
8
  margin: 15,
9
9
  style: {
10
10
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
11
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
11
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
12
12
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
13
13
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
14
14
  }
@@ -20,7 +20,7 @@ function getItemStyle(fontStyle, dashboard) {
20
20
  fontWeight: 'normal'
21
21
  }, dashboard ? DASHBOARD_ITEM_STYLE : {
22
22
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
23
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
23
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
24
24
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
25
25
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
26
26
  })
@@ -71,33 +71,22 @@ const formatLabel = ({
71
71
 
72
72
  if ((!seriesId || seriesId.startsWith('trendline')) && seriesType === getType(VIS_TYPE_LINE).type) {
73
73
  // trendline
74
- result.push(`<span style="height: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 6.5}px; width: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; background-color: ${seriesColor}; display: inline-block;"></span>`);
75
- result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
74
+ result.push("<span style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 6.5, "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; background-color: ").concat(seriesColor, "; display: inline-block;\"></span>"));
75
+ result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
76
76
  } else if (legendSet !== null && legendSet !== void 0 && (_legendSet$legends = legendSet.legends) !== null && _legendSet$legends !== void 0 && _legendSet$legends.length && isLegendSetType(visType) && seriesType !== getType(VIS_TYPE_LINE).type) {
77
77
  // item with legend set
78
- legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" version="1.1" style="margin-right:-5px; z-index: ${legendSet.legends.length - index}" class="data-test-series-key-item-bullet">
79
- <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${legend.color}"></circle>
80
- </svg>`));
81
- result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
78
+ legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:-5px; z-index: ").concat(legendSet.legends.length - index, "\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
79
+ result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
82
80
  } else {
83
81
  // regular item (not a trendline, no applied legend set)
84
82
  if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
85
83
  const pattern = colorSets[COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
86
- result.push(`<svg xmlns="http://www.w3.org/2000/svg" style="height: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; width: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; display: inline-block; margin-right:5px" class="data-test-series-key-item-bullet">
87
- <defs>
88
- <pattern id="pattern${seriesColor.patternIndex}" patternUnits="userSpaceOnUse" width="${pattern.width}" height="${pattern.height}">
89
- <path stroke="${pattern.color}" d="${pattern.path}"/>
90
- </pattern>
91
- </defs>
92
- <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="url(#pattern${seriesColor.patternIndex})"/>
93
- </svg>`);
84
+ result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; display: inline-block; margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <defs>\n <pattern id=\"pattern").concat(seriesColor.patternIndex, "\" patternUnits=\"userSpaceOnUse\" width=\"").concat(pattern.width, "\" height=\"").concat(pattern.height, "\">\n <path stroke=\"").concat(pattern.color, "\" d=\"").concat(pattern.path, "\"/>\n </pattern>\n </defs>\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
94
85
  } else {
95
- result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" version="1.1" style="margin-right:5px" class="data-test-series-key-item-bullet">
96
- <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${seriesColor}"></circle>
97
- </svg>`);
86
+ result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
98
87
  }
99
88
 
100
- result.push(`<span class="data-test-series-key-item-name">${seriesName}</span>`);
89
+ result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
101
90
  }
102
91
 
103
92
  result.push('</div>');
@@ -28,6 +28,6 @@ export const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? {
28
28
  };
29
29
  export const getLegendSetTooltip = () => ({
30
30
  pointFormatter: function () {
31
- return `<span style="color:${this.color}">●</span> ${this.series.name}: <b>${this.y}</b><br>` + (this.legend ? `${this.legendSet}: <b>${this.legend}</b>` : `${i18n.t('No legend for this series')}`);
31
+ return "<span style=\"color:".concat(this.color, "\">\u25CF</span> ").concat(this.series.name, ": <b>").concat(this.y, "</b><br>") + (this.legend ? "".concat(this.legendSet, ": <b>").concat(this.legend, "</b>") : "".concat(i18n.t('No legend for this series')));
32
32
  }
33
33
  });
@@ -29,7 +29,7 @@ export default (({
29
29
  }));
30
30
  }
31
31
 
32
- return `${labels.map(label => `<b>${label}</b><br>`).join('')}${yAxisName}: ${y}<br>${xAxisName}: ${x}`;
32
+ return "".concat(labels.map(label => "<b>".concat(label, "</b><br>")).join('')).concat(yAxisName, ": ").concat(y, "<br>").concat(xAxisName, ": ").concat(x);
33
33
  };
34
34
 
35
35
  switch (visType) {
@@ -58,7 +58,7 @@ export default function (series, layout, metaData, dashboard) {
58
58
  style: {
59
59
  // DHIS2-578: dynamically truncate subtitle when it's taking more than 1 line
60
60
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
61
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
61
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
62
62
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
63
63
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal',
64
64
  whiteSpace: 'nowrap',
@@ -61,7 +61,7 @@ export default function (layout, metaData, dashboard) {
61
61
  align: getTextAlignOption(fontStyle[FONT_STYLE_OPTION_TEXT_ALIGN], FONT_STYLE_VISUALIZATION_TITLE, isVerticalType(layout.type)),
62
62
  style: {
63
63
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
64
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
64
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
65
65
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
66
66
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal',
67
67
  whiteSpace: 'nowrap',
@@ -4,6 +4,6 @@ export default function (layout, metaData, dashboard) {
4
4
 
5
5
  if ((_layout$rows = layout.rows) !== null && _layout$rows !== void 0 && _layout$rows.length && (_layout$columns = layout.columns) !== null && _layout$columns !== void 0 && _layout$columns.length && !dashboard) {
6
6
  const columns = getFilterText(layout.columns, metaData).split(', ');
7
- return `${getFilterText(layout.rows, metaData)}: ${columns[0]} - ${columns[1]}`;
7
+ return "".concat(getFilterText(layout.rows, metaData), ": ").concat(columns[0], " - ").concat(columns[1]);
8
8
  }
9
9
  }
@@ -23,7 +23,7 @@ export const getLabels = axis => {
23
23
  return {
24
24
  style: {
25
25
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
26
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
26
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
27
27
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
28
28
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
29
29
  },
@@ -47,12 +47,12 @@ function getPlotLine(regressionLine = {}, defaultLabel) {
47
47
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR] || '#000',
48
48
  ...(label && {
49
49
  label: {
50
- text: `${label}: ${value}`,
50
+ text: "".concat(label, ": ").concat(value),
51
51
  verticalAlign,
52
52
  y,
53
53
  style: {
54
54
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
55
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
55
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
56
56
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
57
57
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
58
58
  }
@@ -69,7 +69,7 @@ const getLabels = axis => {
69
69
  y: parseInt(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], 10) + 7,
70
70
  style: {
71
71
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
72
- fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
72
+ fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
73
73
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
74
74
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
75
75
  }
@@ -52,9 +52,9 @@ function getDefault(layout, series, extraOptions) {
52
52
  var _axis$title;
53
53
 
54
54
  rl.title = { ...rl.title,
55
- text: `${rl.title.text} - ${((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || i18n.t('Axis {{axisId}}', {
55
+ text: "".concat(rl.title.text, " - ").concat(((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || i18n.t('Axis {{axisId}}', {
56
56
  axisId: axis.index + 1
57
- })}`
57
+ }))
58
58
  };
59
59
  }
60
60
  });
@@ -14,7 +14,7 @@ const generateValueSVG = ({
14
14
  const textSize = 300;
15
15
  const svgValue = document.createElementNS(svgNS, 'svg');
16
16
  svgValue.setAttribute('xmlns', svgNS);
17
- svgValue.setAttribute('viewBox', `0 -${textSize + 50} ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
17
+ svgValue.setAttribute('viewBox', "0 -".concat(textSize + 50, " ").concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
18
18
 
19
19
  if (y) {
20
20
  svgValue.setAttribute('y', y);
@@ -42,7 +42,7 @@ const generateValueSVG = ({
42
42
  if (subText) {
43
43
  const svgSubText = document.createElementNS(svgNS, 'svg');
44
44
  const subTextSize = 40;
45
- svgSubText.setAttribute('viewBox', `0 -50 ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
45
+ svgSubText.setAttribute('viewBox', "0 -50 ".concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
46
46
 
47
47
  if (y) {
48
48
  svgSubText.setAttribute('y', y);
@@ -136,7 +136,7 @@ const generateDVItem = (config, {
136
136
  const svgNS = 'http://www.w3.org/2000/svg';
137
137
  const svg = document.createElementNS(svgNS, 'svg');
138
138
  svg.setAttribute('xmlns', svgNS);
139
- svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
139
+ svg.setAttribute('viewBox', "0 0 ".concat(width, " ").concat(height));
140
140
  svg.setAttribute('width', '100%');
141
141
  svg.setAttribute('height', '100%');
142
142
  svg.setAttribute('data-test', 'visualization-container');
@@ -145,7 +145,7 @@ const generateDVItem = (config, {
145
145
  title.setAttribute('x', getXFromTextAlign(titleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
146
146
  title.setAttribute('y', 28);
147
147
  title.setAttribute('text-anchor', getTextAnchorFromTextAlign(titleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
148
- title.setAttribute('font-size', `${titleFontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`);
148
+ title.setAttribute('font-size', "".concat(titleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
149
149
  title.setAttribute('font-weight', titleFontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal');
150
150
  title.setAttribute('font-style', titleFontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal');
151
151
  title.setAttribute('fill', titleFontStyle[FONT_STYLE_OPTION_TEXT_COLOR]);
@@ -162,7 +162,7 @@ const generateDVItem = (config, {
162
162
  subtitle.setAttribute('y', 28);
163
163
  subtitle.setAttribute('dy', 22);
164
164
  subtitle.setAttribute('text-anchor', getTextAnchorFromTextAlign(subtitleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
165
- subtitle.setAttribute('font-size', `${subtitleFontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`);
165
+ subtitle.setAttribute('font-size', "".concat(subtitleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
166
166
  subtitle.setAttribute('font-weight', subtitleFontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal');
167
167
  subtitle.setAttribute('font-style', subtitleFontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal');
168
168
  subtitle.setAttribute('fill', subtitleFontStyle[FONT_STYLE_OPTION_TEXT_COLOR]);
@@ -20,15 +20,15 @@ export default function ({
20
20
  const _generator = generators[outputFormat];
21
21
 
22
22
  if (_validator === validators.noValidation) {
23
- onWarning(`No validation implementation for config input format "${inputFormat}"`);
23
+ onWarning("No validation implementation for config input format \"".concat(inputFormat, "\""));
24
24
  }
25
25
 
26
26
  if (!_adapter) {
27
- onError(`No config tranformation implementation for format "${inputFormat}" to format "${outputFormat}"`);
27
+ onError("No config tranformation implementation for format \"".concat(inputFormat, "\" to format \"").concat(outputFormat, "\""));
28
28
  }
29
29
 
30
30
  if (!_generator) {
31
- onError(`No visualization implementation for format ${outputFormat}`);
31
+ onError("No visualization implementation for format ".concat(outputFormat));
32
32
  }
33
33
 
34
34
  const DEFAULT_EXTRA_OPTIONS = {
@@ -30,7 +30,7 @@ function getDefault(acc, seriesIds, categoryIds, idValueMap, metaData) {
30
30
  seriesIds.forEach(seriesId => {
31
31
  const serieData = [];
32
32
  categoryIds.forEach(categoryId => {
33
- const value = idValueMap.get(`${seriesId}-${categoryId}`); // DHIS2-1261: 0 is a valid value
33
+ const value = idValueMap.get("".concat(seriesId, "-").concat(categoryId)); // DHIS2-1261: 0 is a valid value
34
34
  // undefined value means the key was not found within the rows
35
35
  // in that case null is returned as value in the serie
36
36
 
@@ -40,7 +40,7 @@ function getDefault(acc, series, categories, idValueMap, metaData) {
40
40
  series[0].forEach(serieItemId => {
41
41
  const serieData = [];
42
42
  categories[0].forEach(categoryItemId => {
43
- const value = idValueMap.get(`${serieItemId}-${categoryItemId}`); // DHIS2-1261: 0 is a valid value
43
+ const value = idValueMap.get("".concat(serieItemId, "-").concat(categoryItemId)); // DHIS2-1261: 0 is a valid value
44
44
  // undefined value means the key was not found within the rows
45
45
  // in that case null is returned as value in the serie
46
46
  // this is to keep the correct indexes for the values within the serie array
@@ -6,7 +6,7 @@ export default function (acc, series, categories, idValueMap, metaData) {
6
6
  categories[0].forEach(category1ItemId => {
7
7
  const groupData = [];
8
8
  categories[1].forEach(category2ItemId => {
9
- const value = idValueMap.get(`${seriesItemId}-${category1ItemId}-${category2ItemId}`);
9
+ const value = idValueMap.get("".concat(seriesItemId, "-").concat(category1ItemId, "-").concat(category2ItemId));
10
10
  groupData.push(value === undefined ? null : parseFloat(value));
11
11
  });
12
12
  groupedData.push(groupData);
@@ -14,11 +14,11 @@ export default function ({
14
14
  const _adapter = adapters[inputFormat + '_' + outputFormat];
15
15
 
16
16
  if (_validator === validators.noValidation) {
17
- warning(`Validation not supported for data input format "${inputFormat}"`);
17
+ warning("Validation not supported for data input format \"".concat(inputFormat, "\""));
18
18
  }
19
19
 
20
20
  if (!_adapter) {
21
- error(`Data tranformation from "${inputFormat}" to "${outputFormat}" is not supported`);
21
+ error("Data tranformation from \"".concat(inputFormat, "\" to \"").concat(outputFormat, "\" is not supported"));
22
22
  }
23
23
 
24
24
  this.data = data;
@@ -128,7 +128,7 @@ describe('getFilterText', () => {
128
128
  name: '02 of 2018',
129
129
  uid: '_201802_'
130
130
  };
131
- expect(getFilterText(filters, metaData)).toEqual('Clinics, Hospital - Last 2 months');
131
+ expect(getFilterText(filters, metaData)).toEqual('Clinics, Hospital - 01 of 2018, 02 of 2018');
132
132
  });
133
133
  });
134
134
  });
@@ -1,2 +1,2 @@
1
1
  const AXIS_ID_PREFIX = 'AXIS_';
2
- export const getAxisStringFromId = id => `${AXIS_ID_PREFIX}${id}`;
2
+ export const getAxisStringFromId = id => "".concat(AXIS_ID_PREFIX).concat(id);
@@ -2,7 +2,7 @@ import { getOuLevelAndGroupText } from '../../modules/getOuLevelAndGroupText';
2
2
  import { dimensionGetItems } from '../../modules/layout/dimensionGetItems';
3
3
  import { dimensionIs } from '../../modules/layout/dimensionIs';
4
4
  import { ouIdHelper } from '../../modules/ouIdHelper';
5
- import { DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../../modules/predefinedDimensions';
5
+ import { DIMENSION_ID_ORGUNIT } from '../../modules/predefinedDimensions';
6
6
  export default function (filters, metaData) {
7
7
  if (!Array.isArray(filters) || !filters.length) {
8
8
  return '';
@@ -19,15 +19,7 @@ export default function (filters, metaData) {
19
19
  }) => ouIdHelper.hasGroupPrefix(id) || ouIdHelper.hasLevelPrefix(id))) {
20
20
  titleFragments.push(getOuLevelAndGroupText(filter, metaData));
21
21
  } else {
22
- let filterItems = [];
23
-
24
- if (dimensionIs(filter, DIMENSION_ID_PERIOD)) {
25
- filterItems = items.map(({
26
- id
27
- }) => id);
28
- } else {
29
- filterItems = metaData.dimensions[filter.dimension];
30
- }
22
+ const filterItems = metaData.dimensions[filter.dimension];
31
23
 
32
24
  if (Array.isArray(filterItems)) {
33
25
  l = filterItems.length;
@@ -42,9 +34,9 @@ export default function (filters, metaData) {
42
34
  } // otherwise use the values directly
43
35
  // this is a temporary fix to avoid app crashing when using filters with data items in EV
44
36
  else {
45
- sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
46
- break;
47
- }
37
+ sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
38
+ break;
39
+ }
48
40
  }
49
41
 
50
42
  titleFragments.push(sectionParts.join(', '));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "21.0.0-alpha.3",
3
+ "version": "21.0.2",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {
@@ -35,7 +35,7 @@
35
35
  "@dhis2/cli-app-scripts": "^6.2.0",
36
36
  "@dhis2/cli-style": "^9.0.1",
37
37
  "@dhis2/d2-i18n": "^1.1.0",
38
- "@dhis2/ui": "^6.23.5",
38
+ "@dhis2/ui": "^7.7.3",
39
39
  "@sambego/storybook-state": "^2.0.1",
40
40
  "@storybook/addons": "^6.1.14",
41
41
  "@storybook/preset-create-react-app": "^3.1.7",
@@ -51,14 +51,13 @@
51
51
  "peerDependencies": {
52
52
  "@dhis2/app-runtime": "^2",
53
53
  "@dhis2/d2-i18n": "^1.1",
54
- "@dhis2/ui": "^6.5.2",
54
+ "@dhis2/ui": "^7.7.3",
55
55
  "prop-types": "^15",
56
56
  "react": "^16.3",
57
57
  "react-dom": "^16.3",
58
58
  "styled-jsx": "^3.3.2"
59
59
  },
60
60
  "dependencies": {
61
- "@dhis2/d2-ui-org-unit-dialog": "^7.3.0",
62
61
  "@dhis2/d2-ui-translation-dialog": "^7.3.1",
63
62
  "classnames": "^2.3.1",
64
63
  "d2-utilizr": "^0.2.16",