@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
|
@@ -3,25 +3,19 @@ import { colors } from '@dhis2/ui';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
export const ToolbarSidebar =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const ToolbarSidebar = ({
|
|
7
|
+
children,
|
|
8
|
+
dataTest = 'dhis2-analytics-toolbarsidebar',
|
|
9
|
+
isHidden
|
|
10
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
"data-test": dataTest,
|
|
12
|
+
className: _JSXStyle.dynamic([["1150014343", [colors.grey400]]]) + " " + (cx('container', {
|
|
10
13
|
isHidden
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}) || "")
|
|
17
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18
|
-
id: "1150014343",
|
|
19
|
-
dynamic: [colors.grey400]
|
|
20
|
-
}, [`div.__jsx-style-dynamic-selector{width:260px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-right:1px solid ${colors.grey400};}`, "div.isHidden.__jsx-style-dynamic-selector{display:none;}"]));
|
|
21
|
-
};
|
|
22
|
-
ToolbarSidebar.defaultProps = {
|
|
23
|
-
dataTest: 'dhis2-analytics-toolbarsidebar'
|
|
24
|
-
};
|
|
14
|
+
}) || "")
|
|
15
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
16
|
+
id: "1150014343",
|
|
17
|
+
dynamic: [colors.grey400]
|
|
18
|
+
}, [`div.__jsx-style-dynamic-selector{width:260px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-right:1px solid ${colors.grey400};}`, "div.isHidden.__jsx-style-dynamic-selector{display:none;}"]));
|
|
25
19
|
ToolbarSidebar.propTypes = {
|
|
26
20
|
children: PropTypes.node,
|
|
27
21
|
dataTest: PropTypes.string,
|
|
@@ -4,30 +4,24 @@ import { CircularLoader, IconSync16, colors } from '@dhis2/ui';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import menuButtonStyles from './MenuButton.styles.js';
|
|
7
|
-
export const UpdateButton =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
dynamic: [colors.blue700, colors.blue100, colors.blue200]
|
|
26
|
-
}, [`button.__jsx-style-dynamic-selector{gap:8px;color:${colors.blue700};font-weight:500;}`, `button.__jsx-style-dynamic-selector:hover.__jsx-style-dynamic-selector:enabled{background:${colors.blue100};}`, `button.__jsx-style-dynamic-selector:active{background:${colors.blue200};}`]));
|
|
27
|
-
};
|
|
28
|
-
UpdateButton.defaultProps = {
|
|
29
|
-
dataTest: 'dhis2-analytics-updatebutton'
|
|
30
|
-
};
|
|
7
|
+
export const UpdateButton = ({
|
|
8
|
+
onClick,
|
|
9
|
+
disabled,
|
|
10
|
+
loading,
|
|
11
|
+
dataTest = 'dhis2-analytics-updatebutton'
|
|
12
|
+
}) => /*#__PURE__*/React.createElement("button", {
|
|
13
|
+
onClick: onClick,
|
|
14
|
+
disabled: disabled,
|
|
15
|
+
"data-test": dataTest,
|
|
16
|
+
className: `jsx-${menuButtonStyles.__hash}` + " " + _JSXStyle.dynamic([["2364287882", [colors.blue700, colors.blue100, colors.blue200]]])
|
|
17
|
+
}, loading ? /*#__PURE__*/React.createElement(CircularLoader, {
|
|
18
|
+
extrasmall: true
|
|
19
|
+
}) : /*#__PURE__*/React.createElement(IconSync16, null), i18n.t('Update'), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20
|
+
id: menuButtonStyles.__hash
|
|
21
|
+
}, menuButtonStyles), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
22
|
+
id: "2364287882",
|
|
23
|
+
dynamic: [colors.blue700, colors.blue100, colors.blue200]
|
|
24
|
+
}, [`button.__jsx-style-dynamic-selector{gap:8px;color:${colors.blue700};font-weight:500;}`, `button.__jsx-style-dynamic-selector:hover.__jsx-style-dynamic-selector:enabled{background:${colors.blue100};}`, `button.__jsx-style-dynamic-selector:active{background:${colors.blue200};}`]));
|
|
31
25
|
UpdateButton.propTypes = {
|
|
32
26
|
onClick: PropTypes.func.isRequired,
|
|
33
27
|
dataTest: PropTypes.string,
|
|
@@ -4,21 +4,20 @@ import cx from 'classnames';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styles from './styles/TransferOption.style.js';
|
|
7
|
-
export const TransferOption =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
7
|
+
export const TransferOption = ({
|
|
8
|
+
disabled,
|
|
9
|
+
label,
|
|
10
|
+
highlighted,
|
|
11
|
+
selected,
|
|
12
|
+
onClick,
|
|
13
|
+
onDoubleClick,
|
|
14
|
+
value,
|
|
15
|
+
icon,
|
|
16
|
+
active,
|
|
17
|
+
tooltipText,
|
|
18
|
+
dataTest,
|
|
19
|
+
onEditClick
|
|
20
|
+
}) => {
|
|
22
21
|
const renderContent = () => /*#__PURE__*/React.createElement("div", {
|
|
23
22
|
"data-test": `${dataTest}-content`,
|
|
24
23
|
onClick: event => {
|
|
@@ -8,33 +8,28 @@ const query = {
|
|
|
8
8
|
resource: 'locales/db'
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
export const LocalesSelect =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
11
|
+
export const LocalesSelect = ({
|
|
12
|
+
onChange,
|
|
13
|
+
selected
|
|
14
|
+
}) => {
|
|
16
15
|
const {
|
|
17
16
|
data,
|
|
18
17
|
fetching
|
|
19
18
|
} = useDataQuery(query);
|
|
20
19
|
return /*#__PURE__*/React.createElement(SingleSelect, {
|
|
21
20
|
prefix: selected ? i18n.t('Translating to') : i18n.t('Choose a locale'),
|
|
22
|
-
onChange:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref2;
|
|
26
|
-
return onChange(selected);
|
|
27
|
-
},
|
|
21
|
+
onChange: ({
|
|
22
|
+
selected
|
|
23
|
+
}) => onChange(selected),
|
|
28
24
|
loading: fetching,
|
|
29
25
|
selected: data && selected ? selected : '',
|
|
30
26
|
dense: true
|
|
31
27
|
}, data && data.locales
|
|
32
28
|
// XXX remove duplicates ?! fr_SN - French (Senegal)
|
|
33
|
-
.reduce((locales,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref3;
|
|
29
|
+
.reduce((locales, {
|
|
30
|
+
locale,
|
|
31
|
+
name
|
|
32
|
+
}) => {
|
|
38
33
|
if (!locales.find(entry => entry.locale === locale)) {
|
|
39
34
|
locales.push({
|
|
40
35
|
locale,
|
|
@@ -42,17 +37,14 @@ export const LocalesSelect = _ref => {
|
|
|
42
37
|
});
|
|
43
38
|
}
|
|
44
39
|
return locales;
|
|
45
|
-
}, []).map(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
label: name
|
|
54
|
-
});
|
|
55
|
-
}));
|
|
40
|
+
}, []).map(({
|
|
41
|
+
locale,
|
|
42
|
+
name
|
|
43
|
+
}) => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
44
|
+
key: locale,
|
|
45
|
+
value: locale,
|
|
46
|
+
label: name
|
|
47
|
+
})));
|
|
56
48
|
};
|
|
57
49
|
LocalesSelect.propTypes = {
|
|
58
50
|
onChange: PropTypes.func.isRequired,
|
|
@@ -7,15 +7,14 @@ import { LocalesSelect } from './LocalesSelect.js';
|
|
|
7
7
|
import { TranslationModalActions } from './TranslationModalActions.js';
|
|
8
8
|
const SESSION_STORAGE_TRANSLATION_LOCALE_KEY = 'translation-dialog-selected-locale';
|
|
9
9
|
const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
|
|
10
|
-
export const TranslationForm =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
10
|
+
export const TranslationForm = ({
|
|
11
|
+
fieldsToTranslate,
|
|
12
|
+
objectToTranslate,
|
|
13
|
+
translations,
|
|
14
|
+
resource,
|
|
15
|
+
onTranslationSaved,
|
|
16
|
+
onClose
|
|
17
|
+
}) => {
|
|
19
18
|
const [newTranslations, setNewTranslations] = useState();
|
|
20
19
|
const [translationLocale, setTranslationLocale] = useState();
|
|
21
20
|
const [fieldsTranslations, setFieldsTranslations] = useState({});
|
|
@@ -68,14 +67,11 @@ export const TranslationForm = _ref => {
|
|
|
68
67
|
const translationsMutationRef = useRef({
|
|
69
68
|
resource: `${resource}/translations`,
|
|
70
69
|
type: 'update',
|
|
71
|
-
data:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
translations
|
|
77
|
-
};
|
|
78
|
-
}
|
|
70
|
+
data: ({
|
|
71
|
+
translations
|
|
72
|
+
}) => ({
|
|
73
|
+
translations
|
|
74
|
+
})
|
|
79
75
|
});
|
|
80
76
|
const [saveTranslations, {
|
|
81
77
|
loading: saveInProgress
|
|
@@ -119,12 +115,9 @@ export const TranslationForm = _ref => {
|
|
|
119
115
|
})), translationLocale && /*#__PURE__*/React.createElement(DataTableCell, null, /*#__PURE__*/React.createElement(TextAreaField, {
|
|
120
116
|
label: fieldsTranslations[field],
|
|
121
117
|
value: getTranslationForField(field),
|
|
122
|
-
onChange:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} = _ref3;
|
|
126
|
-
return setTranslationForField(field, value);
|
|
127
|
-
},
|
|
118
|
+
onChange: ({
|
|
119
|
+
value
|
|
120
|
+
}) => setTranslationForField(field, value),
|
|
128
121
|
rows: 3
|
|
129
122
|
})), !translationLocale && index === 0 && /*#__PURE__*/React.createElement(DataTableCell, {
|
|
130
123
|
rowSpan: String(fieldsToTranslate.length)
|
|
@@ -5,16 +5,15 @@ import React, { useEffect, useState } from 'react';
|
|
|
5
5
|
import { TranslationForm } from './TranslationForm.js';
|
|
6
6
|
import { TranslationModalActions } from './TranslationModalActions.js';
|
|
7
7
|
import { useTranslationsResults } from './useTranslationsResults.js';
|
|
8
|
-
export const TranslationModal =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
8
|
+
export const TranslationModal = ({
|
|
9
|
+
objectToTranslate,
|
|
10
|
+
fieldsToTranslate,
|
|
11
|
+
onClose,
|
|
12
|
+
onTranslationSaved
|
|
13
|
+
}) => {
|
|
15
14
|
const [translations, setTranslations] = useState([]);
|
|
16
15
|
const endpointPath = new URL(objectToTranslate.href).pathname;
|
|
17
|
-
const endpointPathMatch = endpointPath.match(/api
|
|
16
|
+
const endpointPathMatch = endpointPath.match(/api\/(?:\d+\/)?(?<resource>.+)/);
|
|
18
17
|
const resource = endpointPathMatch !== null && endpointPathMatch !== void 0 && endpointPathMatch.groups ? endpointPathMatch.groups.resource : null;
|
|
19
18
|
const {
|
|
20
19
|
translationsData,
|
|
@@ -4,36 +4,27 @@ import { Button, ButtonStrip, ModalActions } from '@dhis2/ui';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { OfflineTooltip } from '../../OfflineTooltip.js';
|
|
7
|
-
const SaveButton =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
disabled: disabled
|
|
18
|
-
}, i18n.t('Save translations'));
|
|
19
|
-
};
|
|
20
|
-
SaveButton.defaultProps = {
|
|
21
|
-
disabled: false,
|
|
22
|
-
loading: false,
|
|
23
|
-
onClick: Function.prototype
|
|
24
|
-
};
|
|
7
|
+
const SaveButton = ({
|
|
8
|
+
disabled = false,
|
|
9
|
+
loading = false,
|
|
10
|
+
onClick = Function.prototype
|
|
11
|
+
}) => /*#__PURE__*/React.createElement(Button, {
|
|
12
|
+
primary: true,
|
|
13
|
+
onClick: onClick,
|
|
14
|
+
loading: loading,
|
|
15
|
+
disabled: disabled
|
|
16
|
+
}, i18n.t('Save translations'));
|
|
25
17
|
SaveButton.propTypes = {
|
|
26
18
|
disabled: PropTypes.bool.isRequired,
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
onClick: PropTypes.func.isRequired,
|
|
20
|
+
loading: PropTypes.bool
|
|
29
21
|
};
|
|
30
|
-
export const TranslationModalActions =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref2;
|
|
22
|
+
export const TranslationModalActions = ({
|
|
23
|
+
onClose,
|
|
24
|
+
onSave = Function.prototype,
|
|
25
|
+
saveInProgress,
|
|
26
|
+
saveButtonDisabled
|
|
27
|
+
}) => {
|
|
37
28
|
const {
|
|
38
29
|
isDisconnected: offline
|
|
39
30
|
} = useDhis2ConnectionStatus();
|
package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ModalTitle, Modal } from '@dhis2/ui';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { TranslationModal } from '../TranslationModal.js';
|
|
5
|
+
const mockUseTranslationResults = jest.fn(() => ({
|
|
6
|
+
translationsData: undefined,
|
|
7
|
+
fetching: false
|
|
8
|
+
}));
|
|
9
|
+
jest.mock('../useTranslationsResults.js', () => ({
|
|
10
|
+
useTranslationsResults: args => mockUseTranslationResults(args)
|
|
11
|
+
}));
|
|
12
|
+
describe('The Translation Dialog component', () => {
|
|
13
|
+
let shallowTranslationModal;
|
|
14
|
+
let props;
|
|
15
|
+
const onClose = jest.fn();
|
|
16
|
+
const onTranslationSaved = jest.fn();
|
|
17
|
+
const getTranslationModalComponent = props => {
|
|
18
|
+
if (!shallowTranslationModal) {
|
|
19
|
+
shallowTranslationModal = shallow(/*#__PURE__*/React.createElement(TranslationModal, props));
|
|
20
|
+
}
|
|
21
|
+
return shallowTranslationModal;
|
|
22
|
+
};
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
shallowTranslationModal = undefined;
|
|
25
|
+
props = {
|
|
26
|
+
fieldsToTranslate: ['name', 'description'],
|
|
27
|
+
objectToTranslate: {
|
|
28
|
+
name: 'Test object',
|
|
29
|
+
href: 'https://dhis2.tld/path/api/visualization/object-id'
|
|
30
|
+
},
|
|
31
|
+
onClose,
|
|
32
|
+
onTranslationSaved
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
it('renders a Modal component', () => {
|
|
36
|
+
expect(getTranslationModalComponent(props).find(Modal)).toHaveLength(1);
|
|
37
|
+
});
|
|
38
|
+
it("renders a ModalTitle containing the object's name", () => {
|
|
39
|
+
expect(getTranslationModalComponent(props).find(ModalTitle).childAt(0).text()).toEqual(`Translate: ${props.objectToTranslate.name}`);
|
|
40
|
+
});
|
|
41
|
+
test.each(['https://dhis2.tld/path/api/visualization/object-id', 'https://dhis2.tld/path/api/42/visualization/object-id'])('uses the correct resource for the translation endpoint', href => {
|
|
42
|
+
props.objectToTranslate.href = href;
|
|
43
|
+
getTranslationModalComponent(props);
|
|
44
|
+
expect(mockUseTranslationResults).toHaveBeenCalled();
|
|
45
|
+
expect(mockUseTranslationResults).toHaveBeenCalledWith({
|
|
46
|
+
resource: 'visualization/object-id'
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useAlert, useDataQuery } from '@dhis2/app-runtime';
|
|
2
2
|
import i18n from '@dhis2/d2-i18n';
|
|
3
3
|
import { useRef } from 'react';
|
|
4
|
-
export const useTranslationsResults =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} = _ref;
|
|
4
|
+
export const useTranslationsResults = ({
|
|
5
|
+
resource
|
|
6
|
+
}) => {
|
|
8
7
|
const translationsQueryRef = useRef({
|
|
9
8
|
translations: {
|
|
10
9
|
resource: `${resource}/translations`
|
|
@@ -2,13 +2,12 @@ import i18n from '@dhis2/d2-i18n';
|
|
|
2
2
|
import { MenuItem } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export const UserList =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
5
|
+
export const UserList = ({
|
|
6
|
+
users,
|
|
7
|
+
selectedUserIndex,
|
|
8
|
+
onUserClick,
|
|
9
|
+
pager
|
|
10
|
+
}) => {
|
|
12
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, users.map(u => {
|
|
13
12
|
var _users$selectedUserIn;
|
|
14
13
|
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
@@ -23,12 +23,11 @@ const getVirtualPopperReference = ref => {
|
|
|
23
23
|
})
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export const UserMentionWrapper =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
26
|
+
export const UserMentionWrapper = ({
|
|
27
|
+
children,
|
|
28
|
+
inputReference,
|
|
29
|
+
onUserSelect = Function.prototype
|
|
30
|
+
}) => {
|
|
32
31
|
const [listIsOpen, setListIsOpen] = useState(false);
|
|
33
32
|
const [captureText, setCaptureText] = useState(false);
|
|
34
33
|
const [capturedText, setCapturedText] = useState('');
|
|
@@ -61,10 +60,9 @@ export const UserMentionWrapper = _ref => {
|
|
|
61
60
|
const onUserListClose = () => reset();
|
|
62
61
|
|
|
63
62
|
// event bubbles up from the input/textarea
|
|
64
|
-
const onInput =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} = _ref2;
|
|
63
|
+
const onInput = ({
|
|
64
|
+
target
|
|
65
|
+
}) => {
|
|
68
66
|
const {
|
|
69
67
|
selectionEnd,
|
|
70
68
|
value
|
|
@@ -83,11 +81,10 @@ export const UserMentionWrapper = _ref => {
|
|
|
83
81
|
};
|
|
84
82
|
|
|
85
83
|
// event bubbles up from the wrapped input/textarea
|
|
86
|
-
const onKeyDown =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} = _ref3;
|
|
84
|
+
const onKeyDown = ({
|
|
85
|
+
key,
|
|
86
|
+
target
|
|
87
|
+
}) => {
|
|
91
88
|
const {
|
|
92
89
|
selectionStart
|
|
93
90
|
} = target;
|
|
@@ -187,9 +184,6 @@ export const UserMentionWrapper = _ref => {
|
|
|
187
184
|
id: userMentionWrapperClasses.__hash
|
|
188
185
|
}, userMentionWrapperClasses), resolvedHeaderStyle.styles);
|
|
189
186
|
};
|
|
190
|
-
UserMentionWrapper.defaultProps = {
|
|
191
|
-
onUserSelect: Function.prototype
|
|
192
|
-
};
|
|
193
187
|
UserMentionWrapper.propTypes = {
|
|
194
188
|
inputReference: PropTypes.object.isRequired,
|
|
195
189
|
onUserSelect: PropTypes.func.isRequired,
|
|
@@ -4,24 +4,20 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
4
4
|
const usersQuery = {
|
|
5
5
|
users: {
|
|
6
6
|
resource: 'users/gist',
|
|
7
|
-
params:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
rootJunction: 'OR'
|
|
17
|
-
};
|
|
18
|
-
}
|
|
7
|
+
params: ({
|
|
8
|
+
searchText
|
|
9
|
+
}) => ({
|
|
10
|
+
fields: 'id,displayName,username',
|
|
11
|
+
order: 'firstName,surname',
|
|
12
|
+
total: true,
|
|
13
|
+
filter: `username:ilike:${searchText},firstName:ilike:${searchText},surname:ilike:${searchText},email:ilike:${searchText}`,
|
|
14
|
+
rootJunction: 'OR'
|
|
15
|
+
})
|
|
19
16
|
}
|
|
20
17
|
};
|
|
21
|
-
export const useUserSearchResults =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref2;
|
|
18
|
+
export const useUserSearchResults = ({
|
|
19
|
+
searchText
|
|
20
|
+
}) => {
|
|
25
21
|
const [{
|
|
26
22
|
users,
|
|
27
23
|
pager
|
|
@@ -2,12 +2,11 @@ import { IconVisualizationArea16, IconVisualizationAreaStacked16, IconVisualizat
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { VIS_TYPE_LINE_LIST, VIS_TYPE_PIVOT_TABLE, VIS_TYPE_COLUMN, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR, VIS_TYPE_LINE, VIS_TYPE_AREA, VIS_TYPE_STACKED_AREA, VIS_TYPE_PIE, VIS_TYPE_RADAR, VIS_TYPE_GAUGE, VIS_TYPE_YEAR_OVER_YEAR_LINE, VIS_TYPE_YEAR_OVER_YEAR_COLUMN, VIS_TYPE_SINGLE_VALUE, VIS_TYPE_SCATTER, VIS_TYPE_OUTLIER_TABLE } from '../modules/visTypes.js';
|
|
5
|
-
export const VisTypeIcon =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
5
|
+
export const VisTypeIcon = ({
|
|
6
|
+
type,
|
|
7
|
+
useSmall = false,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
11
10
|
let VisIcon;
|
|
12
11
|
switch (type) {
|
|
13
12
|
case VIS_TYPE_LINE_LIST:
|
|
@@ -49,11 +49,6 @@
|
|
|
49
49
|
"No data elements found": "",
|
|
50
50
|
"Drag items here, or double click in the list, to start building a calculation formula": "",
|
|
51
51
|
"Math operators": "",
|
|
52
|
-
"Data Type": "",
|
|
53
|
-
"Only {{dataType}} can be used in {{visType}}": "",
|
|
54
|
-
"All types": "",
|
|
55
|
-
"Disaggregation": "",
|
|
56
|
-
"No data": "",
|
|
57
52
|
"Expression description": "",
|
|
58
53
|
"Error loading value": "",
|
|
59
54
|
"None": "لا شيء",
|
|
@@ -102,9 +97,24 @@
|
|
|
102
97
|
"{{ offsetPeriodType }} × {{ offsetPeriods }}": "",
|
|
103
98
|
"Expression": "",
|
|
104
99
|
"Filter": "",
|
|
100
|
+
"All available options are already selected": "",
|
|
101
|
+
"No available options for this item": "",
|
|
102
|
+
"Search by option name": "",
|
|
103
|
+
"Back to all items": "",
|
|
104
|
+
"Options": "الخيارات",
|
|
105
|
+
"Selected items": "",
|
|
106
|
+
"Data Type": "",
|
|
107
|
+
"Only {{dataType}} can be used in {{visType}}": "",
|
|
108
|
+
"All types": "",
|
|
109
|
+
"Disaggregation": "",
|
|
110
|
+
"No data": "",
|
|
105
111
|
"Search by data item name": "",
|
|
106
|
-
"No items selected": "",
|
|
107
112
|
"Selected Items": "",
|
|
113
|
+
"All available items are already selected": "",
|
|
114
|
+
"Calculation": "",
|
|
115
|
+
"Metric type": "",
|
|
116
|
+
"All metrics": "",
|
|
117
|
+
"No items selected": "",
|
|
108
118
|
"No indicators found": "",
|
|
109
119
|
"No data sets found": "",
|
|
110
120
|
"No event data items found": "",
|
|
@@ -116,9 +126,7 @@
|
|
|
116
126
|
"No program indicators found for \"{{- searchTerm}}\"": "",
|
|
117
127
|
"No calculations found for \"{{- searchTerm}}\"": "",
|
|
118
128
|
"Nothing found for \"{{- searchTerm}}\"": "",
|
|
119
|
-
"
|
|
120
|
-
"Metric type": "",
|
|
121
|
-
"All metrics": "",
|
|
129
|
+
"Click to choose from available options": "",
|
|
122
130
|
"Move to {{axisName}}": "",
|
|
123
131
|
"Add to {{axisName}}": "",
|
|
124
132
|
"Not available for {{visualizationType}}": "",
|
|
@@ -135,7 +143,6 @@
|
|
|
135
143
|
"Manually select items...": "",
|
|
136
144
|
"Nothing found in {{- dimensionTitle}}": "",
|
|
137
145
|
"Search": "البحث",
|
|
138
|
-
"Nothing found for {{- searchTerm}}": "",
|
|
139
146
|
"Delete {{fileType}}": "",
|
|
140
147
|
"This {{fileType}} and related interpretations will be deleted. Continue?": "",
|
|
141
148
|
"Delete": "حذف",
|
|
@@ -159,6 +166,7 @@
|
|
|
159
166
|
"line list": "",
|
|
160
167
|
"map": "",
|
|
161
168
|
"visualization": "",
|
|
169
|
+
"Untitled {{visualizationType}}, {{date}}": "",
|
|
162
170
|
"Edit": "تعديل",
|
|
163
171
|
"Write a reply": "",
|
|
164
172
|
"Post reply": "",
|
|
@@ -227,7 +235,6 @@
|
|
|
227
235
|
"No line lists found. Click New line list to get started.": "",
|
|
228
236
|
"No line lists found. Try adjusting your search or filter options to find what you're looking for.": "",
|
|
229
237
|
"New line list": "",
|
|
230
|
-
"Options": "الخيارات",
|
|
231
238
|
"Hide": "إخفاء",
|
|
232
239
|
"{{count}} org units_0": "",
|
|
233
240
|
"{{count}} org units_1": "",
|
|
@@ -383,6 +390,7 @@
|
|
|
383
390
|
"Program indicators": "",
|
|
384
391
|
"Program indicator": "",
|
|
385
392
|
"Calculations": "",
|
|
393
|
+
"Option": "",
|
|
386
394
|
"Number": "",
|
|
387
395
|
"Formula is empty. Add items to the formula from the lists on the left.": "",
|
|
388
396
|
"Consecutive math operators": "",
|
|
@@ -464,6 +472,7 @@
|
|
|
464
472
|
"Single value": "",
|
|
465
473
|
"Outlier table": "",
|
|
466
474
|
"All charts": "",
|
|
475
|
+
"Map": "الخريطة",
|
|
467
476
|
"{{seriesName}} (trend)": "",
|
|
468
477
|
"Trend": "",
|
|
469
478
|
"No legend for this series": "",
|
|
@@ -164,6 +164,7 @@
|
|
|
164
164
|
"line list": "seznam řádků",
|
|
165
165
|
"map": "mapa",
|
|
166
166
|
"visualization": "vizualizace",
|
|
167
|
+
"Untitled {{visualizationType}}, {{date}}": "",
|
|
167
168
|
"Edit": "Upravit",
|
|
168
169
|
"Write a reply": "Napsat odpověď",
|
|
169
170
|
"Post reply": "Odpovědět",
|
|
@@ -461,6 +462,7 @@
|
|
|
461
462
|
"Single value": "Jedna hodnota",
|
|
462
463
|
"Outlier table": "",
|
|
463
464
|
"All charts": "Všechny grafy",
|
|
465
|
+
"Map": "Mapa",
|
|
464
466
|
"{{seriesName}} (trend)": "{{seriesName}} (trend)",
|
|
465
467
|
"Trend": "Trend",
|
|
466
468
|
"No legend for this series": "Pro tuto sérii není legenda",
|