@dhis2/analytics 28.0.3 → 28.0.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__/DataDimension.stories.js +1 -2
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -2
- package/build/cjs/__demo__/PivotTable.stories.js +166 -224
- package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
- package/build/cjs/__demo__/SingleValue.stories.js +1 -2
- package/build/cjs/__demo__/Toolbar.stories.js +1 -2
- package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
- package/build/cjs/api/analytics/Analytics.js +8 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/cjs/api/analytics/utils.js +11 -17
- package/build/cjs/api/dimensions.js +119 -148
- package/build/cjs/api/expression.js +39 -60
- package/build/cjs/api/organisationUnits.js +23 -35
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
- package/build/cjs/components/CachedDataQueryProvider.js +7 -9
- package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/cjs/components/DataDimension/DataDimension.js +20 -32
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
- package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
- package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/cjs/components/DataDimension/TransferOption.js +35 -39
- package/build/cjs/components/DimensionMenu.js +13 -14
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
- package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
- package/build/cjs/components/FileMenu/FileMenu.js +19 -30
- package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
- package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/cjs/components/FileMenu/utils.js +10 -12
- package/build/cjs/components/Filter/Filter.js +21 -27
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/cjs/components/LegendKey/LegendKey.js +3 -4
- package/build/cjs/components/OfflineTooltip.js +18 -26
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
- package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
- package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/cjs/components/Options/VisualizationOptions.js +35 -46
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
- package/build/cjs/components/PivotTable/PivotTable.js +8 -10
- package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
- package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
- package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
- package/build/cjs/components/RichText/Editor/Editor.js +70 -85
- package/build/cjs/components/RichText/Parser/Parser.js +5 -10
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/cjs/components/Toolbar/Toolbar.js +10 -16
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
- package/build/cjs/components/TransferOption.js +14 -15
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -9
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/cjs/components/UserMention/UserList.js +6 -7
- package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
- package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
- package/build/cjs/components/VisTypeIcon.js +5 -6
- package/build/cjs/index.js +38 -39
- package/build/cjs/locales/ar_IQ/translations.json +20 -11
- package/build/cjs/locales/cs/translations.json +2 -0
- package/build/cjs/locales/en/translations.json +1 -0
- package/build/cjs/locales/es/translations.json +2 -0
- package/build/cjs/locales/fr/translations.json +2 -0
- package/build/cjs/locales/id/translations.json +20 -11
- package/build/cjs/locales/index.js +62 -62
- package/build/cjs/locales/lo/translations.json +2 -0
- package/build/cjs/locales/nb/translations.json +2 -0
- package/build/cjs/locales/prs/translations.json +2 -0
- package/build/cjs/locales/ps/translations.json +2 -0
- package/build/cjs/locales/pt/translations.json +2 -0
- package/build/cjs/locales/pt_BR/translations.json +2 -0
- package/build/cjs/locales/ru/translations.json +2 -0
- package/build/cjs/locales/si/translations.json +20 -11
- package/build/cjs/locales/sv/translations.json +20 -11
- package/build/cjs/locales/tet/translations.json +20 -11
- package/build/cjs/locales/tg/translations.json +2 -0
- package/build/cjs/locales/uk/translations.json +2 -0
- package/build/cjs/locales/ur/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/cjs/locales/vi/translations.json +2 -0
- package/build/cjs/locales/zh/translations.json +2 -0
- package/build/cjs/locales/zh_CN/translations.json +17 -15
- package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
- package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
- package/build/cjs/modules/dimensionListItem.js +4 -5
- package/build/cjs/modules/expressions.js +3 -9
- package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
- package/build/cjs/modules/layout/dimensionCreate.js +1 -3
- package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
- package/build/cjs/modules/legends.js +5 -6
- package/build/cjs/modules/outliers/index.js +5 -6
- package/build/cjs/modules/outliers/iqr.js +4 -6
- package/build/cjs/modules/outliers/modZScore.js +6 -14
- package/build/cjs/modules/outliers/zScore.js +3 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/cjs/modules/pivotTable/measureText.js +7 -9
- package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
- package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
- package/build/cjs/modules/relativeItems/index.js +1 -4
- package/build/cjs/modules/renderValue.js +1 -2
- package/build/cjs/modules/utils.js +11 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/cjs/visualizations/config/index.js +11 -12
- package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
- package/build/cjs/visualizations/index.js +1 -4
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/cjs/visualizations/store/index.js +15 -17
- package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
- package/build/cjs/visualizations/util/getFilterText.js +3 -6
- package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
- package/build/es/__demo__/PivotTable.stories.js +165 -222
- package/build/es/api/__tests__/dimensions.spec.js +1 -2
- package/build/es/api/analytics/Analytics.js +8 -9
- package/build/es/api/analytics/AnalyticsBase.js +58 -77
- package/build/es/api/analytics/AnalyticsRequest.js +1 -2
- package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/es/api/analytics/utils.js +11 -17
- package/build/es/api/dimensions.js +119 -148
- package/build/es/api/expression.js +39 -60
- package/build/es/api/organisationUnits.js +23 -35
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
- package/build/es/components/CachedDataQueryProvider.js +6 -7
- package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
- package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
- package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
- package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
- package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/es/components/DataDimension/DataDimension.js +19 -30
- package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
- package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
- package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
- package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
- package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
- package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
- package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/es/components/DataDimension/TransferOption.js +35 -39
- package/build/es/components/DimensionMenu.js +13 -14
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
- package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
- package/build/es/components/FileMenu/DeleteDialog.js +10 -14
- package/build/es/components/FileMenu/FileMenu.js +18 -28
- package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/es/components/FileMenu/RenameDialog.js +12 -19
- package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/es/components/FileMenu/utils.js +10 -12
- package/build/es/components/Filter/Filter.js +21 -27
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/es/components/Interpretations/common/Message/Message.js +6 -7
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/es/components/LegendKey/LegendKey.js +3 -4
- package/build/es/components/OfflineTooltip.js +18 -26
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/es/components/OpenFileDialog/DateField.js +3 -4
- package/build/es/components/OpenFileDialog/FileList.js +19 -22
- package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
- package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/es/components/Options/VisualizationOptions.js +34 -44
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
- package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/es/components/PeriodDimension/utils/index.js +1 -5
- package/build/es/components/PivotTable/PivotTable.js +7 -8
- package/build/es/components/PivotTable/PivotTableBody.js +20 -29
- package/build/es/components/PivotTable/PivotTableCell.js +8 -12
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
- package/build/es/components/PivotTable/PivotTableHead.js +13 -16
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/es/components/PivotTable/PivotTableRow.js +20 -27
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
- package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
- package/build/es/components/RichText/Editor/Editor.js +69 -83
- package/build/es/components/RichText/Parser/Parser.js +4 -8
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/es/components/Toolbar/Toolbar.js +10 -16
- package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/es/components/Toolbar/UpdateButton.js +18 -24
- package/build/es/components/TransferOption.js +14 -15
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +6 -7
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/es/components/UserMention/UserList.js +6 -7
- package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
- package/build/es/components/UserMention/useUserSearchResults.js +12 -16
- package/build/es/components/VisTypeIcon.js +5 -6
- package/build/es/locales/ar_IQ/translations.json +20 -11
- package/build/es/locales/cs/translations.json +2 -0
- package/build/es/locales/en/translations.json +1 -0
- package/build/es/locales/es/translations.json +2 -0
- package/build/es/locales/fr/translations.json +2 -0
- package/build/es/locales/id/translations.json +20 -11
- package/build/es/locales/lo/translations.json +2 -0
- package/build/es/locales/nb/translations.json +2 -0
- package/build/es/locales/prs/translations.json +2 -0
- package/build/es/locales/ps/translations.json +2 -0
- package/build/es/locales/pt/translations.json +2 -0
- package/build/es/locales/pt_BR/translations.json +2 -0
- package/build/es/locales/ru/translations.json +2 -0
- package/build/es/locales/si/translations.json +20 -11
- package/build/es/locales/sv/translations.json +20 -11
- package/build/es/locales/tet/translations.json +20 -11
- package/build/es/locales/tg/translations.json +2 -0
- package/build/es/locales/uk/translations.json +2 -0
- package/build/es/locales/ur/translations.json +2 -0
- package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/es/locales/vi/translations.json +2 -0
- package/build/es/locales/zh/translations.json +2 -0
- package/build/es/locales/zh_CN/translations.json +17 -15
- package/build/es/modules/__tests__/expressions.spec.js +4 -5
- package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
- package/build/es/modules/dimensionListItem.js +4 -5
- package/build/es/modules/expressions.js +3 -9
- package/build/es/modules/getPWAInstallationStatus.js +7 -9
- package/build/es/modules/layout/dimensionCreate.js +1 -3
- package/build/es/modules/layout/dimensionIsValid.js +3 -4
- package/build/es/modules/legends.js +5 -6
- package/build/es/modules/outliers/index.js +2 -3
- package/build/es/modules/outliers/iqr.js +4 -6
- package/build/es/modules/outliers/modZScore.js +6 -14
- package/build/es/modules/outliers/zScore.js +3 -4
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/es/modules/pivotTable/clipAxis.js +7 -8
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/es/modules/pivotTable/measureText.js +7 -9
- package/build/es/modules/pivotTable/useParentSize.js +1 -2
- package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/es/modules/pivotTable/useTableClipping.js +6 -7
- package/build/es/modules/relativeItems/index.js +1 -4
- package/build/es/modules/renderValue.js +1 -2
- package/build/es/modules/utils.js +9 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/es/visualizations/config/index.js +11 -12
- package/build/es/visualizations/config/validators/dhis/index.js +3 -4
- package/build/es/visualizations/index.js +1 -4
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/store/index.js +15 -17
- package/build/es/visualizations/store/validators/dhis/index.js +5 -6
- package/build/es/visualizations/util/getFilterText.js +3 -6
- package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
- package/package.json +12 -12
|
@@ -7,8 +7,7 @@ exports.default = exports.Default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _scatterPlotData = require("../__fixtures__/scatterPlotData.js");
|
|
9
9
|
var _index = require("../index.js");
|
|
10
|
-
function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
var _default = exports.default = {
|
|
13
12
|
title: 'ScatterPlot'
|
|
14
13
|
};
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _index = require("../index.js");
|
|
9
|
-
function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
const constainerStyleBase = {
|
|
12
11
|
width: 800,
|
|
13
12
|
height: 800,
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _index = require("../components/Toolbar/index.js");
|
|
9
|
-
function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function ToolbarWithState() {
|
|
12
11
|
const [isHidden, setIsHidden] = (0, _react.useState)(false);
|
|
13
12
|
const [isSidebarShowing, setIsSidebarShowing] = (0, _react.useState)(false);
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var _dimensions = require("../dimensions.js");
|
|
4
4
|
let mockDataEngine;
|
|
5
5
|
let mockQueryFn;
|
|
6
|
-
const asyncCheckMatches = (
|
|
7
|
-
let [queryDefinition, queryVariables, callCount = 1, callIndex = 0] = _ref;
|
|
6
|
+
const asyncCheckMatches = ([queryDefinition, queryVariables, callCount = 1, callIndex = 0], done) => {
|
|
8
7
|
setTimeout(() => {
|
|
9
8
|
expect(mockQueryFn).toHaveBeenCalledTimes(callCount);
|
|
10
9
|
expect(mockQueryFn.mock.calls[callIndex][0]).toEqual(queryDefinition);
|
|
@@ -47,15 +47,14 @@ class Analytics {
|
|
|
47
47
|
* @param {!module:analytics.AnalyticsRequest} analyticsRequest The AnalyticsRequest class
|
|
48
48
|
* @param {!module:analytics.AnalyticsResponse} analyticsResponse The AnalyticsResponse class
|
|
49
49
|
*/
|
|
50
|
-
constructor(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} = _ref;
|
|
50
|
+
constructor({
|
|
51
|
+
aggregate,
|
|
52
|
+
trackedEntities,
|
|
53
|
+
enrollments,
|
|
54
|
+
events,
|
|
55
|
+
request,
|
|
56
|
+
response
|
|
57
|
+
}) {
|
|
59
58
|
this.aggregate = aggregate;
|
|
60
59
|
this.trackedEntities = trackedEntities;
|
|
61
60
|
this.enrollments = enrollments;
|
|
@@ -10,51 +10,41 @@ var _utils = require("./utils.js");
|
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const analyticsQuery = {
|
|
12
12
|
resource: 'analytics',
|
|
13
|
-
id:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
dimension: dimensions.length ? dimensions : undefined,
|
|
33
|
-
filter: filters.length ? filters : undefined,
|
|
34
|
-
...parameters
|
|
35
|
-
};
|
|
36
|
-
}
|
|
13
|
+
id: ({
|
|
14
|
+
path,
|
|
15
|
+
program,
|
|
16
|
+
trackedEntityType
|
|
17
|
+
}) => (0, _utils.formatRequestPath)({
|
|
18
|
+
path,
|
|
19
|
+
program,
|
|
20
|
+
trackedEntityType
|
|
21
|
+
}),
|
|
22
|
+
params: ({
|
|
23
|
+
dimensions,
|
|
24
|
+
filters,
|
|
25
|
+
parameters
|
|
26
|
+
}) => ({
|
|
27
|
+
dimension: dimensions.length ? dimensions : undefined,
|
|
28
|
+
filter: filters.length ? filters : undefined,
|
|
29
|
+
...parameters
|
|
30
|
+
})
|
|
37
31
|
};
|
|
38
32
|
const analyticsDataQuery = {
|
|
39
33
|
resource: 'analytics',
|
|
40
|
-
id:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
dimensions,
|
|
55
|
-
filters,
|
|
56
|
-
parameters
|
|
57
|
-
} = _ref4;
|
|
34
|
+
id: ({
|
|
35
|
+
path,
|
|
36
|
+
program,
|
|
37
|
+
trackedEntityType
|
|
38
|
+
}) => (0, _utils.formatRequestPath)({
|
|
39
|
+
path,
|
|
40
|
+
program,
|
|
41
|
+
trackedEntityType
|
|
42
|
+
}),
|
|
43
|
+
params: ({
|
|
44
|
+
dimensions,
|
|
45
|
+
filters,
|
|
46
|
+
parameters
|
|
47
|
+
}) => {
|
|
58
48
|
return {
|
|
59
49
|
dimension: dimensions.length ? generateDimensionStrings(dimensions, {
|
|
60
50
|
sorted: true
|
|
@@ -70,43 +60,34 @@ const analyticsDataQuery = {
|
|
|
70
60
|
};
|
|
71
61
|
const analyticsMetaDataQuery = {
|
|
72
62
|
resource: 'analytics',
|
|
73
|
-
id:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
...parameters,
|
|
95
|
-
skipMeta: false,
|
|
96
|
-
skipData: true,
|
|
97
|
-
includeMetadataDetails: true
|
|
98
|
-
};
|
|
99
|
-
}
|
|
63
|
+
id: ({
|
|
64
|
+
path,
|
|
65
|
+
program,
|
|
66
|
+
trackedEntityType
|
|
67
|
+
}) => (0, _utils.formatRequestPath)({
|
|
68
|
+
path,
|
|
69
|
+
program,
|
|
70
|
+
trackedEntityType
|
|
71
|
+
}),
|
|
72
|
+
params: ({
|
|
73
|
+
dimensions,
|
|
74
|
+
filters,
|
|
75
|
+
parameters
|
|
76
|
+
}) => ({
|
|
77
|
+
dimension: dimensions.length ? generateDimensionStrings(dimensions) : undefined,
|
|
78
|
+
filter: filters.length ? generateDimensionStrings(filters) : undefined,
|
|
79
|
+
...parameters,
|
|
80
|
+
skipMeta: false,
|
|
81
|
+
skipData: true,
|
|
82
|
+
includeMetadataDetails: true
|
|
83
|
+
})
|
|
100
84
|
};
|
|
101
|
-
const generateDimensionStrings =
|
|
102
|
-
let dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
103
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
85
|
+
const generateDimensionStrings = (dimensions = [], options) => {
|
|
104
86
|
const sortedDimensions = (0, _sortBy.default)(dimensions, 'dimension');
|
|
105
|
-
return sortedDimensions.map(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} = _ref7;
|
|
87
|
+
return sortedDimensions.map(({
|
|
88
|
+
dimension,
|
|
89
|
+
items
|
|
90
|
+
}) => {
|
|
110
91
|
if (Array.isArray(items) && items.length) {
|
|
111
92
|
if (options && options.sorted) {
|
|
112
93
|
items = items.slice().sort();
|
|
@@ -45,8 +45,7 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
45
45
|
*
|
|
46
46
|
* // dimension=pe:last_12_month&dimension=dx:fbfjhsppuqd;cyeuwxtcpku;jtf34knzhzp;hfdmmspbglg&dimension=ou:imsptqpwcqd
|
|
47
47
|
*/
|
|
48
|
-
fromVisualization(visualization) {
|
|
49
|
-
let passFilterAsDimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
48
|
+
fromVisualization(visualization, passFilterAsDimension = false) {
|
|
50
49
|
let request = this;
|
|
51
50
|
const outputType = visualization.outputType;
|
|
52
51
|
|
|
@@ -18,17 +18,16 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
18
18
|
* @abstract
|
|
19
19
|
*/
|
|
20
20
|
class AnalyticsRequestBase {
|
|
21
|
-
constructor(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
|
+
constructor({
|
|
22
|
+
endPoint = 'analytics',
|
|
23
|
+
format = 'json',
|
|
24
|
+
path,
|
|
25
|
+
program,
|
|
26
|
+
trackedEntityType,
|
|
27
|
+
dimensions = [],
|
|
28
|
+
filters = [],
|
|
29
|
+
parameters = {}
|
|
30
|
+
} = {}) {
|
|
32
31
|
this.endPoint = endPoint;
|
|
33
32
|
this.format = format.toLowerCase();
|
|
34
33
|
this.path = path;
|
|
@@ -58,11 +57,10 @@ class AnalyticsRequestBase {
|
|
|
58
57
|
if (dimensions.length && options !== null && options !== void 0 && options.sorted) {
|
|
59
58
|
dimensions = (0, _sortBy.default)(dimensions, 'dimension');
|
|
60
59
|
}
|
|
61
|
-
const encodedDimensions = dimensions.map(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} = _ref;
|
|
60
|
+
const encodedDimensions = dimensions.map(({
|
|
61
|
+
dimension,
|
|
62
|
+
items
|
|
63
|
+
}) => {
|
|
66
64
|
if (Array.isArray(items) && items.length) {
|
|
67
65
|
const encodedItems = items.map(_utils.customEncodeURIComponent);
|
|
68
66
|
if (options !== null && options !== void 0 && options.sorted) {
|
|
@@ -98,11 +96,10 @@ class AnalyticsRequestBase {
|
|
|
98
96
|
if (filters.length && options !== null && options !== void 0 && options.sorted) {
|
|
99
97
|
filters = (0, _sortBy.default)(filters, 'dimension');
|
|
100
98
|
}
|
|
101
|
-
const encodedFilters = filters.map(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
} = _ref2;
|
|
99
|
+
const encodedFilters = filters.map(({
|
|
100
|
+
dimension,
|
|
101
|
+
items
|
|
102
|
+
}) => {
|
|
106
103
|
if (Array.isArray(items) && items.length) {
|
|
107
104
|
const encodedItems = items.map(_utils.customEncodeURIComponent);
|
|
108
105
|
if (options !== null && options !== void 0 && options.sorted) {
|
|
@@ -77,8 +77,7 @@ class extends base {
|
|
|
77
77
|
* const req = new analytics.request()
|
|
78
78
|
* .withFormat('xml');
|
|
79
79
|
*/
|
|
80
|
-
withFormat() {
|
|
81
|
-
let format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'json';
|
|
80
|
+
withFormat(format = 'json') {
|
|
82
81
|
this.format = format;
|
|
83
82
|
return new _AnalyticsRequest.default(this);
|
|
84
83
|
}
|
|
@@ -153,8 +152,7 @@ class extends base {
|
|
|
153
152
|
* const req = new analytics.request()
|
|
154
153
|
* .withSkipMeta();
|
|
155
154
|
*/
|
|
156
|
-
withSkipMeta() {
|
|
157
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
155
|
+
withSkipMeta(flag = true) {
|
|
158
156
|
this.parameters.skipMeta = flag;
|
|
159
157
|
return new _AnalyticsRequest.default(this);
|
|
160
158
|
}
|
|
@@ -170,8 +168,7 @@ class extends base {
|
|
|
170
168
|
* const req = new analytics.request()
|
|
171
169
|
* .withSkipData();
|
|
172
170
|
*/
|
|
173
|
-
withSkipData() {
|
|
174
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
171
|
+
withSkipData(flag = true) {
|
|
175
172
|
this.parameters.skipData = flag;
|
|
176
173
|
return new _AnalyticsRequest.default(this);
|
|
177
174
|
}
|
|
@@ -187,8 +184,7 @@ class extends base {
|
|
|
187
184
|
* const req = new analytics.request()
|
|
188
185
|
* .withHierarchyMeta();
|
|
189
186
|
*/
|
|
190
|
-
withHierarchyMeta() {
|
|
191
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
187
|
+
withHierarchyMeta(flag = true) {
|
|
192
188
|
this.parameters.hierarchyMeta = flag;
|
|
193
189
|
return new _AnalyticsRequest.default(this);
|
|
194
190
|
}
|
|
@@ -204,8 +200,7 @@ class extends base {
|
|
|
204
200
|
* const req = new analytics.request()
|
|
205
201
|
* .withIgnoreLimit();
|
|
206
202
|
*/
|
|
207
|
-
withIgnoreLimit() {
|
|
208
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
203
|
+
withIgnoreLimit(flag = true) {
|
|
209
204
|
this.parameters.ignoreLimit = flag;
|
|
210
205
|
return new _AnalyticsRequest.default(this);
|
|
211
206
|
}
|
|
@@ -221,8 +216,7 @@ class extends base {
|
|
|
221
216
|
* const req = new analytics.request()
|
|
222
217
|
* .withTableLayout();
|
|
223
218
|
*/
|
|
224
|
-
withTableLayout() {
|
|
225
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
219
|
+
withTableLayout(flag = true) {
|
|
226
220
|
this.parameters.tableLayout = flag;
|
|
227
221
|
return new _AnalyticsRequest.default(this);
|
|
228
222
|
}
|
|
@@ -238,8 +232,7 @@ class extends base {
|
|
|
238
232
|
* const req = new analytics.request()
|
|
239
233
|
* .withHideEmptyRows();
|
|
240
234
|
*/
|
|
241
|
-
withHideEmptyRows() {
|
|
242
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
235
|
+
withHideEmptyRows(flag = true) {
|
|
243
236
|
this.parameters.hideEmptyRows = flag;
|
|
244
237
|
return new _AnalyticsRequest.default(this);
|
|
245
238
|
}
|
|
@@ -255,8 +248,7 @@ class extends base {
|
|
|
255
248
|
* const req = new analytics.request()
|
|
256
249
|
* .withHideEmptyColumns();
|
|
257
250
|
*/
|
|
258
|
-
withHideEmptyColumns() {
|
|
259
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
251
|
+
withHideEmptyColumns(flag = true) {
|
|
260
252
|
this.parameters.hideEmptyColumns = flag;
|
|
261
253
|
return new _AnalyticsRequest.default(this);
|
|
262
254
|
}
|
|
@@ -272,8 +264,7 @@ class extends base {
|
|
|
272
264
|
* const req = new analytics.request()
|
|
273
265
|
* .withShowHierarchy();
|
|
274
266
|
*/
|
|
275
|
-
withShowHierarchy() {
|
|
276
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
267
|
+
withShowHierarchy(flag = true) {
|
|
277
268
|
this.parameters.showHierarchy = flag;
|
|
278
269
|
return new _AnalyticsRequest.default(this);
|
|
279
270
|
}
|
|
@@ -289,8 +280,7 @@ class extends base {
|
|
|
289
280
|
* const req = new analytics.request()
|
|
290
281
|
* .withIncludeNumDen();
|
|
291
282
|
*/
|
|
292
|
-
withIncludeNumDen() {
|
|
293
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
283
|
+
withIncludeNumDen(flag = true) {
|
|
294
284
|
this.parameters.includeNumDen = flag;
|
|
295
285
|
return new _AnalyticsRequest.default(this);
|
|
296
286
|
}
|
|
@@ -306,8 +296,7 @@ class extends base {
|
|
|
306
296
|
* const req = new analytics.request()
|
|
307
297
|
* .withIncludeMetadataDetails();
|
|
308
298
|
*/
|
|
309
|
-
withIncludeMetadataDetails() {
|
|
310
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
299
|
+
withIncludeMetadataDetails(flag = true) {
|
|
311
300
|
this.parameters.includeMetadataDetails = flag;
|
|
312
301
|
return new _AnalyticsRequest.default(this);
|
|
313
302
|
}
|
|
@@ -669,8 +658,7 @@ class extends base {
|
|
|
669
658
|
* const req = new analytics.request()
|
|
670
659
|
* .withCoordinatesOnly();
|
|
671
660
|
*/
|
|
672
|
-
withCoordinatesOnly() {
|
|
673
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
661
|
+
withCoordinatesOnly(flag = true) {
|
|
674
662
|
this.parameters.coordinatesOnly = flag;
|
|
675
663
|
return new _AnalyticsRequest.default(this);
|
|
676
664
|
}
|
|
@@ -686,8 +674,7 @@ class extends base {
|
|
|
686
674
|
* const req = new analytics.request()
|
|
687
675
|
* .withPage(2);
|
|
688
676
|
*/
|
|
689
|
-
withPage() {
|
|
690
|
-
let page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
677
|
+
withPage(page = 1) {
|
|
691
678
|
this.parameters.page = page;
|
|
692
679
|
return new _AnalyticsRequest.default(this);
|
|
693
680
|
}
|
|
@@ -703,8 +690,7 @@ class extends base {
|
|
|
703
690
|
* const req = new analytics.request()
|
|
704
691
|
* .withPageSize(10);
|
|
705
692
|
*/
|
|
706
|
-
withPageSize() {
|
|
707
|
-
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 50;
|
|
693
|
+
withPageSize(size = 50) {
|
|
708
694
|
this.parameters.pageSize = size;
|
|
709
695
|
return new _AnalyticsRequest.default(this);
|
|
710
696
|
}
|
|
@@ -804,8 +790,7 @@ class extends base {
|
|
|
804
790
|
* const req = new analytics.request()
|
|
805
791
|
* .withCollapseDataDimensions();
|
|
806
792
|
*/
|
|
807
|
-
withCollapseDataDimensions() {
|
|
808
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
793
|
+
withCollapseDataDimensions(flag = true) {
|
|
809
794
|
this.parameters.collapseDataDimensions = flag;
|
|
810
795
|
return new _AnalyticsRequest.default(this);
|
|
811
796
|
}
|
|
@@ -821,8 +806,7 @@ class extends base {
|
|
|
821
806
|
* const req = new analytics.request()
|
|
822
807
|
* .withSkipRounding();
|
|
823
808
|
*/
|
|
824
|
-
withSkipRounding() {
|
|
825
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
809
|
+
withSkipRounding(flag = true) {
|
|
826
810
|
this.parameters.skipRounding = flag;
|
|
827
811
|
return new _AnalyticsRequest.default(this);
|
|
828
812
|
}
|
|
@@ -838,8 +822,7 @@ class extends base {
|
|
|
838
822
|
* const req = new analytics.request()
|
|
839
823
|
* .withAggregateData();
|
|
840
824
|
*/
|
|
841
|
-
withAggregateData() {
|
|
842
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
825
|
+
withAggregateData(flag = true) {
|
|
843
826
|
this.parameters.aggregateData = flag;
|
|
844
827
|
return new _AnalyticsRequest.default(this);
|
|
845
828
|
}
|
|
@@ -873,8 +856,7 @@ class extends base {
|
|
|
873
856
|
* const req = new analytics.request()
|
|
874
857
|
* .withCoordinateField('<attribute-id>');
|
|
875
858
|
*/
|
|
876
|
-
withCoordinateField() {
|
|
877
|
-
let field = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'EVENT';
|
|
859
|
+
withCoordinateField(field = 'EVENT') {
|
|
878
860
|
// EVENT, <attribute-id>, <dataelement-id>
|
|
879
861
|
this.parameters.coordinateField = field;
|
|
880
862
|
return new _AnalyticsRequest.default(this);
|
|
@@ -909,8 +891,7 @@ class extends base {
|
|
|
909
891
|
* const req = new analytics.request()
|
|
910
892
|
* .withIncludeClusterPoints();
|
|
911
893
|
*/
|
|
912
|
-
withIncludeClusterPoints() {
|
|
913
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
894
|
+
withIncludeClusterPoints(flag = true) {
|
|
914
895
|
this.parameters.includeClusterPoints = flag;
|
|
915
896
|
return new _AnalyticsRequest.default(this);
|
|
916
897
|
}
|
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
class AnalyticsResponseHeader {
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
index: undefined
|
|
14
|
-
};
|
|
8
|
+
constructor(header = {}, options = {
|
|
9
|
+
isPrefix: false,
|
|
10
|
+
isCollect: false,
|
|
11
|
+
index: undefined
|
|
12
|
+
}) {
|
|
15
13
|
Object.assign(this, header, options);
|
|
16
14
|
}
|
|
17
15
|
getIndex() {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _AnalyticsBase = _interopRequireWildcard(require("../AnalyticsBase.js"));
|
|
4
|
-
function
|
|
5
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
4
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
6
5
|
let base;
|
|
7
6
|
describe('constructor', () => {
|
|
8
7
|
beforeEach(() => {
|
|
@@ -30,20 +29,18 @@ describe('generateDimensionString', () => {
|
|
|
30
29
|
outputSorted: ['dim1:item1', 'dim2:item1;item2']
|
|
31
30
|
}];
|
|
32
31
|
it('should return dimension strings correctly formatted', () => {
|
|
33
|
-
tests.forEach(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
32
|
+
tests.forEach(({
|
|
33
|
+
input,
|
|
34
|
+
output
|
|
35
|
+
}) => {
|
|
38
36
|
expect((0, _AnalyticsBase.generateDimensionStrings)(input)).toEqual(output);
|
|
39
37
|
});
|
|
40
38
|
});
|
|
41
39
|
it('should return dimension strings correctly formatted and sorted', () => {
|
|
42
|
-
tests.forEach(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref2;
|
|
40
|
+
tests.forEach(({
|
|
41
|
+
input,
|
|
42
|
+
outputSorted
|
|
43
|
+
}) => {
|
|
47
44
|
expect((0, _AnalyticsBase.generateDimensionStrings)(input, {
|
|
48
45
|
sorted: true
|
|
49
46
|
})).toEqual(outputSorted);
|
|
@@ -5,11 +5,18 @@ var _AnalyticsRequest = _interopRequireDefault(require("../AnalyticsRequest.js")
|
|
|
5
5
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
6
|
let request;
|
|
7
7
|
let expectedParameters;
|
|
8
|
+
let warnMock;
|
|
8
9
|
const getFuncName = parameter => `with${parameter.charAt(0).toUpperCase()}${parameter.slice(1)}`;
|
|
9
10
|
describe('AnalyticsRequest', () => {
|
|
10
11
|
beforeEach(() => {
|
|
11
12
|
request = new _AnalyticsRequest.default();
|
|
12
13
|
expectedParameters = {};
|
|
14
|
+
// Prevent console warnings like below from cluttering the test output:
|
|
15
|
+
// "analytics.request.withAggregationType(): "new-constant" not listed as possible value"
|
|
16
|
+
warnMock = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
warnMock.mockReset();
|
|
13
20
|
});
|
|
14
21
|
describe('constructor', () => {
|
|
15
22
|
it('should not be allowed to be called without new', () => {
|
|
@@ -283,8 +290,7 @@ describe('AnalyticsRequest', () => {
|
|
|
283
290
|
page: 1,
|
|
284
291
|
pageSize: 50
|
|
285
292
|
};
|
|
286
|
-
Object.entries(params).forEach(
|
|
287
|
-
let [key, value] = _ref;
|
|
293
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
288
294
|
const parameter = key;
|
|
289
295
|
const funcName = getFuncName(parameter);
|
|
290
296
|
it(`should add the ${parameter} parameter with the default value`, () => {
|
|
@@ -10,22 +10,16 @@ const whitelistURICodes = whitelistURI.split('').map(c => encodeURIComponent(c))
|
|
|
10
10
|
const whitelistRegExp = new RegExp(`(?:${whitelistURICodes.join('|')})`, 'g');
|
|
11
11
|
const customEncodeURIComponent = uri => encodeURIComponent(uri).replace(whitelistRegExp, decodeURIComponent);
|
|
12
12
|
exports.customEncodeURIComponent = customEncodeURIComponent;
|
|
13
|
-
const formatRequestPath =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
19
|
-
return [path, program, trackedEntityType].filter(Boolean).join('/');
|
|
20
|
-
};
|
|
13
|
+
const formatRequestPath = ({
|
|
14
|
+
path,
|
|
15
|
+
program,
|
|
16
|
+
trackedEntityType
|
|
17
|
+
}) => [path, program, trackedEntityType].filter(Boolean).join('/');
|
|
21
18
|
exports.formatRequestPath = formatRequestPath;
|
|
22
|
-
const formatDimension =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref2;
|
|
29
|
-
return [outputType === 'TRACKED_ENTITY_INSTANCE' ? programId : undefined, programStageId, dimension].filter(Boolean).join('.');
|
|
30
|
-
};
|
|
19
|
+
const formatDimension = ({
|
|
20
|
+
outputType,
|
|
21
|
+
programId,
|
|
22
|
+
programStageId,
|
|
23
|
+
dimension
|
|
24
|
+
}) => [outputType === 'TRACKED_ENTITY_INSTANCE' ? programId : undefined, programStageId, dimension].filter(Boolean).join('.');
|
|
31
25
|
exports.formatDimension = formatDimension;
|