@dhis2/analytics 21.0.0-alpha.2 → 21.0.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 (209) hide show
  1. package/CHANGELOG.md +2782 -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 +17 -8
  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 +1 -1
  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 +82 -17
  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 +28 -2
  81. package/build/cjs/locales/en/translations.json +26 -0
  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/__demo__/OrgUnitDimension.stories.js +15 -6
  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 +1 -11
  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 +5 -5
  124. package/build/es/components/AboutAOUnit/AboutAOUnit.js +204 -0
  125. package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +4 -0
  126. package/build/es/components/DataDimension/DataTypesSelector.js +3 -3
  127. package/build/es/components/DataDimension/DetailSelector.js +2 -2
  128. package/build/es/components/DataDimension/GroupSelector.js +7 -7
  129. package/build/es/components/DataDimension/ItemSelector.js +17 -17
  130. package/build/es/components/DataDimension/MetricSelector.js +3 -3
  131. package/build/es/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  132. package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
  133. package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
  134. package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
  135. package/build/es/components/DimensionMenu.js +10 -10
  136. package/build/es/components/DimensionsPanel/List/DimensionItem.js +3 -3
  137. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  138. package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  139. package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  140. package/build/es/components/DynamicDimension/DynamicDimension.js +4 -4
  141. package/build/es/components/DynamicDimension/ItemSelector.js +6 -6
  142. package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  143. package/build/es/components/FileMenu/FileMenu.js +3 -3
  144. package/build/es/components/FileMenu/FileMenu.styles.js +1 -1
  145. package/build/es/components/FileMenu/GetLinkDialog.js +1 -1
  146. package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  147. package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  148. package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  149. package/build/es/components/FileMenu/utils.js +3 -3
  150. package/build/es/components/Filter/Filter.js +1 -1
  151. package/build/es/components/Filter/styles/Filter.style.js +1 -1
  152. package/build/es/components/LegendKey/LegendKey.js +9 -9
  153. package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
  154. package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -2
  155. package/build/es/components/OpenFileDialog/OpenFileDialog.js +19 -19
  156. package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  157. package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  158. package/build/es/components/Options/styles/VisualizationOptions.style.js +10 -10
  159. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +80 -16
  160. package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +2 -2
  161. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  162. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +8 -8
  163. package/build/es/components/PeriodDimension/PeriodTransfer.js +9 -9
  164. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  165. package/build/es/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  166. package/build/es/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  167. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  168. package/build/es/components/PivotTable/PivotTableCell.js +3 -3
  169. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  170. package/build/es/components/PivotTable/PivotTableContainer.js +2 -2
  171. package/build/es/components/PivotTable/PivotTableSortIcon.js +2 -2
  172. package/build/es/components/PivotTable/PivotTableTitleRow.js +2 -2
  173. package/build/es/components/PivotTable/styles/PivotTable.style.js +3 -3
  174. package/build/es/components/TransferOption.js +17 -17
  175. package/build/es/components/styles/DimensionSelector.style.js +1 -1
  176. package/build/es/components/styles/TransferOption.style.js +1 -1
  177. package/build/es/index.js +3 -2
  178. package/build/es/locales/en/translations.json +26 -0
  179. package/build/es/modules/axis.js +1 -1
  180. package/build/es/modules/layoutUiRules/rules.js +1 -1
  181. package/build/es/modules/list.js +13 -0
  182. package/build/es/modules/ouIdHelper/index.js +2 -2
  183. package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
  184. package/build/es/modules/pivotTable/measureText.js +1 -1
  185. package/build/es/modules/visTypes.js +1 -1
  186. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  187. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  188. package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  189. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +8 -19
  190. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  191. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  192. package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  193. package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  194. package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  195. package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  196. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  197. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  198. package/build/es/visualizations/config/generators/dhis/singleValue.js +5 -5
  199. package/build/es/visualizations/config/index.js +3 -3
  200. package/build/es/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  201. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  202. package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  203. package/build/es/visualizations/store/index.js +2 -2
  204. package/build/es/visualizations/util/__tests__/getFilterText.spec.js +1 -1
  205. package/build/es/visualizations/util/axisId.js +1 -1
  206. package/build/es/visualizations/util/getFilterText.js +5 -13
  207. package/package.json +3 -4
  208. package/build/cjs/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -244
  209. package/build/es/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -220
@@ -1,4 +1,21 @@
1
1
  {
2
+ "view only": "view only",
3
+ "view and edit": "view and edit",
4
+ "all users ({{accessLevel}})": "all users ({{accessLevel}})",
5
+ "{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
6
+ "Shared with {{commaSeparatedListOfUsersAndGroups}}": "Shared with {{commaSeparatedListOfUsersAndGroups}}",
7
+ "Not shared with any users or groups": "Not shared with any users or groups",
8
+ "About this visualization": "About this visualization",
9
+ "No description": "No description",
10
+ "Last updated {{time}}": "Last updated {{time}}",
11
+ "Created {{time}} by {{author}}": "Created {{time}} by {{author}}",
12
+ "Viewed {{count}} times": "Viewed 1 time",
13
+ "Viewed {{count}} times_plural": "Viewed {{count}} times",
14
+ "Notifications": "Notifications",
15
+ "You're subscribed and getting updates about new interpretations.": "You're subscribed and getting updates about new interpretations.",
16
+ "Unsubscribe": "Unsubscribe",
17
+ "Subscribe to get updates about new interpretations.": "Subscribe to get updates about new interpretations.",
18
+ "Subscribe": "Subscribe",
2
19
  "Data Type": "Data Type",
3
20
  "All types": "All types",
4
21
  "Totals only": "Totals only",
@@ -101,11 +118,20 @@
101
118
  "Options": "Options",
102
119
  "Hide": "Hide",
103
120
  "Update": "Update",
121
+ "{{count}} org units": "{{count}} org unit",
122
+ "{{count}} org units_plural": "{{count}} org units",
123
+ "{{count}} levels": "{{count}} level",
124
+ "{{count}} levels_plural": "{{count}} levels",
125
+ "{{count}} groups": "{{count}} group",
126
+ "{{count}} groups_plural": "{{count}} groups",
127
+ "Selected: {{commaSeparatedListOfOrganisationUnits}}": "Selected: {{commaSeparatedListOfOrganisationUnits}}",
128
+ "Nothing selected": "Nothing selected",
104
129
  "User organisation unit": "User organisation unit",
105
130
  "User sub-units": "User sub-units",
106
131
  "User sub-x2-units": "User sub-x2-units",
107
132
  "Select a level": "Select a level",
108
133
  "Select a group": "Select a group",
134
+ "Deselect all": "Deselect all",
109
135
  "Period type": "Period type",
110
136
  "Year": "Year",
111
137
  "Select year": "Select year",
@@ -44,7 +44,7 @@ const getAxisNameByLayoutType = (axisId, layoutType) => {
44
44
  const name = getAxisNamesByLayoutType(layoutType)[axisId];
45
45
 
46
46
  if (!name) {
47
- throw new Error(`${axisId} is not a valid axis id`);
47
+ throw new Error("".concat(axisId, " is not a valid axis id"));
48
48
  }
49
49
 
50
50
  return name;
@@ -111,7 +111,7 @@ const getRulesByVisType = visType => {
111
111
  const rules = visTypeToRules[visType];
112
112
 
113
113
  if (!rules) {
114
- throw new Error(`${visType} is not a known visualization type`);
114
+ throw new Error("".concat(visType, " is not a known visualization type"));
115
115
  }
116
116
 
117
117
  return rules;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatList = void 0;
7
+
8
+ var _index = _interopRequireDefault(require("../locales/index.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const formatList = items => {
13
+ // Wrap Intl.ListFormat in try/catch as DHIS2 locales are not always ISO 639 compliant
14
+ try {
15
+ const formatter = new Intl.ListFormat(_index.default.language, {
16
+ style: 'long',
17
+ type: 'conjunction'
18
+ });
19
+ return formatter.format(items);
20
+ } catch (error) {
21
+ return items.join(', ');
22
+ }
23
+ };
24
+
25
+ exports.formatList = formatList;
@@ -24,8 +24,8 @@ const stripGroupPrefix = id => hasGroupPrefix(id) ? id.substr(GROUP_ID_PREFIX.le
24
24
  const removePrefix = id => stripGroupPrefix(stripLevelPrefix(id));
25
25
 
26
26
  const ouIdHelper = Object.freeze({
27
- addLevelPrefix: id => `${LEVEL_ID_PREFIX}-${removePrefix(id)}`,
28
- addGroupPrefix: id => `${GROUP_ID_PREFIX}-${removePrefix(id)}`,
27
+ addLevelPrefix: id => "".concat(LEVEL_ID_PREFIX, "-").concat(removePrefix(id)),
28
+ addGroupPrefix: id => "".concat(GROUP_ID_PREFIX, "-").concat(removePrefix(id)),
29
29
  removePrefix,
30
30
  hasGroupPrefix,
31
31
  hasLevelPrefix
@@ -369,7 +369,7 @@ class PivotTableEngine {
369
369
  }
370
370
 
371
371
  if (rowLevel === lastRowLevel && this.dimensionLookup.rows[lastRowLevel] && columnLevel === lastColumnLevel && this.dimensionLookup.columns[lastColumnLevel]) {
372
- return `${this.dimensionLookup.rows[lastRowLevel].meta.name} / ${this.dimensionLookup.columns[lastColumnLevel].meta.name}`;
372
+ return "".concat(this.dimensionLookup.rows[lastRowLevel].meta.name, " / ").concat(this.dimensionLookup.columns[lastColumnLevel].meta.name);
373
373
  }
374
374
 
375
375
  if (lastRowLevel === -1) {
@@ -963,12 +963,12 @@ class PivotTableEngine {
963
963
 
964
964
  sort(column, order) {
965
965
  if (order !== _pivotTableConstants.SORT_ORDER_ASCENDING && order !== _pivotTableConstants.SORT_ORDER_DESCENDING) {
966
- console.warn(`Invalid sort order ${order}`);
966
+ console.warn("Invalid sort order ".concat(order));
967
967
  return;
968
968
  }
969
969
 
970
970
  if (!this.isSortable(column)) {
971
- console.warn(`Invalid sort column ${column}`);
971
+ console.warn("Invalid sort column ".concat(column));
972
972
  return;
973
973
  }
974
974
 
@@ -15,7 +15,7 @@ const getContext = fontSize => {
15
15
  }
16
16
 
17
17
  const ctx = canvas.getContext('2d');
18
- ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
18
+ ctx.font = "".concat(fontSize, "px Roboto, Arial, sans-serif");
19
19
  return ctx;
20
20
  };
21
21
 
@@ -102,7 +102,7 @@ const getDisplayNameByVisType = visType => {
102
102
  const displayName = visTypeDisplayNames[visType];
103
103
 
104
104
  if (!displayName) {
105
- throw new Error(`${visType} is not a valid visualization type`);
105
+ throw new Error("".concat(visType, " is not a valid visualization type"));
106
106
  }
107
107
 
108
108
  return displayName;
@@ -97,7 +97,7 @@ function getTwoCategoryTrendLines(layout, series, isStacked) {
97
97
  });
98
98
  } else {
99
99
  series.forEach(seriesObj => {
100
- const trendlineSerieId = `trendline-${seriesObj.id}`;
100
+ const trendlineSerieId = "trendline-".concat(seriesObj.id);
101
101
  newSeries.push(seriesObj);
102
102
 
103
103
  if (!seriesObj.custom.isTwoCategoryFakeSerie) {
@@ -34,7 +34,7 @@ const getPlotLineLabelStyle = fontStyle => ({
34
34
  y: -7,
35
35
  style: {
36
36
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
37
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
37
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
38
38
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
39
39
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
40
40
  }
@@ -128,7 +128,7 @@ const getLabels = axis => {
128
128
  return {
129
129
  style: {
130
130
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
131
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
131
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
132
132
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
133
133
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
134
134
  },
@@ -20,7 +20,7 @@ const getTitleStyle = (fontStyle, titleType, visType) => fontStyle ? {
20
20
  margin: 15,
21
21
  style: {
22
22
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
23
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
23
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
24
24
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
25
25
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
26
26
  }
@@ -47,9 +47,9 @@ var _xAxis = _interopRequireDefault(require("./xAxis"));
47
47
 
48
48
  var _yAxis = _interopRequireDefault(require("./yAxis"));
49
49
 
50
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
50
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
51
51
 
52
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
52
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
53
53
 
54
54
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55
55
 
@@ -35,7 +35,7 @@ function getItemStyle(fontStyle, dashboard) {
35
35
  fontWeight: 'normal'
36
36
  }, dashboard ? DASHBOARD_ITEM_STYLE : {
37
37
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
38
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
38
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
39
39
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
40
40
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
41
41
  })
@@ -86,33 +86,22 @@ const formatLabel = ({
86
86
 
87
87
  if ((!seriesId || seriesId.startsWith('trendline')) && seriesType === (0, _type.default)(_visTypes.VIS_TYPE_LINE).type) {
88
88
  // trendline
89
- result.push(`<span style="height: ${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 6.5}px; width: ${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px; background-color: ${seriesColor}; display: inline-block;"></span>`);
90
- result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
89
+ result.push("<span style=\"height: ".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 6.5, "px; width: ").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px; background-color: ").concat(seriesColor, "; display: inline-block;\"></span>"));
90
+ result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
91
91
  } else if (legendSet !== null && legendSet !== void 0 && (_legendSet$legends = legendSet.legends) !== null && _legendSet$legends !== void 0 && _legendSet$legends.length && (0, _visTypes.isLegendSetType)(visType) && seriesType !== (0, _type.default)(_visTypes.VIS_TYPE_LINE).type) {
92
92
  // item with legend set
93
- legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[_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">
94
- <circle cx="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${legend.color}"></circle>
95
- </svg>`));
96
- result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
93
+ 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[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[_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[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
94
+ result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
97
95
  } else {
98
96
  // regular item (not a trendline, no applied legend set)
99
97
  if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
100
98
  const pattern = _colorSets.colorSets[_colorSets.COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
101
- result.push(`<svg xmlns="http://www.w3.org/2000/svg" style="height: ${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px; width: ${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px; display: inline-block; margin-right:5px" class="data-test-series-key-item-bullet">
102
- <defs>
103
- <pattern id="pattern${seriesColor.patternIndex}" patternUnits="userSpaceOnUse" width="${pattern.width}" height="${pattern.height}">
104
- <path stroke="${pattern.color}" d="${pattern.path}"/>
105
- </pattern>
106
- </defs>
107
- <circle cx="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="url(#pattern${seriesColor.patternIndex})"/>
108
- </svg>`);
99
+ result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"height: ".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[_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[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
109
100
  } else {
110
- result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}" version="1.1" style="margin-right:5px" class="data-test-series-key-item-bullet">
111
- <circle cx="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${seriesColor}"></circle>
112
- </svg>`);
101
+ result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[_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[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
113
102
  }
114
103
 
115
- result.push(`<span class="data-test-series-key-item-name">${seriesName}</span>`);
104
+ result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
116
105
  }
117
106
 
118
107
  result.push('</div>');
@@ -43,7 +43,7 @@ exports.applyLegendSet = applyLegendSet;
43
43
 
44
44
  const getLegendSetTooltip = () => ({
45
45
  pointFormatter: function () {
46
- return `<span style="color:${this.color}">●</span> ${this.series.name}: <b>${this.y}</b><br>` + (this.legend ? `${this.legendSet}: <b>${this.legend}</b>` : `${_index.default.t('No legend for this series')}`);
46
+ 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(_index.default.t('No legend for this series')));
47
47
  }
48
48
  });
49
49
 
@@ -41,7 +41,7 @@ var _default = ({
41
41
  }));
42
42
  }
43
43
 
44
- return `${labels.map(label => `<b>${label}</b><br>`).join('')}${yAxisName}: ${y}<br>${xAxisName}: ${x}`;
44
+ return "".concat(labels.map(label => "<b>".concat(label, "</b><br>")).join('')).concat(yAxisName, ": ").concat(y, "<br>").concat(xAxisName, ": ").concat(x);
45
45
  };
46
46
 
47
47
  switch (visType) {
@@ -73,7 +73,7 @@ function _default(series, layout, metaData, dashboard) {
73
73
  style: {
74
74
  // DHIS2-578: dynamically truncate subtitle when it's taking more than 1 line
75
75
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
76
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
76
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
77
77
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
78
78
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal',
79
79
  whiteSpace: 'nowrap',
@@ -77,7 +77,7 @@ function _default(layout, metaData, dashboard) {
77
77
  align: (0, _getTextAlignOption.getTextAlignOption)(fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN], _fontStyle.FONT_STYLE_VISUALIZATION_TITLE, (0, _visTypes.isVerticalType)(layout.type)),
78
78
  style: {
79
79
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
80
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
80
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
81
81
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
82
82
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal',
83
83
  whiteSpace: 'nowrap',
@@ -14,6 +14,6 @@ function _default(layout, metaData, dashboard) {
14
14
 
15
15
  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) {
16
16
  const columns = (0, _getFilterText.default)(layout.columns, metaData).split(', ');
17
- return `${(0, _getFilterText.default)(layout.rows, metaData)}: ${columns[0]} - ${columns[1]}`;
17
+ return "".concat((0, _getFilterText.default)(layout.rows, metaData), ": ").concat(columns[0], " - ").concat(columns[1]);
18
18
  }
19
19
  }
@@ -44,7 +44,7 @@ const getLabels = axis => {
44
44
  return {
45
45
  style: {
46
46
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
47
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
47
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
48
48
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
49
49
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
50
50
  },
@@ -68,12 +68,12 @@ function getPlotLine(regressionLine = {}, defaultLabel) {
68
68
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR] || '#000',
69
69
  ...(label && {
70
70
  label: {
71
- text: `${label}: ${value}`,
71
+ text: "".concat(label, ": ").concat(value),
72
72
  verticalAlign,
73
73
  y,
74
74
  style: {
75
75
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
76
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
76
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
77
77
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
78
78
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
79
79
  }
@@ -90,7 +90,7 @@ const getLabels = axis => {
90
90
  y: parseInt(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], 10) + 7,
91
91
  style: {
92
92
  color: fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
93
- fontSize: `${fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
93
+ fontSize: "".concat(fontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"),
94
94
  fontWeight: fontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
95
95
  fontStyle: fontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal'
96
96
  }
@@ -73,9 +73,9 @@ function getDefault(layout, series, extraOptions) {
73
73
  var _axis$title;
74
74
 
75
75
  rl.title = { ...rl.title,
76
- text: `${rl.title.text} - ${((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || _locales.default.t('Axis {{axisId}}', {
76
+ text: "".concat(rl.title.text, " - ").concat(((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || _locales.default.t('Axis {{axisId}}', {
77
77
  axisId: axis.index + 1
78
- })}`
78
+ }))
79
79
  };
80
80
  }
81
81
  });
@@ -24,7 +24,7 @@ const generateValueSVG = ({
24
24
  const textSize = 300;
25
25
  const svgValue = document.createElementNS(svgNS, 'svg');
26
26
  svgValue.setAttribute('xmlns', svgNS);
27
- svgValue.setAttribute('viewBox', `0 -${textSize + 50} ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
27
+ svgValue.setAttribute('viewBox', "0 -".concat(textSize + 50, " ").concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
28
28
 
29
29
  if (y) {
30
30
  svgValue.setAttribute('y', y);
@@ -52,7 +52,7 @@ const generateValueSVG = ({
52
52
  if (subText) {
53
53
  const svgSubText = document.createElementNS(svgNS, 'svg');
54
54
  const subTextSize = 40;
55
- svgSubText.setAttribute('viewBox', `0 -50 ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
55
+ svgSubText.setAttribute('viewBox', "0 -50 ".concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
56
56
 
57
57
  if (y) {
58
58
  svgSubText.setAttribute('y', y);
@@ -146,7 +146,7 @@ const generateDVItem = (config, {
146
146
  const svgNS = 'http://www.w3.org/2000/svg';
147
147
  const svg = document.createElementNS(svgNS, 'svg');
148
148
  svg.setAttribute('xmlns', svgNS);
149
- svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
149
+ svg.setAttribute('viewBox', "0 0 ".concat(width, " ").concat(height));
150
150
  svg.setAttribute('width', '100%');
151
151
  svg.setAttribute('height', '100%');
152
152
  svg.setAttribute('data-test', 'visualization-container');
@@ -155,7 +155,7 @@ const generateDVItem = (config, {
155
155
  title.setAttribute('x', getXFromTextAlign(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]));
156
156
  title.setAttribute('y', 28);
157
157
  title.setAttribute('text-anchor', getTextAnchorFromTextAlign(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]));
158
- title.setAttribute('font-size', `${titleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`);
158
+ title.setAttribute('font-size', "".concat(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"));
159
159
  title.setAttribute('font-weight', titleFontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal');
160
160
  title.setAttribute('font-style', titleFontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal');
161
161
  title.setAttribute('fill', titleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR]);
@@ -172,7 +172,7 @@ const generateDVItem = (config, {
172
172
  subtitle.setAttribute('y', 28);
173
173
  subtitle.setAttribute('dy', 22);
174
174
  subtitle.setAttribute('text-anchor', getTextAnchorFromTextAlign(subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]));
175
- subtitle.setAttribute('font-size', `${subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`);
175
+ subtitle.setAttribute('font-size', "".concat(subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE], "px"));
176
176
  subtitle.setAttribute('font-weight', subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal');
177
177
  subtitle.setAttribute('font-style', subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal');
178
178
  subtitle.setAttribute('fill', subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR]);
@@ -34,15 +34,15 @@ function _default({
34
34
  const _generator = _generators.default[outputFormat];
35
35
 
36
36
  if (_validator === _validators.default.noValidation) {
37
- onWarning(`No validation implementation for config input format "${inputFormat}"`);
37
+ onWarning("No validation implementation for config input format \"".concat(inputFormat, "\""));
38
38
  }
39
39
 
40
40
  if (!_adapter) {
41
- onError(`No config tranformation implementation for format "${inputFormat}" to format "${outputFormat}"`);
41
+ onError("No config tranformation implementation for format \"".concat(inputFormat, "\" to format \"").concat(outputFormat, "\""));
42
42
  }
43
43
 
44
44
  if (!_generator) {
45
- onError(`No visualization implementation for format ${outputFormat}`);
45
+ onError("No visualization implementation for format ".concat(outputFormat));
46
46
  }
47
47
 
48
48
  const DEFAULT_EXTRA_OPTIONS = {
@@ -41,7 +41,7 @@ function getDefault(acc, seriesIds, categoryIds, idValueMap, metaData) {
41
41
  seriesIds.forEach(seriesId => {
42
42
  const serieData = [];
43
43
  categoryIds.forEach(categoryId => {
44
- const value = idValueMap.get(`${seriesId}-${categoryId}`); // DHIS2-1261: 0 is a valid value
44
+ const value = idValueMap.get("".concat(seriesId, "-").concat(categoryId)); // DHIS2-1261: 0 is a valid value
45
45
  // undefined value means the key was not found within the rows
46
46
  // in that case null is returned as value in the serie
47
47
 
@@ -56,7 +56,7 @@ function getDefault(acc, series, categories, idValueMap, metaData) {
56
56
  series[0].forEach(serieItemId => {
57
57
  const serieData = [];
58
58
  categories[0].forEach(categoryItemId => {
59
- const value = idValueMap.get(`${serieItemId}-${categoryItemId}`); // DHIS2-1261: 0 is a valid value
59
+ const value = idValueMap.get("".concat(serieItemId, "-").concat(categoryItemId)); // DHIS2-1261: 0 is a valid value
60
60
  // undefined value means the key was not found within the rows
61
61
  // in that case null is returned as value in the serie
62
62
  // this is to keep the correct indexes for the values within the serie array
@@ -16,7 +16,7 @@ function _default(acc, series, categories, idValueMap, metaData) {
16
16
  categories[0].forEach(category1ItemId => {
17
17
  const groupData = [];
18
18
  categories[1].forEach(category2ItemId => {
19
- const value = idValueMap.get(`${seriesItemId}-${category1ItemId}-${category2ItemId}`);
19
+ const value = idValueMap.get("".concat(seriesItemId, "-").concat(category1ItemId, "-").concat(category2ItemId));
20
20
  groupData.push(value === undefined ? null : parseFloat(value));
21
21
  });
22
22
  groupedData.push(groupData);
@@ -25,11 +25,11 @@ function _default({
25
25
  const _adapter = _adapters.default[inputFormat + '_' + outputFormat];
26
26
 
27
27
  if (_validator === _validators.default.noValidation) {
28
- warning(`Validation not supported for data input format "${inputFormat}"`);
28
+ warning("Validation not supported for data input format \"".concat(inputFormat, "\""));
29
29
  }
30
30
 
31
31
  if (!_adapter) {
32
- error(`Data tranformation from "${inputFormat}" to "${outputFormat}" is not supported`);
32
+ error("Data tranformation from \"".concat(inputFormat, "\" to \"").concat(outputFormat, "\" is not supported"));
33
33
  }
34
34
 
35
35
  this.data = data;
@@ -133,7 +133,7 @@ describe('getFilterText', () => {
133
133
  name: '02 of 2018',
134
134
  uid: '_201802_'
135
135
  };
136
- expect((0, _getFilterText.default)(filters, metaData)).toEqual('Clinics, Hospital - Last 2 months');
136
+ expect((0, _getFilterText.default)(filters, metaData)).toEqual('Clinics, Hospital - 01 of 2018, 02 of 2018');
137
137
  });
138
138
  });
139
139
  });
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getAxisStringFromId = void 0;
7
7
  const AXIS_ID_PREFIX = 'AXIS_';
8
8
 
9
- const getAxisStringFromId = id => `${AXIS_ID_PREFIX}${id}`;
9
+ const getAxisStringFromId = id => "".concat(AXIS_ID_PREFIX).concat(id);
10
10
 
11
11
  exports.getAxisStringFromId = getAxisStringFromId;
@@ -31,15 +31,7 @@ function _default(filters, metaData) {
31
31
  }) => _ouIdHelper.ouIdHelper.hasGroupPrefix(id) || _ouIdHelper.ouIdHelper.hasLevelPrefix(id))) {
32
32
  titleFragments.push((0, _getOuLevelAndGroupText.getOuLevelAndGroupText)(filter, metaData));
33
33
  } else {
34
- let filterItems = [];
35
-
36
- if ((0, _dimensionIs.dimensionIs)(filter, _predefinedDimensions.DIMENSION_ID_PERIOD)) {
37
- filterItems = items.map(({
38
- id
39
- }) => id);
40
- } else {
41
- filterItems = metaData.dimensions[filter.dimension];
42
- }
34
+ const filterItems = metaData.dimensions[filter.dimension];
43
35
 
44
36
  if (Array.isArray(filterItems)) {
45
37
  l = filterItems.length;
@@ -54,9 +46,9 @@ function _default(filters, metaData) {
54
46
  } // otherwise use the values directly
55
47
  // this is a temporary fix to avoid app crashing when using filters with data items in EV
56
48
  else {
57
- sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
58
- break;
59
- }
49
+ sectionParts.push(metaData.items[filter.dimension].name + ': ' + filterItems.join(', '));
50
+ break;
51
+ }
60
52
  }
61
53
 
62
54
  titleFragments.push(sectionParts.join(', '));
@@ -12,7 +12,7 @@ const user = {
12
12
  username: 'admin'
13
13
  };
14
14
 
15
- const onFileSelect = id => alert(`Opening ${id}`);
15
+ const onFileSelect = id => alert("Opening ".concat(id));
16
16
 
17
17
  storiesOf('OpenFileDialog', module).add('List of visualizations', () => /*#__PURE__*/React.createElement(Provider, {
18
18
  config: configMock
@@ -8,14 +8,14 @@ const Wrapper = story => /*#__PURE__*/React.createElement(DataProvider, {
8
8
  apiVersion: ""
9
9
  }, story());
10
10
 
11
- const rootOrgUnit = 'ImspTQPwCqd'; // Sierra Leone
11
+ const defaultRootOrgUnits = ['ImspTQPwCqd']; // Sierra Leone
12
12
 
13
13
  storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('None selected', () => {
14
14
  const [selected, setSelected] = useState([]);
15
15
  return /*#__PURE__*/React.createElement(OrgUnitDimension, {
16
16
  selected: selected,
17
17
  onSelect: response => setSelected(response.items),
18
- root: rootOrgUnit
18
+ roots: defaultRootOrgUnits
19
19
  });
20
20
  });
21
21
  storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Root selected', () => {
@@ -27,7 +27,7 @@ storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Root selected',
27
27
  return /*#__PURE__*/React.createElement(OrgUnitDimension, {
28
28
  selected: selected,
29
29
  onSelect: response => setSelected(response.items),
30
- root: rootOrgUnit
30
+ roots: defaultRootOrgUnits
31
31
  });
32
32
  });
33
33
  storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Single level 2 child selected', () => {
@@ -39,7 +39,7 @@ storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Single level 2
39
39
  return /*#__PURE__*/React.createElement(OrgUnitDimension, {
40
40
  selected: selected,
41
41
  onSelect: response => setSelected(response.items),
42
- root: rootOrgUnit
42
+ roots: defaultRootOrgUnits
43
43
  });
44
44
  });
45
45
  storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Multiple level 2 children selected', () => {
@@ -59,7 +59,7 @@ storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Multiple level
59
59
  return /*#__PURE__*/React.createElement(OrgUnitDimension, {
60
60
  selected: selected,
61
61
  onSelect: response => setSelected(response.items),
62
- root: rootOrgUnit
62
+ roots: defaultRootOrgUnits
63
63
  });
64
64
  });
65
65
  storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Multiple selected across different levels', () => {
@@ -79,6 +79,15 @@ storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Multiple select
79
79
  return /*#__PURE__*/React.createElement(OrgUnitDimension, {
80
80
  selected: selected,
81
81
  onSelect: response => setSelected(response.items),
82
- root: rootOrgUnit
82
+ roots: defaultRootOrgUnits
83
+ });
84
+ });
85
+ storiesOf('OrgUnitDimension', module).addDecorator(Wrapper).add('Multiple roots', () => {
86
+ const [selected, setSelected] = useState([]);
87
+ return /*#__PURE__*/React.createElement(OrgUnitDimension, {
88
+ selected: selected,
89
+ onSelect: response => setSelected(response.items),
90
+ roots: ['O6uvpzGd5pu', 'fdc6uOvgoji'] // Bo + Bombali
91
+
83
92
  });
84
93
  });
@@ -76,7 +76,7 @@ const generateDimensionStrings = (dimensions = [], options) => {
76
76
  items.sort();
77
77
  }
78
78
 
79
- return `${dimension}:${items.join(';')}`;
79
+ return "".concat(dimension, ":").concat(items.join(';'));
80
80
  }
81
81
 
82
82
  return dimension;