@dhis2/analytics 23.8.4 → 23.8.7
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/CHANGELOG.md +23 -0
- package/build/cjs/__demo__/FileMenu.stories.js +4 -2
- 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 +4 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +206 -153
- package/build/cjs/api/__tests__/dimensions.spec.js +2 -1
- package/build/cjs/api/analytics/Analytics.js +8 -7
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -43
- package/build/cjs/api/analytics/AnalyticsRequest.js +2 -1
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/cjs/api/dimensions.js +150 -120
- package/build/cjs/api/organisationUnits.js +36 -24
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +22 -13
- package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
- package/build/cjs/components/CachedDataQueryProvider.js +8 -7
- package/build/cjs/components/DataDimension/DataDimension.js +8 -6
- package/build/cjs/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/cjs/components/DataDimension/DetailSelector.js +6 -5
- package/build/cjs/components/DataDimension/GroupSelector.js +12 -11
- package/build/cjs/components/DataDimension/ItemSelector.js +87 -73
- package/build/cjs/components/DataDimension/MetricSelector.js +6 -5
- package/build/cjs/components/DimensionMenu.js +14 -13
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/cjs/components/DynamicDimension/ItemSelector.js +58 -44
- package/build/cjs/components/FileMenu/DeleteDialog.js +16 -12
- package/build/cjs/components/FileMenu/FileMenu.js +19 -18
- package/build/cjs/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/cjs/components/FileMenu/RenameDialog.js +38 -25
- package/build/cjs/components/FileMenu/SaveAsDialog.js +21 -14
- package/build/cjs/components/FileMenu/utils.js +1 -1
- package/build/cjs/components/Filter/Filter.js +22 -19
- package/build/cjs/components/LegendKey/LegendKey.js +4 -3
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/cjs/components/OpenFileDialog/DateField.js +4 -3
- package/build/cjs/components/OpenFileDialog/FileList.js +22 -19
- package/build/cjs/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +43 -35
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/cjs/components/OpenFileDialog/utils.js +1 -1
- package/build/cjs/components/Options/VisualizationOptions.js +46 -36
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +1 -1
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +50 -34
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +19 -14
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +24 -19
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +1 -1
- package/build/cjs/components/PeriodDimension/utils/index.js +6 -2
- package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.js +10 -9
- package/build/cjs/components/PivotTable/PivotTableBody.js +29 -20
- package/build/cjs/components/PivotTable/PivotTableCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/cjs/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +7 -6
- package/build/cjs/components/PivotTable/PivotTableHead.js +16 -13
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableRow.js +27 -20
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +8 -7
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +1 -1
- package/build/cjs/components/TransferOption.js +15 -13
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +25 -18
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +9 -8
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/cjs/components/VisTypeIcon.js +6 -5
- package/build/cjs/index.js +464 -464
- package/build/cjs/locales/ar/translations.json +1 -1
- package/build/cjs/locales/ar_EG/translations.json +1 -1
- package/build/cjs/locales/ar_IQ/translations.json +1 -1
- package/build/cjs/locales/ckb/translations.json +1 -1
- package/build/cjs/locales/cs/translations.json +1 -1
- package/build/cjs/locales/da/translations.json +1 -1
- package/build/cjs/locales/en/translations.json +1 -1
- package/build/cjs/locales/es/translations.json +1 -1
- package/build/cjs/locales/fr/translations.json +1 -1
- package/build/cjs/locales/id/translations.json +1 -1
- package/build/cjs/locales/km/translations.json +1 -1
- package/build/cjs/locales/lo/translations.json +1 -1
- package/build/cjs/locales/my/translations.json +1 -1
- package/build/cjs/locales/nb/translations.json +1 -1
- package/build/cjs/locales/nl/translations.json +30 -30
- package/build/cjs/locales/prs/translations.json +1 -1
- package/build/cjs/locales/ps/translations.json +1 -1
- package/build/cjs/locales/pt/translations.json +1 -1
- package/build/cjs/locales/pt_BR/translations.json +1 -1
- package/build/cjs/locales/ru/translations.json +1 -1
- package/build/cjs/locales/sv/translations.json +1 -1
- package/build/cjs/locales/tet/translations.json +1 -1
- package/build/cjs/locales/tg/translations.json +1 -1
- package/build/cjs/locales/uk/translations.json +1 -1
- package/build/cjs/locales/ur/translations.json +1 -1
- package/build/cjs/locales/uz/translations.json +1 -1
- package/build/cjs/locales/uz_Latn/translations.json +1 -1
- package/build/cjs/locales/vi/translations.json +1 -1
- package/build/cjs/locales/zh/translations.json +1 -1
- package/build/cjs/locales/zh_CN/translations.json +1 -1
- package/build/cjs/modules/axis.js +1 -1
- package/build/cjs/modules/dataSets.js +1 -1
- package/build/cjs/modules/dataTypes.js +2 -2
- package/build/cjs/modules/dimensionSelectorHelper.js +1 -1
- package/build/cjs/modules/fontStyle.js +1 -1
- package/build/cjs/modules/layout/axis.js +1 -1
- package/build/cjs/modules/layout/dimension.js +1 -1
- package/build/cjs/modules/layout/dimensionCreate.js +3 -1
- package/build/cjs/modules/layout/dimensionIsValid.js +5 -3
- package/build/cjs/modules/layout/item.js +1 -1
- package/build/cjs/modules/layout/testResources.js +1 -1
- package/build/cjs/modules/layoutTypes.js +1 -1
- package/build/cjs/modules/layoutUiRules/index.js +20 -20
- package/build/cjs/modules/layoutUiRules/rules.js +1 -1
- package/build/cjs/modules/layoutUiRules/rulesHelper.js +2 -1
- package/build/cjs/modules/layoutUiRules/rulesUtils.js +1 -1
- package/build/cjs/modules/legends.js +1 -1
- package/build/cjs/modules/outliers/index.js +4 -2
- package/build/cjs/modules/outliers/iqr.js +8 -5
- package/build/cjs/modules/outliers/modZScore.js +15 -7
- package/build/cjs/modules/outliers/zScore.js +5 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/cjs/modules/pivotTable/clipAxis.js +8 -7
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/cjs/modules/pivotTable/measureText.js +10 -7
- package/build/cjs/modules/pivotTable/pivotTableConstants.js +1 -1
- package/build/cjs/modules/pivotTable/useParentSize.js +2 -1
- package/build/cjs/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/cjs/modules/pivotTable/useTableClipping.js +7 -6
- package/build/cjs/modules/predefinedDimensions.js +2 -2
- package/build/cjs/modules/relativeItems/index.js +4 -1
- package/build/cjs/modules/valueTypes.js +1 -1
- package/build/cjs/modules/visTypes.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +9 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +5 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +9 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +11 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +24 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- 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 -1
- package/build/cjs/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/cjs/visualizations/config/index.js +13 -11
- package/build/cjs/visualizations/config/validators/dhis/index.js +4 -3
- package/build/cjs/visualizations/index.js +6 -2
- package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/cjs/visualizations/store/index.js +18 -15
- package/build/cjs/visualizations/store/validators/dhis/index.js +7 -5
- package/build/cjs/visualizations/util/colors/colorSets.js +1 -1
- package/build/cjs/visualizations/util/colors/themes.js +1 -1
- package/build/cjs/visualizations/util/getFilterText.js +9 -6
- package/build/es/__demo__/FileMenu.stories.js +4 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +4 -2
- package/build/es/__demo__/PivotTable.stories.js +204 -151
- package/build/es/api/__tests__/dimensions.spec.js +2 -1
- package/build/es/api/analytics/Analytics.js +8 -7
- package/build/es/api/analytics/AnalyticsBase.js +58 -43
- package/build/es/api/analytics/AnalyticsRequest.js +2 -1
- package/build/es/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/es/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/es/api/dimensions.js +149 -119
- package/build/es/api/organisationUnits.js +35 -23
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +20 -11
- package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
- package/build/es/components/CachedDataQueryProvider.js +6 -5
- package/build/es/components/DataDimension/DataDimension.js +8 -6
- package/build/es/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/es/components/DataDimension/DetailSelector.js +6 -5
- package/build/es/components/DataDimension/GroupSelector.js +10 -9
- package/build/es/components/DataDimension/ItemSelector.js +85 -71
- package/build/es/components/DataDimension/MetricSelector.js +6 -5
- package/build/es/components/DimensionMenu.js +14 -13
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionLabel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionList.js +2 -2
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/es/components/DynamicDimension/ItemSelector.js +56 -42
- package/build/es/components/FileMenu/DeleteDialog.js +14 -10
- package/build/es/components/FileMenu/FileMenu.js +17 -16
- package/build/es/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/es/components/FileMenu/RenameDialog.js +36 -23
- package/build/es/components/FileMenu/SaveAsDialog.js +19 -12
- package/build/es/components/Filter/Filter.js +22 -19
- package/build/es/components/LegendKey/LegendKey.js +4 -3
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/es/components/OpenFileDialog/DateField.js +4 -3
- package/build/es/components/OpenFileDialog/FileList.js +22 -19
- package/build/es/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +41 -33
- package/build/es/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/es/components/Options/VisualizationOptions.js +43 -33
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +48 -32
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +17 -12
- package/build/es/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/es/components/PeriodDimension/PeriodTransfer.js +22 -17
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/es/components/PeriodDimension/utils/index.js +5 -1
- package/build/es/components/PivotTable/PivotTable.js +8 -7
- package/build/es/components/PivotTable/PivotTableBody.js +29 -20
- package/build/es/components/PivotTable/PivotTableCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/es/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/es/components/PivotTable/PivotTableEngineContext.js +5 -4
- package/build/es/components/PivotTable/PivotTableHead.js +16 -13
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableRow.js +27 -20
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/es/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/es/components/PivotTable/PivotTableTitleRow.js +7 -6
- package/build/es/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/es/components/PivotTable/PivotTableValueCell.js +6 -5
- package/build/es/components/TransferOption.js +15 -13
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +23 -16
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -6
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/es/components/VisTypeIcon.js +6 -5
- package/build/es/locales/ar/translations.json +1 -1
- package/build/es/locales/ar_EG/translations.json +1 -1
- package/build/es/locales/ar_IQ/translations.json +1 -1
- package/build/es/locales/ckb/translations.json +1 -1
- package/build/es/locales/cs/translations.json +1 -1
- package/build/es/locales/da/translations.json +1 -1
- package/build/es/locales/en/translations.json +1 -1
- package/build/es/locales/es/translations.json +1 -1
- package/build/es/locales/fr/translations.json +1 -1
- package/build/es/locales/id/translations.json +1 -1
- package/build/es/locales/km/translations.json +1 -1
- package/build/es/locales/lo/translations.json +1 -1
- package/build/es/locales/my/translations.json +1 -1
- package/build/es/locales/nb/translations.json +1 -1
- package/build/es/locales/nl/translations.json +30 -30
- package/build/es/locales/prs/translations.json +1 -1
- package/build/es/locales/ps/translations.json +1 -1
- package/build/es/locales/pt/translations.json +1 -1
- package/build/es/locales/pt_BR/translations.json +1 -1
- package/build/es/locales/ru/translations.json +1 -1
- package/build/es/locales/sv/translations.json +1 -1
- package/build/es/locales/tet/translations.json +1 -1
- package/build/es/locales/tg/translations.json +1 -1
- package/build/es/locales/uk/translations.json +1 -1
- package/build/es/locales/ur/translations.json +1 -1
- package/build/es/locales/uz/translations.json +1 -1
- package/build/es/locales/uz_Latn/translations.json +1 -1
- package/build/es/locales/vi/translations.json +1 -1
- package/build/es/locales/zh/translations.json +1 -1
- package/build/es/locales/zh_CN/translations.json +1 -1
- package/build/es/modules/layout/dimensionCreate.js +3 -1
- package/build/es/modules/layout/dimensionIsValid.js +5 -3
- package/build/es/modules/outliers/index.js +3 -1
- package/build/es/modules/outliers/iqr.js +7 -4
- package/build/es/modules/outliers/modZScore.js +14 -6
- package/build/es/modules/outliers/zScore.js +4 -3
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/es/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/es/modules/pivotTable/clipAxis.js +8 -7
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/es/modules/pivotTable/measureText.js +10 -7
- package/build/es/modules/pivotTable/useParentSize.js +2 -1
- package/build/es/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/es/modules/pivotTable/useTableClipping.js +7 -6
- package/build/es/modules/predefinedDimensions.js +1 -1
- package/build/es/modules/relativeItems/index.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_dhis/index.js +6 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +8 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +6 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +9 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +23 -19
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
- package/build/es/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/es/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/es/visualizations/config/index.js +13 -11
- package/build/es/visualizations/config/validators/dhis/index.js +4 -3
- package/build/es/visualizations/index.js +5 -1
- package/build/es/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/es/visualizations/store/index.js +18 -15
- package/build/es/visualizations/store/validators/dhis/index.js +7 -5
- package/build/es/visualizations/util/getFilterText.js +9 -6
- package/package.json +11 -11
|
@@ -5,7 +5,8 @@ var _dimensions = require("../dimensions.js");
|
|
|
5
5
|
let mockDataEngine;
|
|
6
6
|
let mockQueryFn;
|
|
7
7
|
|
|
8
|
-
const asyncCheckMatches = (
|
|
8
|
+
const asyncCheckMatches = (_ref, done) => {
|
|
9
|
+
let [queryDefinition, queryVariables, callCount = 1, callIndex = 0] = _ref;
|
|
9
10
|
setTimeout(() => {
|
|
10
11
|
expect(mockQueryFn).toHaveBeenCalledTimes(callCount);
|
|
11
12
|
expect(mockQueryFn.mock.calls[callIndex][0]).toEqual(queryDefinition);
|
|
@@ -50,13 +50,14 @@ class Analytics {
|
|
|
50
50
|
* @param {!module:analytics.AnalyticsRequest} analyticsRequest The AnalyticsRequest class
|
|
51
51
|
* @param {!module:analytics.AnalyticsResponse} analyticsResponse The AnalyticsResponse class
|
|
52
52
|
*/
|
|
53
|
-
constructor({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
constructor(_ref) {
|
|
54
|
+
let {
|
|
55
|
+
aggregate,
|
|
56
|
+
enrollments,
|
|
57
|
+
events,
|
|
58
|
+
request,
|
|
59
|
+
response
|
|
60
|
+
} = _ref;
|
|
60
61
|
this.aggregate = aggregate;
|
|
61
62
|
this.enrollments = enrollments;
|
|
62
63
|
this.events = events;
|
|
@@ -13,35 +13,41 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
|
|
14
14
|
const analyticsQuery = {
|
|
15
15
|
resource: 'analytics',
|
|
16
|
-
id:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
id: _ref => {
|
|
17
|
+
let {
|
|
18
|
+
path,
|
|
19
|
+
program
|
|
20
|
+
} = _ref;
|
|
20
21
|
return [path, program].filter(Boolean).join('/');
|
|
21
22
|
},
|
|
22
|
-
params:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
params: _ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
dimensions,
|
|
26
|
+
filters,
|
|
27
|
+
parameters
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return {
|
|
30
|
+
dimension: dimensions,
|
|
31
|
+
filter: filters,
|
|
32
|
+
...parameters
|
|
33
|
+
};
|
|
34
|
+
}
|
|
31
35
|
};
|
|
32
36
|
const analyticsDataQuery = {
|
|
33
37
|
resource: 'analytics',
|
|
34
|
-
id:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
id: _ref3 => {
|
|
39
|
+
let {
|
|
40
|
+
path,
|
|
41
|
+
program
|
|
42
|
+
} = _ref3;
|
|
38
43
|
return [path, program].filter(Boolean).join('/');
|
|
39
44
|
},
|
|
40
|
-
params:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
params: _ref4 => {
|
|
46
|
+
let {
|
|
47
|
+
dimensions,
|
|
48
|
+
filters,
|
|
49
|
+
parameters
|
|
50
|
+
} = _ref4;
|
|
45
51
|
return {
|
|
46
52
|
dimension: dimensions,
|
|
47
53
|
filter: filters,
|
|
@@ -53,35 +59,44 @@ const analyticsDataQuery = {
|
|
|
53
59
|
};
|
|
54
60
|
const analyticsMetaDataQuery = {
|
|
55
61
|
resource: 'analytics',
|
|
56
|
-
id:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
id: _ref5 => {
|
|
63
|
+
let {
|
|
64
|
+
path,
|
|
65
|
+
program
|
|
66
|
+
} = _ref5;
|
|
60
67
|
return [path, program].filter(Boolean).join('/');
|
|
61
68
|
},
|
|
62
|
-
params:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
params: _ref6 => {
|
|
70
|
+
let {
|
|
71
|
+
dimensions,
|
|
72
|
+
filters,
|
|
73
|
+
parameters
|
|
74
|
+
} = _ref6;
|
|
75
|
+
return {
|
|
76
|
+
dimension: dimensions,
|
|
77
|
+
filter: filters,
|
|
78
|
+
...parameters,
|
|
79
|
+
skipMeta: false,
|
|
80
|
+
skipData: true,
|
|
81
|
+
includeMetadataDetails: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
74
84
|
};
|
|
75
85
|
|
|
76
|
-
const generateDimensionStrings = (
|
|
86
|
+
const generateDimensionStrings = function () {
|
|
87
|
+
let dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
88
|
+
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
89
|
+
|
|
77
90
|
if (options && options.sorted) {
|
|
78
91
|
dimensions = (0, _sortBy.default)(dimensions, 'dimension');
|
|
79
92
|
}
|
|
80
93
|
|
|
81
|
-
return dimensions.map(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
return dimensions.map(_ref7 => {
|
|
95
|
+
let {
|
|
96
|
+
dimension,
|
|
97
|
+
items
|
|
98
|
+
} = _ref7;
|
|
99
|
+
|
|
85
100
|
if (Array.isArray(items) && items.length) {
|
|
86
101
|
if (options && options.sorted) {
|
|
87
102
|
items.sort();
|
|
@@ -50,7 +50,8 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
50
50
|
*
|
|
51
51
|
* // dimension=pe:last_12_month&dimension=dx:fbfjhsppuqd;cyeuwxtcpku;jtf34knzhzp;hfdmmspbglg&dimension=ou:imsptqpwcqd
|
|
52
52
|
*/
|
|
53
|
-
fromVisualization(visualization
|
|
53
|
+
fromVisualization(visualization) {
|
|
54
|
+
let passFilterAsDimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
54
55
|
let request = this; // extract dimensions from visualization
|
|
55
56
|
|
|
56
57
|
const columns = visualization.columns || [];
|
|
@@ -22,15 +22,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
* @abstract
|
|
23
23
|
*/
|
|
24
24
|
class AnalyticsRequestBase {
|
|
25
|
-
constructor({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
constructor() {
|
|
26
|
+
let {
|
|
27
|
+
endPoint = 'analytics',
|
|
28
|
+
format = 'json',
|
|
29
|
+
path,
|
|
30
|
+
program,
|
|
31
|
+
dimensions = [],
|
|
32
|
+
filters = [],
|
|
33
|
+
parameters = {}
|
|
34
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
34
35
|
this.endPoint = endPoint;
|
|
35
36
|
this.format = format.toLowerCase();
|
|
36
37
|
this.path = path;
|
|
@@ -61,10 +62,12 @@ class AnalyticsRequestBase {
|
|
|
61
62
|
dimensions = (0, _sortBy.default)(dimensions, 'dimension');
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
const encodedDimensions = dimensions.map(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const encodedDimensions = dimensions.map(_ref => {
|
|
66
|
+
let {
|
|
67
|
+
dimension,
|
|
68
|
+
items
|
|
69
|
+
} = _ref;
|
|
70
|
+
|
|
68
71
|
if (Array.isArray(items) && items.length) {
|
|
69
72
|
const encodedItems = items.map(_utils.customEncodeURIComponent);
|
|
70
73
|
|
|
@@ -102,10 +105,12 @@ class AnalyticsRequestBase {
|
|
|
102
105
|
filters = (0, _sortBy.default)(filters, 'dimension');
|
|
103
106
|
}
|
|
104
107
|
|
|
105
|
-
const encodedFilters = filters.map(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
const encodedFilters = filters.map(_ref2 => {
|
|
109
|
+
let {
|
|
110
|
+
dimension,
|
|
111
|
+
items
|
|
112
|
+
} = _ref2;
|
|
113
|
+
|
|
109
114
|
if (Array.isArray(items) && items.length) {
|
|
110
115
|
const encodedItems = items.map(_utils.customEncodeURIComponent);
|
|
111
116
|
|
|
@@ -83,7 +83,8 @@ class extends base {
|
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
withFormat(
|
|
86
|
+
withFormat() {
|
|
87
|
+
let format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'json';
|
|
87
88
|
this.format = format;
|
|
88
89
|
return new _AnalyticsRequest.default(this);
|
|
89
90
|
}
|
|
@@ -166,7 +167,8 @@ class extends base {
|
|
|
166
167
|
*/
|
|
167
168
|
|
|
168
169
|
|
|
169
|
-
withSkipMeta(
|
|
170
|
+
withSkipMeta() {
|
|
171
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
170
172
|
this.parameters.skipMeta = flag;
|
|
171
173
|
return new _AnalyticsRequest.default(this);
|
|
172
174
|
}
|
|
@@ -183,7 +185,8 @@ class extends base {
|
|
|
183
185
|
*/
|
|
184
186
|
|
|
185
187
|
|
|
186
|
-
withSkipData(
|
|
188
|
+
withSkipData() {
|
|
189
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
187
190
|
this.parameters.skipData = flag;
|
|
188
191
|
return new _AnalyticsRequest.default(this);
|
|
189
192
|
}
|
|
@@ -200,7 +203,8 @@ class extends base {
|
|
|
200
203
|
*/
|
|
201
204
|
|
|
202
205
|
|
|
203
|
-
withHierarchyMeta(
|
|
206
|
+
withHierarchyMeta() {
|
|
207
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
204
208
|
this.parameters.hierarchyMeta = flag;
|
|
205
209
|
return new _AnalyticsRequest.default(this);
|
|
206
210
|
}
|
|
@@ -217,7 +221,8 @@ class extends base {
|
|
|
217
221
|
*/
|
|
218
222
|
|
|
219
223
|
|
|
220
|
-
withIgnoreLimit(
|
|
224
|
+
withIgnoreLimit() {
|
|
225
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
221
226
|
this.parameters.ignoreLimit = flag;
|
|
222
227
|
return new _AnalyticsRequest.default(this);
|
|
223
228
|
}
|
|
@@ -234,7 +239,8 @@ class extends base {
|
|
|
234
239
|
*/
|
|
235
240
|
|
|
236
241
|
|
|
237
|
-
withTableLayout(
|
|
242
|
+
withTableLayout() {
|
|
243
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
238
244
|
this.parameters.tableLayout = flag;
|
|
239
245
|
return new _AnalyticsRequest.default(this);
|
|
240
246
|
}
|
|
@@ -251,7 +257,8 @@ class extends base {
|
|
|
251
257
|
*/
|
|
252
258
|
|
|
253
259
|
|
|
254
|
-
withHideEmptyRows(
|
|
260
|
+
withHideEmptyRows() {
|
|
261
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
255
262
|
this.parameters.hideEmptyRows = flag;
|
|
256
263
|
return new _AnalyticsRequest.default(this);
|
|
257
264
|
}
|
|
@@ -268,7 +275,8 @@ class extends base {
|
|
|
268
275
|
*/
|
|
269
276
|
|
|
270
277
|
|
|
271
|
-
withHideEmptyColumns(
|
|
278
|
+
withHideEmptyColumns() {
|
|
279
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
272
280
|
this.parameters.hideEmptyColumns = flag;
|
|
273
281
|
return new _AnalyticsRequest.default(this);
|
|
274
282
|
}
|
|
@@ -285,7 +293,8 @@ class extends base {
|
|
|
285
293
|
*/
|
|
286
294
|
|
|
287
295
|
|
|
288
|
-
withShowHierarchy(
|
|
296
|
+
withShowHierarchy() {
|
|
297
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
289
298
|
this.parameters.showHierarchy = flag;
|
|
290
299
|
return new _AnalyticsRequest.default(this);
|
|
291
300
|
}
|
|
@@ -302,7 +311,8 @@ class extends base {
|
|
|
302
311
|
*/
|
|
303
312
|
|
|
304
313
|
|
|
305
|
-
withIncludeNumDen(
|
|
314
|
+
withIncludeNumDen() {
|
|
315
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
306
316
|
this.parameters.includeNumDen = flag;
|
|
307
317
|
return new _AnalyticsRequest.default(this);
|
|
308
318
|
}
|
|
@@ -319,7 +329,8 @@ class extends base {
|
|
|
319
329
|
*/
|
|
320
330
|
|
|
321
331
|
|
|
322
|
-
withIncludeMetadataDetails(
|
|
332
|
+
withIncludeMetadataDetails() {
|
|
333
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
323
334
|
this.parameters.includeMetadataDetails = flag;
|
|
324
335
|
return new _AnalyticsRequest.default(this);
|
|
325
336
|
}
|
|
@@ -701,7 +712,8 @@ class extends base {
|
|
|
701
712
|
*/
|
|
702
713
|
|
|
703
714
|
|
|
704
|
-
withCoordinatesOnly(
|
|
715
|
+
withCoordinatesOnly() {
|
|
716
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
705
717
|
this.parameters.coordinatesOnly = flag;
|
|
706
718
|
return new _AnalyticsRequest.default(this);
|
|
707
719
|
}
|
|
@@ -718,7 +730,8 @@ class extends base {
|
|
|
718
730
|
*/
|
|
719
731
|
|
|
720
732
|
|
|
721
|
-
withPage(
|
|
733
|
+
withPage() {
|
|
734
|
+
let page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
722
735
|
this.parameters.page = page;
|
|
723
736
|
return new _AnalyticsRequest.default(this);
|
|
724
737
|
}
|
|
@@ -735,7 +748,8 @@ class extends base {
|
|
|
735
748
|
*/
|
|
736
749
|
|
|
737
750
|
|
|
738
|
-
withPageSize(
|
|
751
|
+
withPageSize() {
|
|
752
|
+
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 50;
|
|
739
753
|
this.parameters.pageSize = size;
|
|
740
754
|
return new _AnalyticsRequest.default(this);
|
|
741
755
|
}
|
|
@@ -846,7 +860,8 @@ class extends base {
|
|
|
846
860
|
*/
|
|
847
861
|
|
|
848
862
|
|
|
849
|
-
withCollapseDataDimensions(
|
|
863
|
+
withCollapseDataDimensions() {
|
|
864
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
850
865
|
this.parameters.collapseDataDimensions = flag;
|
|
851
866
|
return new _AnalyticsRequest.default(this);
|
|
852
867
|
}
|
|
@@ -863,7 +878,8 @@ class extends base {
|
|
|
863
878
|
*/
|
|
864
879
|
|
|
865
880
|
|
|
866
|
-
withSkipRounding(
|
|
881
|
+
withSkipRounding() {
|
|
882
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
867
883
|
this.parameters.skipRounding = flag;
|
|
868
884
|
return new _AnalyticsRequest.default(this);
|
|
869
885
|
}
|
|
@@ -880,7 +896,8 @@ class extends base {
|
|
|
880
896
|
*/
|
|
881
897
|
|
|
882
898
|
|
|
883
|
-
withAggregateData(
|
|
899
|
+
withAggregateData() {
|
|
900
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
884
901
|
this.parameters.aggregateData = flag;
|
|
885
902
|
return new _AnalyticsRequest.default(this);
|
|
886
903
|
}
|
|
@@ -917,7 +934,8 @@ class extends base {
|
|
|
917
934
|
*/
|
|
918
935
|
|
|
919
936
|
|
|
920
|
-
withCoordinateField(
|
|
937
|
+
withCoordinateField() {
|
|
938
|
+
let field = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'EVENT';
|
|
921
939
|
// EVENT, <attribute-id>, <dataelement-id>
|
|
922
940
|
this.parameters.coordinateField = field;
|
|
923
941
|
return new _AnalyticsRequest.default(this);
|
|
@@ -955,7 +973,8 @@ class extends base {
|
|
|
955
973
|
*/
|
|
956
974
|
|
|
957
975
|
|
|
958
|
-
withIncludeClusterPoints(
|
|
976
|
+
withIncludeClusterPoints() {
|
|
977
|
+
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
959
978
|
this.parameters.includeClusterPoints = flag;
|
|
960
979
|
return new _AnalyticsRequest.default(this);
|
|
961
980
|
}
|
|
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
class AnalyticsResponseHeader {
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
constructor() {
|
|
10
|
+
let header = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
12
|
+
isPrefix: false,
|
|
13
|
+
isCollect: false,
|
|
14
|
+
index: undefined
|
|
15
|
+
};
|
|
14
16
|
Object.assign(this, header, options);
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -285,7 +285,8 @@ describe('AnalyticsRequest', () => {
|
|
|
285
285
|
page: 1,
|
|
286
286
|
pageSize: 50
|
|
287
287
|
};
|
|
288
|
-
Object.entries(params).forEach(
|
|
288
|
+
Object.entries(params).forEach(_ref => {
|
|
289
|
+
let [key, value] = _ref;
|
|
289
290
|
const parameter = key;
|
|
290
291
|
const funcName = getFuncName(parameter);
|
|
291
292
|
it("should add the ".concat(parameter, " parameter with the default value"), () => {
|