@dhis2/analytics 28.0.2 → 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 +3 -4
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +3 -4
- package/build/cjs/__demo__/PeriodDimension.stories.js +2 -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 +8 -10
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +52 -0
- 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__/DataDimension.stories.js +2 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/es/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/es/__demo__/PeriodDimension.stories.js +2 -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 +7 -8
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +49 -0
- 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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { dimensionsQuery, apiFetchDimensions } from '../dimensions.js';
|
|
2
2
|
let mockDataEngine;
|
|
3
3
|
let mockQueryFn;
|
|
4
|
-
const asyncCheckMatches = (
|
|
5
|
-
let [queryDefinition, queryVariables, callCount = 1, callIndex = 0] = _ref;
|
|
4
|
+
const asyncCheckMatches = ([queryDefinition, queryVariables, callCount = 1, callIndex = 0], done) => {
|
|
6
5
|
setTimeout(() => {
|
|
7
6
|
expect(mockQueryFn).toHaveBeenCalledTimes(callCount);
|
|
8
7
|
expect(mockQueryFn.mock.calls[callIndex][0]).toEqual(queryDefinition);
|
|
@@ -40,15 +40,14 @@ class Analytics {
|
|
|
40
40
|
* @param {!module:analytics.AnalyticsRequest} analyticsRequest The AnalyticsRequest class
|
|
41
41
|
* @param {!module:analytics.AnalyticsResponse} analyticsResponse The AnalyticsResponse class
|
|
42
42
|
*/
|
|
43
|
-
constructor(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} = _ref;
|
|
43
|
+
constructor({
|
|
44
|
+
aggregate,
|
|
45
|
+
trackedEntities,
|
|
46
|
+
enrollments,
|
|
47
|
+
events,
|
|
48
|
+
request,
|
|
49
|
+
response
|
|
50
|
+
}) {
|
|
52
51
|
this.aggregate = aggregate;
|
|
53
52
|
this.trackedEntities = trackedEntities;
|
|
54
53
|
this.enrollments = enrollments;
|
|
@@ -3,51 +3,41 @@ import AnalyticsRequest from './AnalyticsRequest.js';
|
|
|
3
3
|
import { formatRequestPath } from './utils.js';
|
|
4
4
|
const analyticsQuery = {
|
|
5
5
|
resource: 'analytics',
|
|
6
|
-
id:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
dimension: dimensions.length ? dimensions : undefined,
|
|
26
|
-
filter: filters.length ? filters : undefined,
|
|
27
|
-
...parameters
|
|
28
|
-
};
|
|
29
|
-
}
|
|
6
|
+
id: ({
|
|
7
|
+
path,
|
|
8
|
+
program,
|
|
9
|
+
trackedEntityType
|
|
10
|
+
}) => formatRequestPath({
|
|
11
|
+
path,
|
|
12
|
+
program,
|
|
13
|
+
trackedEntityType
|
|
14
|
+
}),
|
|
15
|
+
params: ({
|
|
16
|
+
dimensions,
|
|
17
|
+
filters,
|
|
18
|
+
parameters
|
|
19
|
+
}) => ({
|
|
20
|
+
dimension: dimensions.length ? dimensions : undefined,
|
|
21
|
+
filter: filters.length ? filters : undefined,
|
|
22
|
+
...parameters
|
|
23
|
+
})
|
|
30
24
|
};
|
|
31
25
|
const analyticsDataQuery = {
|
|
32
26
|
resource: 'analytics',
|
|
33
|
-
id:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
dimensions,
|
|
48
|
-
filters,
|
|
49
|
-
parameters
|
|
50
|
-
} = _ref4;
|
|
27
|
+
id: ({
|
|
28
|
+
path,
|
|
29
|
+
program,
|
|
30
|
+
trackedEntityType
|
|
31
|
+
}) => formatRequestPath({
|
|
32
|
+
path,
|
|
33
|
+
program,
|
|
34
|
+
trackedEntityType
|
|
35
|
+
}),
|
|
36
|
+
params: ({
|
|
37
|
+
dimensions,
|
|
38
|
+
filters,
|
|
39
|
+
parameters
|
|
40
|
+
}) => {
|
|
51
41
|
return {
|
|
52
42
|
dimension: dimensions.length ? generateDimensionStrings(dimensions, {
|
|
53
43
|
sorted: true
|
|
@@ -63,43 +53,34 @@ const analyticsDataQuery = {
|
|
|
63
53
|
};
|
|
64
54
|
const analyticsMetaDataQuery = {
|
|
65
55
|
resource: 'analytics',
|
|
66
|
-
id:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
...parameters,
|
|
88
|
-
skipMeta: false,
|
|
89
|
-
skipData: true,
|
|
90
|
-
includeMetadataDetails: true
|
|
91
|
-
};
|
|
92
|
-
}
|
|
56
|
+
id: ({
|
|
57
|
+
path,
|
|
58
|
+
program,
|
|
59
|
+
trackedEntityType
|
|
60
|
+
}) => formatRequestPath({
|
|
61
|
+
path,
|
|
62
|
+
program,
|
|
63
|
+
trackedEntityType
|
|
64
|
+
}),
|
|
65
|
+
params: ({
|
|
66
|
+
dimensions,
|
|
67
|
+
filters,
|
|
68
|
+
parameters
|
|
69
|
+
}) => ({
|
|
70
|
+
dimension: dimensions.length ? generateDimensionStrings(dimensions) : undefined,
|
|
71
|
+
filter: filters.length ? generateDimensionStrings(filters) : undefined,
|
|
72
|
+
...parameters,
|
|
73
|
+
skipMeta: false,
|
|
74
|
+
skipData: true,
|
|
75
|
+
includeMetadataDetails: true
|
|
76
|
+
})
|
|
93
77
|
};
|
|
94
|
-
export const generateDimensionStrings =
|
|
95
|
-
let dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
96
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
78
|
+
export const generateDimensionStrings = (dimensions = [], options) => {
|
|
97
79
|
const sortedDimensions = sortBy(dimensions, 'dimension');
|
|
98
|
-
return sortedDimensions.map(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
} = _ref7;
|
|
80
|
+
return sortedDimensions.map(({
|
|
81
|
+
dimension,
|
|
82
|
+
items
|
|
83
|
+
}) => {
|
|
103
84
|
if (Array.isArray(items) && items.length) {
|
|
104
85
|
if (options && options.sorted) {
|
|
105
86
|
items = items.slice().sort();
|
|
@@ -39,8 +39,7 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
39
39
|
*
|
|
40
40
|
* // dimension=pe:last_12_month&dimension=dx:fbfjhsppuqd;cyeuwxtcpku;jtf34knzhzp;hfdmmspbglg&dimension=ou:imsptqpwcqd
|
|
41
41
|
*/
|
|
42
|
-
fromVisualization(visualization) {
|
|
43
|
-
let passFilterAsDimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
42
|
+
fromVisualization(visualization, passFilterAsDimension = false) {
|
|
44
43
|
let request = this;
|
|
45
44
|
const outputType = visualization.outputType;
|
|
46
45
|
|
|
@@ -12,17 +12,16 @@ import { customEncodeURIComponent } from './utils.js';
|
|
|
12
12
|
* @abstract
|
|
13
13
|
*/
|
|
14
14
|
class AnalyticsRequestBase {
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
constructor({
|
|
16
|
+
endPoint = 'analytics',
|
|
17
|
+
format = 'json',
|
|
18
|
+
path,
|
|
19
|
+
program,
|
|
20
|
+
trackedEntityType,
|
|
21
|
+
dimensions = [],
|
|
22
|
+
filters = [],
|
|
23
|
+
parameters = {}
|
|
24
|
+
} = {}) {
|
|
26
25
|
this.endPoint = endPoint;
|
|
27
26
|
this.format = format.toLowerCase();
|
|
28
27
|
this.path = path;
|
|
@@ -52,11 +51,10 @@ class AnalyticsRequestBase {
|
|
|
52
51
|
if (dimensions.length && options !== null && options !== void 0 && options.sorted) {
|
|
53
52
|
dimensions = sortBy(dimensions, 'dimension');
|
|
54
53
|
}
|
|
55
|
-
const encodedDimensions = dimensions.map(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref;
|
|
54
|
+
const encodedDimensions = dimensions.map(({
|
|
55
|
+
dimension,
|
|
56
|
+
items
|
|
57
|
+
}) => {
|
|
60
58
|
if (Array.isArray(items) && items.length) {
|
|
61
59
|
const encodedItems = items.map(customEncodeURIComponent);
|
|
62
60
|
if (options !== null && options !== void 0 && options.sorted) {
|
|
@@ -92,11 +90,10 @@ class AnalyticsRequestBase {
|
|
|
92
90
|
if (filters.length && options !== null && options !== void 0 && options.sorted) {
|
|
93
91
|
filters = sortBy(filters, 'dimension');
|
|
94
92
|
}
|
|
95
|
-
const encodedFilters = filters.map(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} = _ref2;
|
|
93
|
+
const encodedFilters = filters.map(({
|
|
94
|
+
dimension,
|
|
95
|
+
items
|
|
96
|
+
}) => {
|
|
100
97
|
if (Array.isArray(items) && items.length) {
|
|
101
98
|
const encodedItems = items.map(customEncodeURIComponent);
|
|
102
99
|
if (options !== null && options !== void 0 && options.sorted) {
|
|
@@ -71,8 +71,7 @@ class extends base {
|
|
|
71
71
|
* const req = new analytics.request()
|
|
72
72
|
* .withFormat('xml');
|
|
73
73
|
*/
|
|
74
|
-
withFormat() {
|
|
75
|
-
let format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'json';
|
|
74
|
+
withFormat(format = 'json') {
|
|
76
75
|
this.format = format;
|
|
77
76
|
return new AnalyticsRequest(this);
|
|
78
77
|
}
|
|
@@ -147,8 +146,7 @@ class extends base {
|
|
|
147
146
|
* const req = new analytics.request()
|
|
148
147
|
* .withSkipMeta();
|
|
149
148
|
*/
|
|
150
|
-
withSkipMeta() {
|
|
151
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
149
|
+
withSkipMeta(flag = true) {
|
|
152
150
|
this.parameters.skipMeta = flag;
|
|
153
151
|
return new AnalyticsRequest(this);
|
|
154
152
|
}
|
|
@@ -164,8 +162,7 @@ class extends base {
|
|
|
164
162
|
* const req = new analytics.request()
|
|
165
163
|
* .withSkipData();
|
|
166
164
|
*/
|
|
167
|
-
withSkipData() {
|
|
168
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
165
|
+
withSkipData(flag = true) {
|
|
169
166
|
this.parameters.skipData = flag;
|
|
170
167
|
return new AnalyticsRequest(this);
|
|
171
168
|
}
|
|
@@ -181,8 +178,7 @@ class extends base {
|
|
|
181
178
|
* const req = new analytics.request()
|
|
182
179
|
* .withHierarchyMeta();
|
|
183
180
|
*/
|
|
184
|
-
withHierarchyMeta() {
|
|
185
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
181
|
+
withHierarchyMeta(flag = true) {
|
|
186
182
|
this.parameters.hierarchyMeta = flag;
|
|
187
183
|
return new AnalyticsRequest(this);
|
|
188
184
|
}
|
|
@@ -198,8 +194,7 @@ class extends base {
|
|
|
198
194
|
* const req = new analytics.request()
|
|
199
195
|
* .withIgnoreLimit();
|
|
200
196
|
*/
|
|
201
|
-
withIgnoreLimit() {
|
|
202
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
197
|
+
withIgnoreLimit(flag = true) {
|
|
203
198
|
this.parameters.ignoreLimit = flag;
|
|
204
199
|
return new AnalyticsRequest(this);
|
|
205
200
|
}
|
|
@@ -215,8 +210,7 @@ class extends base {
|
|
|
215
210
|
* const req = new analytics.request()
|
|
216
211
|
* .withTableLayout();
|
|
217
212
|
*/
|
|
218
|
-
withTableLayout() {
|
|
219
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
213
|
+
withTableLayout(flag = true) {
|
|
220
214
|
this.parameters.tableLayout = flag;
|
|
221
215
|
return new AnalyticsRequest(this);
|
|
222
216
|
}
|
|
@@ -232,8 +226,7 @@ class extends base {
|
|
|
232
226
|
* const req = new analytics.request()
|
|
233
227
|
* .withHideEmptyRows();
|
|
234
228
|
*/
|
|
235
|
-
withHideEmptyRows() {
|
|
236
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
229
|
+
withHideEmptyRows(flag = true) {
|
|
237
230
|
this.parameters.hideEmptyRows = flag;
|
|
238
231
|
return new AnalyticsRequest(this);
|
|
239
232
|
}
|
|
@@ -249,8 +242,7 @@ class extends base {
|
|
|
249
242
|
* const req = new analytics.request()
|
|
250
243
|
* .withHideEmptyColumns();
|
|
251
244
|
*/
|
|
252
|
-
withHideEmptyColumns() {
|
|
253
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
245
|
+
withHideEmptyColumns(flag = true) {
|
|
254
246
|
this.parameters.hideEmptyColumns = flag;
|
|
255
247
|
return new AnalyticsRequest(this);
|
|
256
248
|
}
|
|
@@ -266,8 +258,7 @@ class extends base {
|
|
|
266
258
|
* const req = new analytics.request()
|
|
267
259
|
* .withShowHierarchy();
|
|
268
260
|
*/
|
|
269
|
-
withShowHierarchy() {
|
|
270
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
261
|
+
withShowHierarchy(flag = true) {
|
|
271
262
|
this.parameters.showHierarchy = flag;
|
|
272
263
|
return new AnalyticsRequest(this);
|
|
273
264
|
}
|
|
@@ -283,8 +274,7 @@ class extends base {
|
|
|
283
274
|
* const req = new analytics.request()
|
|
284
275
|
* .withIncludeNumDen();
|
|
285
276
|
*/
|
|
286
|
-
withIncludeNumDen() {
|
|
287
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
277
|
+
withIncludeNumDen(flag = true) {
|
|
288
278
|
this.parameters.includeNumDen = flag;
|
|
289
279
|
return new AnalyticsRequest(this);
|
|
290
280
|
}
|
|
@@ -300,8 +290,7 @@ class extends base {
|
|
|
300
290
|
* const req = new analytics.request()
|
|
301
291
|
* .withIncludeMetadataDetails();
|
|
302
292
|
*/
|
|
303
|
-
withIncludeMetadataDetails() {
|
|
304
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
293
|
+
withIncludeMetadataDetails(flag = true) {
|
|
305
294
|
this.parameters.includeMetadataDetails = flag;
|
|
306
295
|
return new AnalyticsRequest(this);
|
|
307
296
|
}
|
|
@@ -663,8 +652,7 @@ class extends base {
|
|
|
663
652
|
* const req = new analytics.request()
|
|
664
653
|
* .withCoordinatesOnly();
|
|
665
654
|
*/
|
|
666
|
-
withCoordinatesOnly() {
|
|
667
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
655
|
+
withCoordinatesOnly(flag = true) {
|
|
668
656
|
this.parameters.coordinatesOnly = flag;
|
|
669
657
|
return new AnalyticsRequest(this);
|
|
670
658
|
}
|
|
@@ -680,8 +668,7 @@ class extends base {
|
|
|
680
668
|
* const req = new analytics.request()
|
|
681
669
|
* .withPage(2);
|
|
682
670
|
*/
|
|
683
|
-
withPage() {
|
|
684
|
-
let page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
671
|
+
withPage(page = 1) {
|
|
685
672
|
this.parameters.page = page;
|
|
686
673
|
return new AnalyticsRequest(this);
|
|
687
674
|
}
|
|
@@ -697,8 +684,7 @@ class extends base {
|
|
|
697
684
|
* const req = new analytics.request()
|
|
698
685
|
* .withPageSize(10);
|
|
699
686
|
*/
|
|
700
|
-
withPageSize() {
|
|
701
|
-
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 50;
|
|
687
|
+
withPageSize(size = 50) {
|
|
702
688
|
this.parameters.pageSize = size;
|
|
703
689
|
return new AnalyticsRequest(this);
|
|
704
690
|
}
|
|
@@ -798,8 +784,7 @@ class extends base {
|
|
|
798
784
|
* const req = new analytics.request()
|
|
799
785
|
* .withCollapseDataDimensions();
|
|
800
786
|
*/
|
|
801
|
-
withCollapseDataDimensions() {
|
|
802
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
787
|
+
withCollapseDataDimensions(flag = true) {
|
|
803
788
|
this.parameters.collapseDataDimensions = flag;
|
|
804
789
|
return new AnalyticsRequest(this);
|
|
805
790
|
}
|
|
@@ -815,8 +800,7 @@ class extends base {
|
|
|
815
800
|
* const req = new analytics.request()
|
|
816
801
|
* .withSkipRounding();
|
|
817
802
|
*/
|
|
818
|
-
withSkipRounding() {
|
|
819
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
803
|
+
withSkipRounding(flag = true) {
|
|
820
804
|
this.parameters.skipRounding = flag;
|
|
821
805
|
return new AnalyticsRequest(this);
|
|
822
806
|
}
|
|
@@ -832,8 +816,7 @@ class extends base {
|
|
|
832
816
|
* const req = new analytics.request()
|
|
833
817
|
* .withAggregateData();
|
|
834
818
|
*/
|
|
835
|
-
withAggregateData() {
|
|
836
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
819
|
+
withAggregateData(flag = true) {
|
|
837
820
|
this.parameters.aggregateData = flag;
|
|
838
821
|
return new AnalyticsRequest(this);
|
|
839
822
|
}
|
|
@@ -867,8 +850,7 @@ class extends base {
|
|
|
867
850
|
* const req = new analytics.request()
|
|
868
851
|
* .withCoordinateField('<attribute-id>');
|
|
869
852
|
*/
|
|
870
|
-
withCoordinateField() {
|
|
871
|
-
let field = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'EVENT';
|
|
853
|
+
withCoordinateField(field = 'EVENT') {
|
|
872
854
|
// EVENT, <attribute-id>, <dataelement-id>
|
|
873
855
|
this.parameters.coordinateField = field;
|
|
874
856
|
return new AnalyticsRequest(this);
|
|
@@ -903,8 +885,7 @@ class extends base {
|
|
|
903
885
|
* const req = new analytics.request()
|
|
904
886
|
* .withIncludeClusterPoints();
|
|
905
887
|
*/
|
|
906
|
-
withIncludeClusterPoints() {
|
|
907
|
-
let flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
888
|
+
withIncludeClusterPoints(flag = true) {
|
|
908
889
|
this.parameters.includeClusterPoints = flag;
|
|
909
890
|
return new AnalyticsRequest(this);
|
|
910
891
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
class AnalyticsResponseHeader {
|
|
2
|
-
constructor(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
index: undefined
|
|
8
|
-
};
|
|
2
|
+
constructor(header = {}, options = {
|
|
3
|
+
isPrefix: false,
|
|
4
|
+
isCollect: false,
|
|
5
|
+
index: undefined
|
|
6
|
+
}) {
|
|
9
7
|
Object.assign(this, header, options);
|
|
10
8
|
}
|
|
11
9
|
getIndex() {
|
|
@@ -26,20 +26,18 @@ describe('generateDimensionString', () => {
|
|
|
26
26
|
outputSorted: ['dim1:item1', 'dim2:item1;item2']
|
|
27
27
|
}];
|
|
28
28
|
it('should return dimension strings correctly formatted', () => {
|
|
29
|
-
tests.forEach(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref;
|
|
29
|
+
tests.forEach(({
|
|
30
|
+
input,
|
|
31
|
+
output
|
|
32
|
+
}) => {
|
|
34
33
|
expect(generateDimensionStrings(input)).toEqual(output);
|
|
35
34
|
});
|
|
36
35
|
});
|
|
37
36
|
it('should return dimension strings correctly formatted and sorted', () => {
|
|
38
|
-
tests.forEach(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref2;
|
|
37
|
+
tests.forEach(({
|
|
38
|
+
input,
|
|
39
|
+
outputSorted
|
|
40
|
+
}) => {
|
|
43
41
|
expect(generateDimensionStrings(input, {
|
|
44
42
|
sorted: true
|
|
45
43
|
})).toEqual(outputSorted);
|
|
@@ -2,11 +2,18 @@ import fixtures from '../../../__fixtures__/fixtures.js';
|
|
|
2
2
|
import AnalyticsRequest from '../AnalyticsRequest.js';
|
|
3
3
|
let request;
|
|
4
4
|
let expectedParameters;
|
|
5
|
+
let warnMock;
|
|
5
6
|
const getFuncName = parameter => `with${parameter.charAt(0).toUpperCase()}${parameter.slice(1)}`;
|
|
6
7
|
describe('AnalyticsRequest', () => {
|
|
7
8
|
beforeEach(() => {
|
|
8
9
|
request = new AnalyticsRequest();
|
|
9
10
|
expectedParameters = {};
|
|
11
|
+
// Prevent console warnings like below from cluttering the test output:
|
|
12
|
+
// "analytics.request.withAggregationType(): "new-constant" not listed as possible value"
|
|
13
|
+
warnMock = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
warnMock.mockReset();
|
|
10
17
|
});
|
|
11
18
|
describe('constructor', () => {
|
|
12
19
|
it('should not be allowed to be called without new', () => {
|
|
@@ -280,8 +287,7 @@ describe('AnalyticsRequest', () => {
|
|
|
280
287
|
page: 1,
|
|
281
288
|
pageSize: 50
|
|
282
289
|
};
|
|
283
|
-
Object.entries(params).forEach(
|
|
284
|
-
let [key, value] = _ref;
|
|
290
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
285
291
|
const parameter = key;
|
|
286
292
|
const funcName = getFuncName(parameter);
|
|
287
293
|
it(`should add the ${parameter} parameter with the default value`, () => {
|
|
@@ -3,20 +3,14 @@ const whitelistURI = ',&$=/;:';
|
|
|
3
3
|
const whitelistURICodes = whitelistURI.split('').map(c => encodeURIComponent(c));
|
|
4
4
|
const whitelistRegExp = new RegExp(`(?:${whitelistURICodes.join('|')})`, 'g');
|
|
5
5
|
export const customEncodeURIComponent = uri => encodeURIComponent(uri).replace(whitelistRegExp, decodeURIComponent);
|
|
6
|
-
export const formatRequestPath =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
programId,
|
|
18
|
-
programStageId,
|
|
19
|
-
dimension
|
|
20
|
-
} = _ref2;
|
|
21
|
-
return [outputType === 'TRACKED_ENTITY_INSTANCE' ? programId : undefined, programStageId, dimension].filter(Boolean).join('.');
|
|
22
|
-
};
|
|
6
|
+
export const formatRequestPath = ({
|
|
7
|
+
path,
|
|
8
|
+
program,
|
|
9
|
+
trackedEntityType
|
|
10
|
+
}) => [path, program, trackedEntityType].filter(Boolean).join('/');
|
|
11
|
+
export const formatDimension = ({
|
|
12
|
+
outputType,
|
|
13
|
+
programId,
|
|
14
|
+
programStageId,
|
|
15
|
+
dimension
|
|
16
|
+
}) => [outputType === 'TRACKED_ENTITY_INSTANCE' ? programId : undefined, programStageId, dimension].filter(Boolean).join('.');
|