@dhis2/analytics 21.0.0-alpha.3 → 21.0.0-alpha.4
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.
- package/build/cjs/__demo__/Filter.stories.js +2 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +1 -1
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +2 -2
- package/build/cjs/api/analytics/AnalyticsBase.js +1 -1
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -1
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +3 -3
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
- package/build/cjs/api/analytics/AnalyticsResponse.js +2 -2
- package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +1 -11
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
- package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
- package/build/cjs/api/analytics/utils.js +1 -1
- package/build/cjs/api/dimensions.js +37 -37
- package/build/cjs/api/organisationUnits.js +3 -3
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +226 -0
- package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +13 -0
- package/build/cjs/components/DataDimension/DataTypesSelector.js +3 -3
- package/build/cjs/components/DataDimension/DetailSelector.js +2 -2
- package/build/cjs/components/DataDimension/GroupSelector.js +9 -9
- package/build/cjs/components/DataDimension/ItemSelector.js +19 -19
- package/build/cjs/components/DataDimension/MetricSelector.js +3 -3
- package/build/cjs/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
- package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -1
- package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -1
- package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -1
- package/build/cjs/components/DimensionMenu.js +10 -10
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +2 -2
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +5 -5
- package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +2 -2
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +10 -10
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
- package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +4 -4
- package/build/cjs/components/DynamicDimension/ItemSelector.js +8 -8
- package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
- package/build/cjs/components/FileMenu/DeleteDialog.js +2 -2
- package/build/cjs/components/FileMenu/FileMenu.js +5 -5
- package/build/cjs/components/FileMenu/FileMenu.styles.js +1 -1
- package/build/cjs/components/FileMenu/GetLinkDialog.js +1 -1
- package/build/cjs/components/FileMenu/RenameDialog.js +2 -2
- package/build/cjs/components/FileMenu/SaveAsDialog.js +2 -2
- package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
- package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
- package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
- package/build/cjs/components/FileMenu/utils.js +3 -3
- package/build/cjs/components/Filter/Filter.js +1 -1
- package/build/cjs/components/Filter/styles/Filter.style.js +1 -1
- package/build/cjs/components/LegendKey/LegendKey.js +9 -9
- package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -1
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -2
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +21 -21
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
- package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
- package/build/cjs/components/Options/VisualizationOptions.js +2 -2
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +10 -10
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +23 -22
- package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +2 -2
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -5
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +4 -4
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +11 -11
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -2
- package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
- package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +49 -49
- package/build/cjs/components/PivotTable/PivotTable.js +2 -2
- package/build/cjs/components/PivotTable/PivotTableCell.js +3 -3
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
- package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -2
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +2 -2
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +2 -2
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +4 -4
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +2 -2
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -3
- package/build/cjs/components/TransferOption.js +5 -5
- package/build/cjs/components/styles/DimensionSelector.style.js +1 -1
- package/build/cjs/components/styles/TransferOption.style.js +1 -1
- package/build/cjs/index.js +10 -2
- package/build/cjs/locales/en/translations.json +18 -2
- package/build/cjs/modules/axis.js +1 -1
- package/build/cjs/modules/layoutUiRules/rules.js +1 -1
- package/build/cjs/modules/list.js +25 -0
- package/build/cjs/modules/ouIdHelper/index.js +2 -2
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +3 -3
- package/build/cjs/modules/pivotTable/measureText.js +1 -1
- package/build/cjs/modules/visTypes.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +8 -19
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
- package/build/cjs/visualizations/config/generators/dhis/singleValue.js +5 -5
- package/build/cjs/visualizations/config/index.js +3 -3
- package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +1 -1
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
- package/build/cjs/visualizations/store/index.js +2 -2
- package/build/cjs/visualizations/util/__tests__/getFilterText.spec.js +1 -1
- package/build/cjs/visualizations/util/axisId.js +1 -1
- package/build/cjs/visualizations/util/getFilterText.js +4 -12
- package/build/es/__demo__/OpenFileDialog.stories.js +1 -1
- package/build/es/api/analytics/AnalyticsBase.js +1 -1
- package/build/es/api/analytics/AnalyticsRequest.js +1 -1
- package/build/es/api/analytics/AnalyticsRequestBase.js +3 -3
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
- package/build/es/api/analytics/AnalyticsResponse.js +2 -2
- package/build/es/api/analytics/__tests__/AnalyticsAggregate.spec.js +1 -11
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
- package/build/es/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
- package/build/es/api/analytics/utils.js +1 -1
- package/build/es/api/dimensions.js +39 -39
- package/build/es/api/organisationUnits.js +3 -3
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +203 -0
- package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +4 -0
- package/build/es/components/DataDimension/DataTypesSelector.js +3 -3
- package/build/es/components/DataDimension/DetailSelector.js +2 -2
- package/build/es/components/DataDimension/GroupSelector.js +7 -7
- package/build/es/components/DataDimension/ItemSelector.js +17 -17
- package/build/es/components/DataDimension/MetricSelector.js +3 -3
- package/build/es/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
- package/build/es/components/DimensionMenu.js +10 -10
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +3 -3
- package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
- package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
- package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
- package/build/es/components/DynamicDimension/DynamicDimension.js +4 -4
- package/build/es/components/DynamicDimension/ItemSelector.js +6 -6
- package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
- package/build/es/components/FileMenu/FileMenu.js +3 -3
- package/build/es/components/FileMenu/FileMenu.styles.js +1 -1
- package/build/es/components/FileMenu/GetLinkDialog.js +1 -1
- package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
- package/build/es/components/FileMenu/utils.js +3 -3
- package/build/es/components/Filter/Filter.js +1 -1
- package/build/es/components/Filter/styles/Filter.style.js +1 -1
- package/build/es/components/LegendKey/LegendKey.js +9 -9
- package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -2
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +19 -19
- package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
- package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
- package/build/es/components/Options/styles/VisualizationOptions.style.js +10 -10
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +20 -20
- package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +2 -2
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -5
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +8 -8
- package/build/es/components/PeriodDimension/PeriodTransfer.js +9 -9
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +2 -2
- package/build/es/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
- package/build/es/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +49 -49
- package/build/es/components/PivotTable/PivotTableCell.js +3 -3
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
- package/build/es/components/PivotTable/PivotTableContainer.js +2 -2
- package/build/es/components/PivotTable/PivotTableSortIcon.js +2 -2
- package/build/es/components/PivotTable/PivotTableTitleRow.js +2 -2
- package/build/es/components/PivotTable/styles/PivotTable.style.js +3 -3
- package/build/es/components/TransferOption.js +17 -17
- package/build/es/components/styles/DimensionSelector.style.js +1 -1
- package/build/es/components/styles/TransferOption.style.js +1 -1
- package/build/es/index.js +2 -1
- package/build/es/locales/en/translations.json +18 -2
- package/build/es/modules/axis.js +1 -1
- package/build/es/modules/layoutUiRules/rules.js +1 -1
- package/build/es/modules/list.js +13 -0
- package/build/es/modules/ouIdHelper/index.js +2 -2
- package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
- package/build/es/modules/pivotTable/measureText.js +1 -1
- package/build/es/modules/visTypes.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +8 -19
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
- package/build/es/visualizations/config/generators/dhis/singleValue.js +5 -5
- package/build/es/visualizations/config/index.js +3 -3
- package/build/es/visualizations/store/adapters/dhis_dhis/index.js +1 -1
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
- package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
- package/build/es/visualizations/store/index.js +2 -2
- package/build/es/visualizations/util/__tests__/getFilterText.spec.js +1 -1
- package/build/es/visualizations/util/axisId.js +1 -1
- package/build/es/visualizations/util/getFilterText.js +5 -13
- package/package.json +2 -2
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -244
- package/build/es/components/OrgUnitDimension/OrgUnitDimensionOld.js +0 -220
|
@@ -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 =>
|
|
28
|
-
addGroupPrefix: 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
|
|
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(
|
|
966
|
+
console.warn("Invalid sort order ".concat(order));
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
969
|
|
|
970
970
|
if (!this.isSortable(column)) {
|
|
971
|
-
console.warn(
|
|
971
|
+
console.warn("Invalid sort column ".concat(column));
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
974
|
|
|
@@ -102,7 +102,7 @@ const getDisplayNameByVisType = visType => {
|
|
|
102
102
|
const displayName = visTypeDisplayNames[visType];
|
|
103
103
|
|
|
104
104
|
if (!displayName) {
|
|
105
|
-
throw new Error(
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
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(
|
|
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
|
|
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:
|
|
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(
|
|
90
|
-
result.push(
|
|
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(
|
|
94
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
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(
|
|
37
|
+
onWarning("No validation implementation for config input format \"".concat(inputFormat, "\""));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (!_adapter) {
|
|
41
|
-
onError(
|
|
41
|
+
onError("No config tranformation implementation for format \"".concat(inputFormat, "\" to format \"").concat(outputFormat, "\""));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if (!_generator) {
|
|
45
|
-
onError(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
28
|
+
warning("Validation not supported for data input format \"".concat(inputFormat, "\""));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if (!_adapter) {
|
|
32
|
-
error(
|
|
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 -
|
|
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 =>
|
|
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
|
-
|
|
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
|
-
|
|
58
|
-
|
|
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(
|
|
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
|
|
@@ -46,7 +46,7 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
46
46
|
let dimension = d.dimension;
|
|
47
47
|
|
|
48
48
|
if (d.filter) {
|
|
49
|
-
dimension +=
|
|
49
|
+
dimension += ":".concat(d.filter);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
request = request.addDimension(dimension, d.items.map(item => item.id));
|
|
@@ -62,13 +62,13 @@ class AnalyticsRequestBase {
|
|
|
62
62
|
encodedItems.sort();
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
return
|
|
65
|
+
return "".concat(dimension, ":").concat(encodedItems.join(';'));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return dimension;
|
|
69
69
|
});
|
|
70
70
|
const endPoint = [this.endPoint, this.path, this.program].filter(e => !!e).join('/');
|
|
71
|
-
return
|
|
71
|
+
return "".concat(endPoint, ".").concat(this.format, "?dimension=").concat(encodedDimensions.join('&dimension='));
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* @private
|
|
@@ -103,7 +103,7 @@ class AnalyticsRequestBase {
|
|
|
103
103
|
encodedItems.sort();
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
return
|
|
106
|
+
return "".concat(dimension, ":").concat(encodedItems.join(';'));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
return dimension;
|
|
@@ -97,7 +97,7 @@ class extends base {
|
|
|
97
97
|
if (aggregationTypes.has(aggregationType)) {
|
|
98
98
|
this.parameters.aggregationType = aggregationType;
|
|
99
99
|
} else if (aggregationType !== 'DEFAULT') {
|
|
100
|
-
console.warn(
|
|
100
|
+
console.warn("analytics.request.withAggregationType(): \"".concat(value, "\" not listed as possible value"));
|
|
101
101
|
this.parameters.aggregationType = value;
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -333,7 +333,7 @@ class extends base {
|
|
|
333
333
|
if (displayProperties.has(displayProperty)) {
|
|
334
334
|
this.parameters.displayProperty = displayProperty;
|
|
335
335
|
} else {
|
|
336
|
-
console.warn(
|
|
336
|
+
console.warn("analytics.request.withDisplayProperty(): \"".concat(value, "\" not listed as possible value"));
|
|
337
337
|
this.parameters.displayProperty = value;
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -580,7 +580,7 @@ class extends base {
|
|
|
580
580
|
if (eventStatuses.has(eventStatus)) {
|
|
581
581
|
this.parameters.eventStatus = eventStatus;
|
|
582
582
|
} else {
|
|
583
|
-
console.warn(
|
|
583
|
+
console.warn("analytics.request.withEventStatus(): \"".concat(value, "\" not listed as possible value"));
|
|
584
584
|
this.parameters.eventStatus = value;
|
|
585
585
|
}
|
|
586
586
|
|
|
@@ -606,7 +606,7 @@ class extends base {
|
|
|
606
606
|
if (programStatuses.has(programStatus)) {
|
|
607
607
|
this.parameters.programStatus = programStatus;
|
|
608
608
|
} else {
|
|
609
|
-
console.warn(
|
|
609
|
+
console.warn("analytics.request.withProgramStatus(): \"".concat(value, "\" not listed as possible value"));
|
|
610
610
|
this.parameters.programStatus = value;
|
|
611
611
|
}
|
|
612
612
|
|
|
@@ -632,7 +632,7 @@ class extends base {
|
|
|
632
632
|
if (ouModes.has(ouMode)) {
|
|
633
633
|
this.parameters.ouMode = ouMode;
|
|
634
634
|
} else {
|
|
635
|
-
console.warn(
|
|
635
|
+
console.warn("analytics.request.withOuMode(): \"".concat(value, "\" not listed as possible value"));
|
|
636
636
|
this.parameters.ouMode = value;
|
|
637
637
|
}
|
|
638
638
|
|
|
@@ -770,7 +770,7 @@ class extends base {
|
|
|
770
770
|
if (sortOrders.has(sortOrder)) {
|
|
771
771
|
this.parameters.sortOrder = sortOrder;
|
|
772
772
|
} else {
|
|
773
|
-
console.warn(
|
|
773
|
+
console.warn("analytics.request.withSortOrder(): \"".concat(value, "\" not listed as possible value"));
|
|
774
774
|
this.parameters.sortOrder = value;
|
|
775
775
|
}
|
|
776
776
|
|
|
@@ -817,7 +817,7 @@ class extends base {
|
|
|
817
817
|
if (outputTypes.has(type)) {
|
|
818
818
|
this.parameters.outputType = type;
|
|
819
819
|
} else {
|
|
820
|
-
console.warn(
|
|
820
|
+
console.warn("analytics.request.withOutputType(): \"".concat(value, "\" not listed as possible value"));
|
|
821
821
|
this.parameters.outputType = value;
|
|
822
822
|
}
|
|
823
823
|
|
|
@@ -14,7 +14,7 @@ const getParseMiddleware = type => {
|
|
|
14
14
|
switch (type) {
|
|
15
15
|
case 'STRING':
|
|
16
16
|
case 'TEXT':
|
|
17
|
-
return value =>
|
|
17
|
+
return value => "".concat(value);
|
|
18
18
|
|
|
19
19
|
case 'INTEGER':
|
|
20
20
|
case 'NUMBER':
|
|
@@ -41,7 +41,7 @@ const isCollectHeader = (header, dimensions) => {
|
|
|
41
41
|
return Boolean(Array.isArray(dimensions) && dimensions.length === 0);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const getPrefixedId = (id, prefix) =>
|
|
44
|
+
const getPrefixedId = (id, prefix) => "".concat(prefix || '', " ").concat(id);
|
|
45
45
|
|
|
46
46
|
const getNameByIdsByValueType = (id, valueType) => {
|
|
47
47
|
if (valueType === 'BOOLEAN') {
|