@dhis2/analytics 20.6.2 → 21.0.0-alpha.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.
Files changed (213) hide show
  1. package/build/cjs/__demo__/Filter.stories.js +2 -2
  2. package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
  3. package/build/cjs/__demo__/OpenFileDialog.stories.js +1 -1
  4. package/build/cjs/__demo__/OrgUnitDimension.stories.js +95 -0
  5. package/build/cjs/__demo__/PivotTable.stories.js +2 -2
  6. package/build/cjs/api/analytics/AnalyticsBase.js +1 -1
  7. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -1
  8. package/build/cjs/api/analytics/AnalyticsRequestBase.js +3 -3
  9. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  10. package/build/cjs/api/analytics/AnalyticsResponse.js +2 -2
  11. package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -1
  12. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  13. package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  14. package/build/cjs/api/analytics/utils.js +1 -1
  15. package/build/cjs/api/dimensions.js +37 -37
  16. package/build/cjs/api/organisationUnits.js +100 -46
  17. package/build/cjs/components/DataDimension/DataTypesSelector.js +3 -3
  18. package/build/cjs/components/DataDimension/DetailSelector.js +2 -2
  19. package/build/cjs/components/DataDimension/GroupSelector.js +9 -9
  20. package/build/cjs/components/DataDimension/ItemSelector.js +19 -19
  21. package/build/cjs/components/DataDimension/MetricSelector.js +3 -3
  22. package/build/cjs/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  23. package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -1
  24. package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -1
  25. package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -1
  26. package/build/cjs/components/DimensionMenu.js +10 -10
  27. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +2 -2
  28. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +5 -5
  29. package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +2 -2
  30. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +10 -10
  31. package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  32. package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  33. package/build/cjs/components/DynamicDimension/DynamicDimension.js +4 -4
  34. package/build/cjs/components/DynamicDimension/ItemSelector.js +8 -8
  35. package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  36. package/build/cjs/components/FileMenu/DeleteDialog.js +2 -2
  37. package/build/cjs/components/FileMenu/FileMenu.js +5 -5
  38. package/build/cjs/components/FileMenu/FileMenu.styles.js +1 -1
  39. package/build/cjs/components/FileMenu/GetLinkDialog.js +1 -1
  40. package/build/cjs/components/FileMenu/RenameDialog.js +2 -2
  41. package/build/cjs/components/FileMenu/SaveAsDialog.js +2 -2
  42. package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  43. package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  44. package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  45. package/build/cjs/components/FileMenu/utils.js +3 -3
  46. package/build/cjs/components/Filter/Filter.js +1 -1
  47. package/build/cjs/components/Filter/styles/Filter.style.js +1 -1
  48. package/build/cjs/components/LegendKey/LegendKey.js +9 -9
  49. package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -1
  50. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -2
  51. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +21 -21
  52. package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  53. package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  54. package/build/cjs/components/Options/VisualizationOptions.js +2 -2
  55. package/build/cjs/components/Options/styles/VisualizationOptions.style.js +10 -10
  56. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +163 -203
  57. package/build/cjs/components/OrgUnitDimension/OrgUnitDimensionOld.js +244 -0
  58. package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +5 -2
  59. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  60. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +4 -4
  61. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +11 -11
  62. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  63. package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  64. package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  65. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  66. package/build/cjs/components/PivotTable/PivotTable.js +2 -2
  67. package/build/cjs/components/PivotTable/PivotTableCell.js +3 -3
  68. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  69. package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -2
  70. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +2 -2
  71. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +2 -2
  72. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +4 -4
  73. package/build/cjs/components/PivotTable/PivotTableValueCell.js +2 -2
  74. package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -3
  75. package/build/cjs/components/TransferOption.js +5 -5
  76. package/build/cjs/components/styles/DimensionSelector.style.js +1 -1
  77. package/build/cjs/components/styles/TransferOption.style.js +1 -1
  78. package/build/cjs/index.js +6 -6
  79. package/build/cjs/locales/en/translations.json +5 -0
  80. package/build/cjs/locales/es/translations.json +6 -6
  81. package/build/cjs/locales/ru/translations.json +1 -1
  82. package/build/cjs/locales/zh/translations.json +7 -7
  83. package/build/cjs/modules/axis.js +1 -1
  84. package/build/cjs/modules/layoutUiRules/rules.js +1 -1
  85. package/build/cjs/modules/ouIdHelper/index.js +9 -3
  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/relativeItems/index.js +1 -1
  89. package/build/cjs/modules/visTypes.js +1 -1
  90. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  91. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  92. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  93. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
  94. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +19 -8
  95. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  96. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  97. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  98. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  99. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  100. package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  101. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  102. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  103. package/build/cjs/visualizations/config/generators/dhis/singleValue.js +5 -5
  104. package/build/cjs/visualizations/config/index.js +3 -3
  105. package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  106. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  107. package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  108. package/build/cjs/visualizations/store/index.js +2 -2
  109. package/build/cjs/visualizations/util/axisId.js +1 -1
  110. package/build/cjs/visualizations/util/getFilterText.js +3 -3
  111. package/build/es/__demo__/OpenFileDialog.stories.js +1 -1
  112. package/build/es/__demo__/OrgUnitDimension.stories.js +84 -0
  113. package/build/es/api/analytics/AnalyticsBase.js +1 -1
  114. package/build/es/api/analytics/AnalyticsRequest.js +1 -1
  115. package/build/es/api/analytics/AnalyticsRequestBase.js +3 -3
  116. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  117. package/build/es/api/analytics/AnalyticsResponse.js +2 -2
  118. package/build/es/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -1
  119. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  120. package/build/es/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  121. package/build/es/api/analytics/utils.js +1 -1
  122. package/build/es/api/dimensions.js +39 -39
  123. package/build/es/api/organisationUnits.js +93 -43
  124. package/build/es/components/DataDimension/DataTypesSelector.js +3 -3
  125. package/build/es/components/DataDimension/DetailSelector.js +2 -2
  126. package/build/es/components/DataDimension/GroupSelector.js +7 -7
  127. package/build/es/components/DataDimension/ItemSelector.js +17 -17
  128. package/build/es/components/DataDimension/MetricSelector.js +3 -3
  129. package/build/es/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  130. package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
  131. package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
  132. package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
  133. package/build/es/components/DimensionMenu.js +10 -10
  134. package/build/es/components/DimensionsPanel/List/DimensionItem.js +3 -3
  135. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  136. package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  137. package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  138. package/build/es/components/DynamicDimension/DynamicDimension.js +4 -4
  139. package/build/es/components/DynamicDimension/ItemSelector.js +6 -6
  140. package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  141. package/build/es/components/FileMenu/FileMenu.js +3 -3
  142. package/build/es/components/FileMenu/FileMenu.styles.js +1 -1
  143. package/build/es/components/FileMenu/GetLinkDialog.js +1 -1
  144. package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  145. package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  146. package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  147. package/build/es/components/FileMenu/utils.js +3 -3
  148. package/build/es/components/Filter/Filter.js +1 -1
  149. package/build/es/components/Filter/styles/Filter.style.js +1 -1
  150. package/build/es/components/LegendKey/LegendKey.js +9 -9
  151. package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
  152. package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -2
  153. package/build/es/components/OpenFileDialog/OpenFileDialog.js +19 -19
  154. package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  155. package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  156. package/build/es/components/Options/styles/VisualizationOptions.style.js +10 -10
  157. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +163 -204
  158. package/build/es/components/OrgUnitDimension/OrgUnitDimensionOld.js +220 -0
  159. package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +3 -2
  160. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  161. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +2 -2
  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 +5 -5
  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 +1 -1
  177. package/build/es/locales/en/translations.json +5 -0
  178. package/build/es/locales/es/translations.json +6 -6
  179. package/build/es/locales/ru/translations.json +1 -1
  180. package/build/es/locales/zh/translations.json +7 -7
  181. package/build/es/modules/axis.js +1 -1
  182. package/build/es/modules/layoutUiRules/rules.js +1 -1
  183. package/build/es/modules/ouIdHelper/index.js +5 -2
  184. package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
  185. package/build/es/modules/pivotTable/measureText.js +1 -1
  186. package/build/es/modules/relativeItems/index.js +2 -2
  187. package/build/es/modules/visTypes.js +1 -1
  188. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  189. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  190. package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  191. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +19 -8
  192. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  193. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  194. package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  195. package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  196. package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  197. package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  198. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  199. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  200. package/build/es/visualizations/config/generators/dhis/singleValue.js +5 -5
  201. package/build/es/visualizations/config/index.js +3 -3
  202. package/build/es/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  203. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  204. package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  205. package/build/es/visualizations/store/index.js +2 -2
  206. package/build/es/visualizations/util/axisId.js +1 -1
  207. package/build/es/visualizations/util/getFilterText.js +3 -3
  208. package/package.json +1 -1
  209. package/CHANGELOG.md +0 -2735
  210. package/build/cjs/api/organisationUnits-dataEngine.js +0 -119
  211. package/build/cjs/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +0 -96
  212. package/build/es/api/organisationUnits-dataEngine.js +0 -96
  213. package/build/es/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +0 -86
@@ -91,13 +91,13 @@
91
91
  "No maps found. Click New map to get started.": "未找到地图。单击新地图开始。",
92
92
  "No maps found. Try adjusting your search or filter options to find what you're looking for.": "未找到地图。尝试调整您的搜索或过滤选项以找到您要查找的内容。",
93
93
  "New map": "新地图",
94
- "Open an event report": "",
95
- "Loading event reports": "",
96
- "Couldn't load event reports": "",
97
- "There was a problem loading event reports. Try again or contact your system administrator.": "",
98
- "No event reports found. Click New event report to get started.": "",
99
- "No event reports found. Try adjusting your search or filter options to find what you're looking for.": "",
100
- "New event report": "",
94
+ "Open an event report": "打开事件报告",
95
+ "Loading event reports": "加载事件报告",
96
+ "Couldn't load event reports": "无法加载事件报告",
97
+ "There was a problem loading event reports. Try again or contact your system administrator.": "加载事件报告时出现问题。重试或联系您的系统管理员。",
98
+ "No event reports found. Click New event report to get started.": "未找到事件报告。单击新建事件报告开始。",
99
+ "No event reports found. Try adjusting your search or filter options to find what you're looking for.": "未找到事件报告。尝试调整您的搜索或过滤选项以找到您要查找的内容。",
100
+ "New event report": "新建事件报告",
101
101
  "Options": "选项",
102
102
  "Hide": "隐藏",
103
103
  "Update": "更新",
@@ -33,7 +33,7 @@ export const getAxisNameByLayoutType = (axisId, layoutType) => {
33
33
  const name = getAxisNamesByLayoutType(layoutType)[axisId];
34
34
 
35
35
  if (!name) {
36
- throw new Error("".concat(axisId, " is not a valid axis id"));
36
+ throw new Error(`${axisId} is not a valid axis id`);
37
37
  }
38
38
 
39
39
  return name;
@@ -101,7 +101,7 @@ const getRulesByVisType = visType => {
101
101
  const rules = visTypeToRules[visType];
102
102
 
103
103
  if (!rules) {
104
- throw new Error("".concat(visType, " is not a known visualization type"));
104
+ throw new Error(`${visType} is not a known visualization type`);
105
105
  }
106
106
 
107
107
  return rules;
@@ -1,5 +1,8 @@
1
1
  const LEVEL_ID_PREFIX = 'LEVEL';
2
2
  const GROUP_ID_PREFIX = 'OU_GROUP';
3
+ export const USER_ORG_UNIT = 'USER_ORGUNIT';
4
+ export const USER_ORG_UNIT_CHILDREN = 'USER_ORGUNIT_CHILDREN';
5
+ export const USER_ORG_UNIT_GRANDCHILDREN = 'USER_ORGUNIT_GRANDCHILDREN';
3
6
 
4
7
  const hasGroupPrefix = id => id.substr(0, GROUP_ID_PREFIX.length) === GROUP_ID_PREFIX;
5
8
 
@@ -12,8 +15,8 @@ const stripGroupPrefix = id => hasGroupPrefix(id) ? id.substr(GROUP_ID_PREFIX.le
12
15
  const removePrefix = id => stripGroupPrefix(stripLevelPrefix(id));
13
16
 
14
17
  export const ouIdHelper = Object.freeze({
15
- addLevelPrefix: id => "".concat(LEVEL_ID_PREFIX, "-").concat(removePrefix(id)),
16
- addGroupPrefix: id => "".concat(GROUP_ID_PREFIX, "-").concat(removePrefix(id)),
18
+ addLevelPrefix: id => `${LEVEL_ID_PREFIX}-${removePrefix(id)}`,
19
+ addGroupPrefix: id => `${GROUP_ID_PREFIX}-${removePrefix(id)}`,
17
20
  removePrefix,
18
21
  hasGroupPrefix,
19
22
  hasLevelPrefix
@@ -354,7 +354,7 @@ export class PivotTableEngine {
354
354
  }
355
355
 
356
356
  if (rowLevel === lastRowLevel && this.dimensionLookup.rows[lastRowLevel] && columnLevel === lastColumnLevel && this.dimensionLookup.columns[lastColumnLevel]) {
357
- return "".concat(this.dimensionLookup.rows[lastRowLevel].meta.name, " / ").concat(this.dimensionLookup.columns[lastColumnLevel].meta.name);
357
+ return `${this.dimensionLookup.rows[lastRowLevel].meta.name} / ${this.dimensionLookup.columns[lastColumnLevel].meta.name}`;
358
358
  }
359
359
 
360
360
  if (lastRowLevel === -1) {
@@ -948,12 +948,12 @@ export class PivotTableEngine {
948
948
 
949
949
  sort(column, order) {
950
950
  if (order !== SORT_ORDER_ASCENDING && order !== SORT_ORDER_DESCENDING) {
951
- console.warn("Invalid sort order ".concat(order));
951
+ console.warn(`Invalid sort order ${order}`);
952
952
  return;
953
953
  }
954
954
 
955
955
  if (!this.isSortable(column)) {
956
- console.warn("Invalid sort column ".concat(column));
956
+ console.warn(`Invalid sort column ${column}`);
957
957
  return;
958
958
  }
959
959
 
@@ -7,7 +7,7 @@ const getContext = fontSize => {
7
7
  }
8
8
 
9
9
  const ctx = canvas.getContext('2d');
10
- ctx.font = "".concat(fontSize, "px Roboto, Arial, sans-serif");
10
+ ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
11
11
  return ctx;
12
12
  };
13
13
 
@@ -1,4 +1,4 @@
1
1
  import { getRelativePeriodIds } from '../../components/PeriodDimension/utils/relativePeriods';
2
- import { ouIdHelper } from '../ouIdHelper';
2
+ import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN } from '../ouIdHelper';
3
3
  import { DIMENSION_ID_ASSIGNED_CATEGORIES, DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../predefinedDimensions';
4
- export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || ['USER_ORGUNIT', 'USER_ORGUNIT_CHILDREN', 'USER_ORGUNIT_GRAND_CHILDREN'].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
4
+ export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
@@ -71,7 +71,7 @@ export const getDisplayNameByVisType = visType => {
71
71
  const displayName = visTypeDisplayNames[visType];
72
72
 
73
73
  if (!displayName) {
74
- throw new Error("".concat(visType, " is not a valid visualization type"));
74
+ throw new Error(`${visType} is not a valid visualization type`);
75
75
  }
76
76
 
77
77
  return displayName;
@@ -76,7 +76,7 @@ function getTwoCategoryTrendLines(layout, series, isStacked) {
76
76
  });
77
77
  } else {
78
78
  series.forEach(seriesObj => {
79
- const trendlineSerieId = "trendline-".concat(seriesObj.id);
79
+ const trendlineSerieId = `trendline-${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
21
+ fontSize: `${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
106
+ fontSize: `${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
11
+ fontSize: `${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
23
+ fontSize: `${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,22 +71,33 @@ 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: ".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>"));
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>`);
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=\"".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>"));
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>`);
80
82
  } else {
81
83
  // regular item (not a trendline, no applied legend set)
82
84
  if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
83
85
  const pattern = colorSets[COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
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>"));
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>`);
85
94
  } else {
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>"));
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>`);
87
98
  }
88
99
 
89
- result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
100
+ result.push(`<span class="data-test-series-key-item-name">${seriesName}</span>`);
90
101
  }
91
102
 
92
103
  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:".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')));
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')}`);
32
32
  }
33
33
  });
@@ -29,7 +29,7 @@ export default (({
29
29
  }));
30
30
  }
31
31
 
32
- return "".concat(labels.map(label => "<b>".concat(label, "</b><br>")).join('')).concat(yAxisName, ": ").concat(y, "<br>").concat(xAxisName, ": ").concat(x);
32
+ return `${labels.map(label => `<b>${label}</b><br>`).join('')}${yAxisName}: ${y}<br>${xAxisName}: ${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
61
+ fontSize: `${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
64
+ fontSize: `${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 "".concat(getFilterText(layout.rows, metaData), ": ").concat(columns[0], " - ").concat(columns[1]);
7
+ return `${getFilterText(layout.rows, metaData)}: ${columns[0]} - ${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
26
+ fontSize: `${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: "".concat(label, ": ").concat(value),
50
+ text: `${label}: ${value}`,
51
51
  verticalAlign,
52
52
  y,
53
53
  style: {
54
54
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
55
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
55
+ fontSize: `${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: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
72
+ fontSize: `${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: "".concat(rl.title.text, " - ").concat(((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || i18n.t('Axis {{axisId}}', {
55
+ text: `${rl.title.text} - ${((_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 -".concat(textSize + 50, " ").concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
17
+ svgValue.setAttribute('viewBox', `0 -${textSize + 50} ${textSize * 0.75 * formattedValue.length} ${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 ".concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
45
+ svgSubText.setAttribute('viewBox', `0 -50 ${textSize * 0.75 * formattedValue.length} ${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 ".concat(width, " ").concat(height));
139
+ svg.setAttribute('viewBox', `0 0 ${width} ${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', "".concat(titleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
148
+ title.setAttribute('font-size', `${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', "".concat(subtitleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
165
+ subtitle.setAttribute('font-size', `${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 \"".concat(inputFormat, "\""));
23
+ onWarning(`No validation implementation for config input format "${inputFormat}"`);
24
24
  }
25
25
 
26
26
  if (!_adapter) {
27
- onError("No config tranformation implementation for format \"".concat(inputFormat, "\" to format \"").concat(outputFormat, "\""));
27
+ onError(`No config tranformation implementation for format "${inputFormat}" to format "${outputFormat}"`);
28
28
  }
29
29
 
30
30
  if (!_generator) {
31
- onError("No visualization implementation for format ".concat(outputFormat));
31
+ onError(`No visualization implementation for format ${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("".concat(seriesId, "-").concat(categoryId)); // DHIS2-1261: 0 is a valid value
33
+ const value = idValueMap.get(`${seriesId}-${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("".concat(serieItemId, "-").concat(categoryItemId)); // DHIS2-1261: 0 is a valid value
43
+ const value = idValueMap.get(`${serieItemId}-${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("".concat(seriesItemId, "-").concat(category1ItemId, "-").concat(category2ItemId));
9
+ const value = idValueMap.get(`${seriesItemId}-${category1ItemId}-${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 \"".concat(inputFormat, "\""));
17
+ warning(`Validation not supported for data input format "${inputFormat}"`);
18
18
  }
19
19
 
20
20
  if (!_adapter) {
21
- error("Data tranformation from \"".concat(inputFormat, "\" to \"").concat(outputFormat, "\" is not supported"));
21
+ error(`Data tranformation from "${inputFormat}" to "${outputFormat}" is not supported`);
22
22
  }
23
23
 
24
24
  this.data = data;
@@ -1,2 +1,2 @@
1
1
  const AXIS_ID_PREFIX = 'AXIS_';
2
- export const getAxisStringFromId = id => "".concat(AXIS_ID_PREFIX).concat(id);
2
+ export const getAxisStringFromId = id => `${AXIS_ID_PREFIX}${id}`;
@@ -42,9 +42,9 @@ export default function (filters, metaData) {
42
42
  } // otherwise use the values directly
43
43
  // this is a temporary fix to avoid app crashing when using filters with data items in EV
44
44
  else {
45
- sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
46
- break;
47
- }
45
+ sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
46
+ break;
47
+ }
48
48
  }
49
49
 
50
50
  titleFragments.push(sectionParts.join(', '));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "20.6.2",
3
+ "version": "21.0.0-alpha.1",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {