@dhis2/analytics 26.9.0 → 26.9.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__/CalculationModal.stories.js +38 -16
- package/build/cjs/__demo__/DimensionsPanel.stories.js +65 -27
- package/build/cjs/__demo__/DynamicDimension.stories.js +30 -12
- package/build/cjs/__demo__/FileMenu.stories.js +27 -10
- package/build/cjs/__demo__/Filter.stories.js +20 -10
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +35 -17
- package/build/cjs/__demo__/InterpretationsUnit.stories.js +22 -11
- package/build/cjs/__demo__/OpenFileDialog.stories.js +44 -27
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +103 -54
- package/build/cjs/__demo__/PeriodDimension.stories.js +64 -23
- package/build/cjs/__demo__/PivotTable.stories.js +413 -210
- package/build/cjs/__demo__/SingleValue.stories.js +37 -59
- package/build/cjs/__demo__/Toolbar.stories.js +44 -34
- package/build/cjs/__fixtures__/fixtures.js +2 -3
- package/build/cjs/api/analytics/Analytics.js +2 -3
- package/build/cjs/api/analytics/AnalyticsAggregate.js +2 -3
- package/build/cjs/api/analytics/AnalyticsBase.js +2 -3
- package/build/cjs/api/analytics/AnalyticsEnrollments.js +2 -3
- package/build/cjs/api/analytics/AnalyticsEvents.js +2 -3
- package/build/cjs/api/analytics/AnalyticsRequest.js +2 -3
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +2 -3
- package/build/cjs/api/analytics/AnalyticsRequestDimensionsMixin.js +2 -3
- package/build/cjs/api/analytics/AnalyticsRequestFiltersMixin.js +2 -3
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +2 -3
- package/build/cjs/api/analytics/AnalyticsResponse.js +2 -4
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +1 -2
- package/build/cjs/api/analytics/AnalyticsTrackedEntities.js +2 -3
- package/build/cjs/api/analytics/__tests__/Analytics.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +2 -2
- package/build/cjs/api/analytics/__tests__/AnalyticsEnrollments.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsEvents.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsResponse.spec.js +1 -1
- package/build/cjs/api/analytics/__tests__/AnalyticsResponseHeader.spec.js +1 -1
- package/build/cjs/api/dimensions.js +11 -21
- package/build/cjs/api/expression.js +5 -9
- package/build/cjs/assets/AssignedCategoriesIcon.js +2 -3
- package/build/cjs/assets/DimensionItemIcons/CalculationIcon.js +3 -4
- package/build/cjs/assets/DimensionItemIcons/DataElementIcon.js +3 -4
- package/build/cjs/assets/DimensionItemIcons/GenericIcon.js +3 -4
- package/build/cjs/assets/DimensionItemIcons/PeriodIcon.js +3 -4
- package/build/cjs/assets/DynamicDimensionIcon.js +2 -3
- package/build/cjs/assets/FormulaIcon.js +2 -3
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +4 -5
- package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +1 -2
- package/build/cjs/components/AboutAOUnit/utils.js +7 -13
- package/build/cjs/components/CachedDataQueryProvider.js +3 -3
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +3 -4
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +8 -10
- package/build/cjs/components/DataDimension/Calculation/DragHandleIcon.js +3 -4
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +2 -3
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +2 -3
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +4 -7
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +2 -3
- package/build/cjs/components/DataDimension/Calculation/Operator.js +3 -4
- package/build/cjs/components/DataDimension/Calculation/styles/CalculationModal.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/DataElementOption.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/DataElementSelector.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/DraggingItem.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/DropZone.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/FormulaField.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/FormulaItem.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/MathOperatorSelector.style.js +1 -2
- package/build/cjs/components/DataDimension/Calculation/styles/Operator.style.js +1 -2
- package/build/cjs/components/DataDimension/DataDimension.js +4 -5
- package/build/cjs/components/DataDimension/DataTypeSelector.js +2 -3
- package/build/cjs/components/DataDimension/DetailSelector.js +2 -3
- package/build/cjs/components/DataDimension/GroupSelector.js +4 -5
- package/build/cjs/components/DataDimension/ItemSelector.js +5 -7
- package/build/cjs/components/DataDimension/MetricSelector.js +2 -3
- package/build/cjs/components/DataDimension/styles/DataTypeSelector.style.js +1 -2
- package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -2
- package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -2
- package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -2
- package/build/cjs/components/DimensionMenu.js +5 -6
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +7 -8
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +7 -8
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +2 -3
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +2 -3
- package/build/cjs/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +2 -2
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +1 -2
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -2
- package/build/cjs/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +2 -3
- package/build/cjs/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +2 -2
- package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +2 -3
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +3 -5
- package/build/cjs/components/DynamicDimension/ItemSelector.js +5 -7
- package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -2
- package/build/cjs/components/FileMenu/DeleteDialog.js +3 -3
- package/build/cjs/components/FileMenu/FileMenu.js +4 -5
- package/build/cjs/components/FileMenu/FileMenu.styles.js +2 -4
- package/build/cjs/components/FileMenu/GetLinkDialog.js +1 -1
- package/build/cjs/components/FileMenu/GetLinkDialog.styles.js +1 -2
- package/build/cjs/components/FileMenu/RenameDialog.js +3 -3
- package/build/cjs/components/FileMenu/SaveAsDialog.js +3 -3
- package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +2 -2
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +2 -2
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +2 -2
- package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +2 -2
- package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +2 -2
- package/build/cjs/components/FileMenu/utils.js +6 -11
- package/build/cjs/components/Filter/Filter.js +2 -3
- package/build/cjs/components/Filter/__tests__/Filter.spec.js +2 -2
- package/build/cjs/components/Filter/styles/Filter.style.js +1 -2
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +3 -3
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +1 -1
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +4 -5
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +3 -3
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +1 -1
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +3 -3
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +3 -3
- package/build/cjs/components/Interpretations/common/Message/Message.js +1 -1
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +1 -1
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +1 -1
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +1 -1
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +5 -6
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +1 -1
- package/build/cjs/components/LegendKey/LegendKey.js +2 -3
- package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -2
- package/build/cjs/components/OfflineTooltip.js +1 -1
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +5 -9
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -3
- package/build/cjs/components/OpenFileDialog/DateField.js +2 -3
- package/build/cjs/components/OpenFileDialog/FileList.js +2 -3
- package/build/cjs/components/OpenFileDialog/NameFilter.js +2 -3
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +4 -5
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -2
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +2 -3
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +2 -3
- package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -2
- package/build/cjs/components/OpenFileDialog/utils.js +5 -9
- package/build/cjs/components/Options/VisualizationOptions.js +4 -5
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +17 -32
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +6 -10
- package/build/cjs/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +60 -0
- package/build/cjs/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +94 -0
- package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +1 -2
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +2 -3
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +7 -8
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +2 -3
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +5 -6
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -3
- package/build/cjs/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +2 -2
- package/build/cjs/components/PeriodDimension/__tests__/PeriodDimension.spec.js +2 -2
- package/build/cjs/components/PeriodDimension/__tests__/PeriodSelector.spec.js +2 -2
- package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -2
- package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -2
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +1 -2
- package/build/cjs/components/PeriodDimension/utils/index.js +19 -38
- package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableBody.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -3
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableHead.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableRow.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +3 -3
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +1 -1
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +3 -3
- package/build/cjs/components/PivotTable/icons/SortIconAscending.js +1 -1
- package/build/cjs/components/PivotTable/icons/SortIconDescending.js +1 -1
- package/build/cjs/components/PivotTable/icons/SortIconIdle.js +1 -1
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -6
- package/build/cjs/components/RichText/Editor/Editor.js +4 -5
- package/build/cjs/components/RichText/Editor/__tests__/Editor.spec.js +2 -2
- package/build/cjs/components/RichText/Editor/markdownHandler.js +9 -18
- package/build/cjs/components/RichText/Editor/styles/Editor.style.js +4 -8
- package/build/cjs/components/RichText/Parser/MdParser.js +1 -1
- package/build/cjs/components/RichText/Parser/Parser.js +3 -3
- package/build/cjs/components/RichText/Parser/__tests__/Parser.spec.js +2 -2
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +3 -3
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +3 -3
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +3 -3
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +4 -4
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.styles.js +1 -2
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -4
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +3 -3
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +7 -7
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +5 -5
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +1 -1
- package/build/cjs/components/Toolbar/MenuButton.styles.js +1 -2
- package/build/cjs/components/Toolbar/Toolbar.js +1 -1
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +1 -1
- package/build/cjs/components/Toolbar/UpdateButton.js +2 -2
- package/build/cjs/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +6 -6
- package/build/cjs/components/Toolbar/__tests__/Toolbar.spec.js +3 -3
- package/build/cjs/components/Toolbar/__tests__/ToolbarSidebar.spec.js +4 -4
- package/build/cjs/components/Toolbar/__tests__/UpdateButton.spec.js +5 -5
- package/build/cjs/components/TransferOption.js +1 -1
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +1 -1
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +3 -3
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +3 -3
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +1 -1
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +1 -1
- package/build/cjs/components/UserMention/UserList.js +1 -1
- package/build/cjs/components/UserMention/UserMentionWrapper.js +3 -4
- package/build/cjs/components/UserMention/styles/UserMentionWrapper.style.js +4 -6
- package/build/cjs/components/UserMention/useUserSearchResults.js +1 -1
- package/build/cjs/components/VisTypeIcon.js +2 -3
- package/build/cjs/components/styles/DimensionSelector.style.js +1 -2
- package/build/cjs/components/styles/DimensionsPanel.style.js +2 -3
- package/build/cjs/components/styles/OfflineTooltip.style.js +1 -2
- package/build/cjs/components/styles/TransferOption.style.js +1 -2
- package/build/cjs/index.js +3 -3
- package/build/cjs/locales/index.js +2 -3
- package/build/cjs/locales/pt/translations.json +251 -242
- package/build/cjs/locales/vi/translations.json +20 -16
- package/build/cjs/locales/zh/translations.json +2 -0
- package/build/cjs/modules/__tests__/getOuLevelAndGroupText.spec.js +9 -0
- package/build/cjs/modules/axis.js +1 -1
- package/build/cjs/modules/dataSets.js +8 -14
- package/build/cjs/modules/dataTypes.js +24 -47
- package/build/cjs/modules/dimensionListItem.js +1 -1
- package/build/cjs/modules/dimensionSelectorHelper.js +3 -6
- package/build/cjs/modules/expressions.js +6 -11
- package/build/cjs/modules/fontStyle.js +19 -37
- package/build/cjs/modules/getAdaptedUiLayoutByType.js +1 -1
- package/build/cjs/modules/getOuLevelAndGroupText.js +5 -2
- package/build/cjs/modules/hash.js +1 -1
- package/build/cjs/modules/layout/axis.js +10 -16
- package/build/cjs/modules/layout/dimension.js +11 -19
- package/build/cjs/modules/layout/item.js +5 -7
- package/build/cjs/modules/layout/layout.js +3 -4
- package/build/cjs/modules/layout/testResources.js +39 -71
- package/build/cjs/modules/layoutTypes.js +8 -16
- package/build/cjs/modules/layoutUiRules/rules.js +4 -7
- package/build/cjs/modules/legends.js +4 -8
- package/build/cjs/modules/list.js +1 -1
- package/build/cjs/modules/ouIdHelper/index.js +5 -9
- package/build/cjs/modules/outliers/index.js +13 -25
- package/build/cjs/modules/outliers/iqr.js +5 -9
- package/build/cjs/modules/outliers/modZScore.js +2 -3
- package/build/cjs/modules/outliers/normalization.js +2 -2
- package/build/cjs/modules/outliers/zScore.js +2 -3
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +3 -3
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +4 -4
- package/build/cjs/modules/pivotTable/clipAxis.js +1 -1
- package/build/cjs/modules/pivotTable/pivotTableConstants.js +32 -62
- package/build/cjs/modules/pivotTable/useParentSize.js +1 -1
- package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -1
- package/build/cjs/modules/pivotTable/useSortableColumns.js +0 -1
- package/build/cjs/modules/predefinedDimensions.js +6 -11
- package/build/cjs/modules/valueTypes.js +21 -42
- package/build/cjs/modules/visTypes.js +24 -47
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart/default.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart/singleValue.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueFormattedValue.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/constants.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/index.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/styles.js +3 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/exporting.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getCategories.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getCumulativeData.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +3 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/pane/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/scatter.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/__tests__/singleValue.spec.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/gauge.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +5 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/singleValue.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/singleValue.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/yearOverYear.js +3 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/radar.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/scatter.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/twoCategory.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/yearOnYear.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +3 -3
- package/build/cjs/visualizations/config/adapters/index.js +3 -4
- package/build/cjs/visualizations/config/generators/highcharts/index.js +1 -5
- package/build/cjs/visualizations/config/generators/index.js +3 -4
- package/build/cjs/visualizations/config/index.js +1 -1
- package/build/cjs/visualizations/config/validators/index.js +3 -4
- package/build/cjs/visualizations/index.js +2 -3
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
- package/build/cjs/visualizations/store/adapters/index.js +3 -4
- package/build/cjs/visualizations/store/index.js +1 -1
- package/build/cjs/visualizations/store/validators/dhis/index.js +1 -1
- package/build/cjs/visualizations/store/validators/index.js +3 -4
- package/build/cjs/visualizations/util/__tests__/getFilterText.spec.js +1 -1
- package/build/cjs/visualizations/util/colors/colorSets.js +11 -20
- package/build/cjs/visualizations/util/colors/themes.js +3 -5
- package/build/es/__demo__/CalculationModal.stories.js +20 -6
- package/build/es/__demo__/DimensionsPanel.stories.js +43 -17
- package/build/es/__demo__/DynamicDimension.stories.js +18 -7
- package/build/es/__demo__/FileMenu.stories.js +15 -5
- package/build/es/__demo__/Filter.stories.js +8 -3
- package/build/es/__demo__/FixedPeriodSelect.stories.js +18 -7
- package/build/es/__demo__/InterpretationsUnit.stories.js +10 -5
- package/build/es/__demo__/OpenFileDialog.stories.js +34 -26
- package/build/es/__demo__/OrgUnitDimension.stories.js +61 -26
- package/build/es/__demo__/PeriodDimension.stories.js +44 -13
- package/build/es/__demo__/PivotTable.stories.js +249 -99
- package/build/es/__demo__/SingleValue.stories.js +10 -37
- package/build/es/__demo__/Toolbar.stories.js +8 -3
- package/build/es/api/analytics/AnalyticsResponse.js +0 -1
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +1 -1
- package/build/es/components/DataDimension/Calculation/DndContext.js +3 -3
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +1 -1
- package/build/es/components/DataDimension/Calculation/Operator.js +1 -1
- package/build/es/components/DataDimension/ItemSelector.js +1 -2
- package/build/es/components/DimensionMenu.js +3 -3
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +3 -3
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +4 -4
- package/build/es/components/DimensionsPanel/List/DimensionList.js +3 -3
- package/build/es/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +1 -1
- package/build/es/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +1 -1
- package/build/es/components/DynamicDimension/ItemSelector.js +1 -2
- package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
- package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
- package/build/es/components/Filter/__tests__/Filter.spec.js +1 -1
- package/build/es/components/Interpretations/common/Message/MessageInput.js +1 -1
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +2 -5
- package/build/es/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +57 -0
- package/build/es/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +94 -0
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +3 -3
- package/build/es/components/PeriodDimension/PeriodTransfer.js +1 -1
- package/build/es/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +1 -1
- package/build/es/components/PeriodDimension/__tests__/PeriodDimension.spec.js +1 -1
- package/build/es/components/PeriodDimension/__tests__/PeriodSelector.spec.js +1 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +0 -1
- package/build/es/components/PivotTable/PivotTableCell.js +1 -1
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +1 -1
- package/build/es/components/RichText/Editor/__tests__/Editor.spec.js +1 -1
- package/build/es/components/RichText/Parser/__tests__/Parser.spec.js +1 -1
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +1 -1
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +3 -3
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +2 -2
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -6
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +4 -4
- package/build/es/components/Toolbar/UpdateButton.js +1 -1
- package/build/es/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +5 -5
- package/build/es/components/Toolbar/__tests__/Toolbar.spec.js +2 -2
- package/build/es/components/Toolbar/__tests__/ToolbarSidebar.spec.js +3 -3
- package/build/es/components/Toolbar/__tests__/UpdateButton.spec.js +4 -4
- package/build/es/components/UserMention/UserMentionWrapper.js +0 -1
- package/build/es/locales/pt/translations.json +251 -242
- package/build/es/locales/vi/translations.json +20 -16
- package/build/es/locales/zh/translations.json +2 -0
- package/build/es/modules/__tests__/getOuLevelAndGroupText.spec.js +9 -0
- package/build/es/modules/getOuLevelAndGroupText.js +4 -1
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +3 -3
- package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
- package/build/es/modules/pivotTable/useSortableColumns.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/index.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/styles.js +2 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/scatter.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/__tests__/singleValue.spec.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/yearOverYear.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/radar.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +1 -1
- package/build/es/visualizations/config/generators/highcharts/index.js +0 -4
- package/package.json +13 -11
- package/build/cjs/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/index.js +0 -13
- package/build/cjs/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/nonASCIIFont.js +0 -17
- package/build/cjs/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/textShadow.js +0 -289
- package/build/es/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/index.js +0 -6
- package/build/es/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/nonASCIIFont.js +0 -11
- package/build/es/visualizations/config/generators/highcharts/pdfExportBugFixPlugin/textShadow.js +0 -283
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useState, useMemo, useRef, useEffect, useCallback } from 'react';
|
|
1
|
+
import React, { useState, useMemo, useRef, useEffect } from 'react';
|
|
3
2
|
import { createVisualization } from '../index.js';
|
|
4
3
|
const constainerStyleBase = {
|
|
5
4
|
width: 800,
|
|
@@ -577,13 +576,15 @@ const baseExtraOptions = {
|
|
|
577
576
|
icon
|
|
578
577
|
};
|
|
579
578
|
const indicatorTypes = ['plain', 'percent', 'subtext'];
|
|
580
|
-
|
|
579
|
+
export default {
|
|
580
|
+
title: 'SingleValue'
|
|
581
|
+
};
|
|
582
|
+
export const Default = () => {
|
|
581
583
|
const newChartRef = useRef(null);
|
|
582
584
|
const newContainerRef = useRef(null);
|
|
583
585
|
const [dashboard, setDashboard] = useState(false);
|
|
584
586
|
const [showIcon, setShowIcon] = useState(true);
|
|
585
587
|
const [indicatorType, setIndicatorType] = useState('plain');
|
|
586
|
-
const [exportAsPdf, setExportAsPdf] = useState(true);
|
|
587
588
|
const [width, setWidth] = useState(constainerStyleBase.width);
|
|
588
589
|
const [height, setHeight] = useState(constainerStyleBase.height);
|
|
589
590
|
const containerStyle = useMemo(() => ({
|
|
@@ -616,31 +617,6 @@ storiesOf('SingleValue', module).add('default', () => {
|
|
|
616
617
|
});
|
|
617
618
|
}
|
|
618
619
|
}, [containerStyle, dashboard, showIcon, indicatorType]);
|
|
619
|
-
const downloadOffline = useCallback(() => {
|
|
620
|
-
if (newChartRef.current) {
|
|
621
|
-
const currentBackgroundColor = newChartRef.current.userOptions.chart.backgroundColor;
|
|
622
|
-
newChartRef.current.update({
|
|
623
|
-
exporting: {
|
|
624
|
-
chartOptions: {
|
|
625
|
-
isPdfExport: exportAsPdf
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
newChartRef.current.exportChartLocal({
|
|
630
|
-
sourceHeight: 768,
|
|
631
|
-
sourceWidth: 1024,
|
|
632
|
-
scale: 1,
|
|
633
|
-
fallbackToExportServer: false,
|
|
634
|
-
filename: 'testOfflineDownload',
|
|
635
|
-
showExportInProgress: true,
|
|
636
|
-
type: exportAsPdf ? 'application/pdf' : 'image/png'
|
|
637
|
-
}, {
|
|
638
|
-
chart: {
|
|
639
|
-
backgroundColor: currentBackgroundColor === 'transparent' ? '#ffffff' : currentBackgroundColor
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
}, [exportAsPdf]);
|
|
644
620
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
645
621
|
style: {
|
|
646
622
|
display: 'flex',
|
|
@@ -682,13 +658,7 @@ storiesOf('SingleValue', module).add('default', () => {
|
|
|
682
658
|
return /*#__PURE__*/React.createElement("option", {
|
|
683
659
|
key: index
|
|
684
660
|
}, type);
|
|
685
|
-
}))), /*#__PURE__*/React.createElement("
|
|
686
|
-
checked: exportAsPdf,
|
|
687
|
-
onChange: () => setExportAsPdf(!exportAsPdf),
|
|
688
|
-
type: "checkbox"
|
|
689
|
-
}), "\xA0Export as PDF"), /*#__PURE__*/React.createElement("button", {
|
|
690
|
-
onClick: downloadOffline
|
|
691
|
-
}, "Download offline")), /*#__PURE__*/React.createElement("div", {
|
|
661
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
692
662
|
style: {
|
|
693
663
|
display: 'flex',
|
|
694
664
|
gap: 12
|
|
@@ -699,4 +669,7 @@ storiesOf('SingleValue', module).add('default', () => {
|
|
|
699
669
|
ref: newContainerRef,
|
|
700
670
|
style: innerContainerStyle
|
|
701
671
|
}))));
|
|
702
|
-
}
|
|
672
|
+
};
|
|
673
|
+
Default.story = {
|
|
674
|
+
name: 'default'
|
|
675
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { storiesOf } from '@storybook/react';
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
2
|
import { HoverMenuBar, HoverMenuDropdown, HoverMenuList, HoverMenuListItem, InterpretationsAndDetailsToggler, Toolbar, ToolbarSidebar, UpdateButton } from '../components/Toolbar/index.js';
|
|
4
3
|
function ToolbarWithState() {
|
|
@@ -64,6 +63,12 @@ function ToolbarWithState() {
|
|
|
64
63
|
onClick: () => setIsSidebarShowing(current => !current)
|
|
65
64
|
}));
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
export default {
|
|
67
|
+
title: 'Toolbar'
|
|
68
|
+
};
|
|
69
|
+
export const Default = () => {
|
|
68
70
|
return /*#__PURE__*/React.createElement(ToolbarWithState, null);
|
|
69
|
-
}
|
|
71
|
+
};
|
|
72
|
+
Default.story = {
|
|
73
|
+
name: 'default'
|
|
74
|
+
};
|
|
@@ -5,7 +5,6 @@ const booleanMap = {
|
|
|
5
5
|
// XXX i18n.no || 'No',
|
|
6
6
|
1: 'Yes' // i18n.yes || 'Yes',
|
|
7
7
|
};
|
|
8
|
-
|
|
9
8
|
const OUNAME = 'ouname';
|
|
10
9
|
const OU = 'ou';
|
|
11
10
|
const DEFAULT_COLLECT_IGNORE_HEADERS = ['psi', 'ps', 'eventdate', 'longitude', 'latitude', 'ouname', 'oucode', 'eventdate', 'eventdate'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { useSortable } from '@dnd-kit/sortable';
|
|
4
4
|
import { CSS } from '@dnd-kit/utilities';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _defineProperty(
|
|
2
|
-
function _toPropertyKey(
|
|
3
|
-
function _toPrimitive(
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { DndContext, DragOverlay, useSensor, useSensors, PointerSensor as DndKitPointerSensor } from '@dnd-kit/core';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import React, { useState } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { Tooltip } from '@dhis2/ui';
|
|
4
4
|
import { useSortable } from '@dnd-kit/sortable';
|
|
5
5
|
import { CSS } from '@dnd-kit/utilities';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { useSortable } from '@dnd-kit/sortable';
|
|
4
4
|
import { CSS } from '@dnd-kit/utilities';
|
|
5
5
|
import cx from 'classnames';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { useDataEngine } from '@dhis2/app-runtime';
|
|
4
4
|
import { Transfer, InputField, IconInfo16, Button, IconAdd24 } from '@dhis2/ui';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
@@ -459,7 +459,6 @@ const ItemSelector = _ref5 => {
|
|
|
459
459
|
/* eslint-enable react/prop-types */
|
|
460
460
|
}));
|
|
461
461
|
},
|
|
462
|
-
|
|
463
462
|
dataTest: `${dataTest}-transfer`
|
|
464
463
|
}), currentCalculation && state.supportsEDI && /*#__PURE__*/React.createElement(CalculationModal, {
|
|
465
464
|
calculation: currentCalculation,
|
|
@@ -53,7 +53,7 @@ const DimensionMenu = _ref => {
|
|
|
53
53
|
if (dimensionId === DIMENSION_ID_DATA && assignedCategoriesItemHandler) {
|
|
54
54
|
if (assignedCategoriesAvailableDestinations.length) {
|
|
55
55
|
if (!isAssignedCategoriesInLayout) {
|
|
56
|
-
menuItems.push(
|
|
56
|
+
menuItems.push(/*#__PURE__*/React.createElement(MenuItem, {
|
|
57
57
|
label: assignedCategoriesItemLabel,
|
|
58
58
|
key: `assigned-categories-item-${dimensionId}`,
|
|
59
59
|
dataTest: `${dataTest}-item-co-menu`
|
|
@@ -67,7 +67,7 @@ const DimensionMenu = _ref => {
|
|
|
67
67
|
dataTest: `${dataTest}-item-action-co-to-${destination}`
|
|
68
68
|
}))));
|
|
69
69
|
} else {
|
|
70
|
-
menuItems.push(
|
|
70
|
+
menuItems.push(/*#__PURE__*/React.createElement(MenuItem, {
|
|
71
71
|
key: `assigned-categories-item-${dimensionId}`,
|
|
72
72
|
onClick: () => {
|
|
73
73
|
assignedCategoriesItemHandler();
|
|
@@ -78,7 +78,7 @@ const DimensionMenu = _ref => {
|
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
80
|
} else {
|
|
81
|
-
menuItems.push(
|
|
81
|
+
menuItems.push(/*#__PURE__*/React.createElement(Tooltip, {
|
|
82
82
|
key: `assigned-categories-item-${dimensionId}`,
|
|
83
83
|
content: getUnavailableLabel(visType),
|
|
84
84
|
"aria-label": "disabled",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _defineProperty(
|
|
2
|
-
function _toPropertyKey(
|
|
3
|
-
function _toPrimitive(
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
6
|
import i18n from '../../locales/index.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _defineProperty(
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { CssVariables } from '@dhis2/ui';
|
|
7
7
|
import cx from 'classnames';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _defineProperty(
|
|
3
|
-
function _toPropertyKey(
|
|
4
|
-
function _toPrimitive(
|
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
7
|
import i18n from '../../../locales/index.js';
|
|
@@ -6,7 +6,7 @@ describe('DimensionItem', () => {
|
|
|
6
6
|
let shallowItem;
|
|
7
7
|
const dimensionItem = () => {
|
|
8
8
|
if (!shallowItem) {
|
|
9
|
-
shallowItem = shallow(
|
|
9
|
+
shallowItem = shallow(/*#__PURE__*/React.createElement(DimensionItem, props));
|
|
10
10
|
}
|
|
11
11
|
return shallowItem;
|
|
12
12
|
};
|
|
@@ -7,7 +7,7 @@ describe('The Dimensions component ', () => {
|
|
|
7
7
|
let props;
|
|
8
8
|
const dimensionsComponent = () => {
|
|
9
9
|
if (!shallowDimensions) {
|
|
10
|
-
shallowDimensions = shallow(
|
|
10
|
+
shallowDimensions = shallow(/*#__PURE__*/React.createElement(DimensionsPanel, props));
|
|
11
11
|
}
|
|
12
12
|
return shallowDimensions;
|
|
13
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { Transfer, InputField } from '@dhis2/ui';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
@@ -91,7 +91,6 @@ const ItemSelector = _ref4 => {
|
|
|
91
91
|
nextPage: null // FIXME: Selecting all 50 items from a page prevents the loading of more items.
|
|
92
92
|
// Implement the solution found in the DataDimension/ItemSelector.js
|
|
93
93
|
});
|
|
94
|
-
|
|
95
94
|
const setFilter = filter => setState(state => ({
|
|
96
95
|
...state,
|
|
97
96
|
filter
|
|
@@ -8,7 +8,7 @@ describe('The FileMenu - DeleteDialog component', () => {
|
|
|
8
8
|
const onClose = jest.fn();
|
|
9
9
|
const getDeleteDialogComponent = props => {
|
|
10
10
|
if (!shallowDeleteDialog) {
|
|
11
|
-
shallowDeleteDialog = shallow(
|
|
11
|
+
shallowDeleteDialog = shallow(/*#__PURE__*/React.createElement(DeleteDialog, props));
|
|
12
12
|
}
|
|
13
13
|
return shallowDeleteDialog;
|
|
14
14
|
};
|
|
@@ -71,7 +71,7 @@ describe('The FileMenu component ', () => {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
return render(
|
|
74
|
+
return render(/*#__PURE__*/React.createElement(CustomDataProvider, {
|
|
75
75
|
data: providerData
|
|
76
76
|
}, /*#__PURE__*/React.createElement(HoverMenuBar, null, /*#__PURE__*/React.createElement(FileMenu, props))));
|
|
77
77
|
};
|
|
@@ -15,7 +15,7 @@ describe('The FileMenu - GetLinkDialog component', () => {
|
|
|
15
15
|
const onClose = jest.fn();
|
|
16
16
|
const getGetLinkDialogComponent = props => {
|
|
17
17
|
if (!shallowGetLinkDialog) {
|
|
18
|
-
shallowGetLinkDialog = shallow(
|
|
18
|
+
shallowGetLinkDialog = shallow(/*#__PURE__*/React.createElement(GetLinkDialog, props));
|
|
19
19
|
}
|
|
20
20
|
return shallowGetLinkDialog;
|
|
21
21
|
};
|
|
@@ -8,7 +8,7 @@ describe('The FileMenu - RenameDialog component', () => {
|
|
|
8
8
|
const onClose = jest.fn();
|
|
9
9
|
const getRenameDialogComponent = props => {
|
|
10
10
|
if (!shallowRenameDialog) {
|
|
11
|
-
shallowRenameDialog = shallow(
|
|
11
|
+
shallowRenameDialog = shallow(/*#__PURE__*/React.createElement(RenameDialog, props));
|
|
12
12
|
}
|
|
13
13
|
return shallowRenameDialog;
|
|
14
14
|
};
|
|
@@ -9,7 +9,7 @@ describe('The FileMenu - SaveAsDialog component', () => {
|
|
|
9
9
|
const onSaveAs = jest.fn();
|
|
10
10
|
const getSaveAsDialogComponent = props => {
|
|
11
11
|
if (!shallowSaveAsDialog) {
|
|
12
|
-
shallowSaveAsDialog = shallow(
|
|
12
|
+
shallowSaveAsDialog = shallow(/*#__PURE__*/React.createElement(SaveAsDialog, props));
|
|
13
13
|
}
|
|
14
14
|
return shallowSaveAsDialog;
|
|
15
15
|
};
|
|
@@ -7,7 +7,7 @@ describe('The Filter component ', () => {
|
|
|
7
7
|
let props;
|
|
8
8
|
const filterComp = () => {
|
|
9
9
|
if (!shallowFilter) {
|
|
10
|
-
shallowFilter = shallow(
|
|
10
|
+
shallowFilter = shallow(/*#__PURE__*/React.createElement(Filter, props));
|
|
11
11
|
}
|
|
12
12
|
return shallowFilter;
|
|
13
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { theme, colors } from '@dhis2/ui';
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
const MessageInput = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({
|
|
@@ -34,7 +34,7 @@ const OrgUnitDimension = _ref => {
|
|
|
34
34
|
} = selectedItem;
|
|
35
35
|
let result = [...selected];
|
|
36
36
|
if (checked && DYNAMIC_ORG_UNITS.includes(id)) {
|
|
37
|
-
result = [...result
|
|
37
|
+
result = [...result, {
|
|
38
38
|
id,
|
|
39
39
|
displayName
|
|
40
40
|
}];
|
|
@@ -178,9 +178,7 @@ const OrgUnitDimension = _ref => {
|
|
|
178
178
|
},
|
|
179
179
|
dense: true
|
|
180
180
|
})), /*#__PURE__*/React.createElement("div", {
|
|
181
|
-
className: `jsx-${styles.__hash}` + " " +
|
|
182
|
-
disabled: selected.some(item => DYNAMIC_ORG_UNITS.includes(item.id))
|
|
183
|
-
}) || "")
|
|
181
|
+
className: `jsx-${styles.__hash}` + " " + "orgUnitTreeWrapper"
|
|
184
182
|
}, /*#__PURE__*/React.createElement(OrganisationUnitTree, {
|
|
185
183
|
roots: roots,
|
|
186
184
|
initiallyExpanded: [...(roots.length === 1 ? [`/${roots[0]}`] : []), ...selected.filter(item => !DYNAMIC_ORG_UNITS.includes(item.id) && !ouIdHelper.hasLevelPrefix(item.id) && !ouIdHelper.hasGroupPrefix(item.id)).map(item => item.path.substring(0, item.path.lastIndexOf('/'))).filter(path => path)],
|
|
@@ -189,7 +187,6 @@ const OrgUnitDimension = _ref => {
|
|
|
189
187
|
dataTest: 'org-unit-tree'
|
|
190
188
|
})), /*#__PURE__*/React.createElement("div", {
|
|
191
189
|
className: `jsx-${styles.__hash}` + " " + (cx('selectsWrapper', {
|
|
192
|
-
disabled: selected.some(item => DYNAMIC_ORG_UNITS.includes(item.id)),
|
|
193
190
|
hidden: hideLevelSelect && hideGroupSelect
|
|
194
191
|
}) || "")
|
|
195
192
|
}, !hideLevelSelect && /*#__PURE__*/React.createElement(MultiSelect, {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import OrgUnitDimension from '../OrgUnitDimension.js';
|
|
4
|
+
describe('The OrgUnitDimension component', () => {
|
|
5
|
+
let props;
|
|
6
|
+
let shallowOrgUnitDimension;
|
|
7
|
+
const getWrapper = () => {
|
|
8
|
+
if (!shallowOrgUnitDimension) {
|
|
9
|
+
shallowOrgUnitDimension = shallow(/*#__PURE__*/React.createElement(OrgUnitDimension, props));
|
|
10
|
+
}
|
|
11
|
+
return shallowOrgUnitDimension;
|
|
12
|
+
};
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
props = {
|
|
15
|
+
roots: [],
|
|
16
|
+
selected: [],
|
|
17
|
+
onSelect: jest.fn(),
|
|
18
|
+
hideGroupSelect: false,
|
|
19
|
+
hideLevelSelect: false,
|
|
20
|
+
hideUserOrgUnits: false,
|
|
21
|
+
warning: ''
|
|
22
|
+
};
|
|
23
|
+
shallowOrgUnitDimension = undefined;
|
|
24
|
+
});
|
|
25
|
+
it('matches the snapshot', () => {
|
|
26
|
+
const wrapper = getWrapper();
|
|
27
|
+
expect(wrapper).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
it('calls onSelect when an organisation unit is selected', () => {
|
|
30
|
+
const wrapper = getWrapper();
|
|
31
|
+
const orgUnitTree = wrapper.find('OrganisationUnitTree');
|
|
32
|
+
const testOrgUnit = {
|
|
33
|
+
id: 'testId',
|
|
34
|
+
path: '/testPath',
|
|
35
|
+
displayName: 'Test Org Unit',
|
|
36
|
+
checked: true
|
|
37
|
+
};
|
|
38
|
+
orgUnitTree.props().onChange(testOrgUnit);
|
|
39
|
+
expect(props.onSelect).toHaveBeenCalledWith({
|
|
40
|
+
dimensionId: 'ou',
|
|
41
|
+
items: [{
|
|
42
|
+
id: 'testId',
|
|
43
|
+
path: '/testPath',
|
|
44
|
+
name: 'Test Org Unit'
|
|
45
|
+
}]
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
it('calls onSelect with an empty array when selection is cleared', () => {
|
|
49
|
+
const wrapper = getWrapper();
|
|
50
|
+
const deselectButton = wrapper.find('Button[onClick]');
|
|
51
|
+
deselectButton.simulate('click');
|
|
52
|
+
expect(props.onSelect).toHaveBeenCalledWith({
|
|
53
|
+
dimensionId: 'ou',
|
|
54
|
+
items: []
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
package/build/es/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`The OrgUnitDimension component matches the snapshot 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="container"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="userOrgUnitsWrapper"
|
|
9
|
+
>
|
|
10
|
+
<Checkbox
|
|
11
|
+
checked={false}
|
|
12
|
+
dataTest="dhis2-uicore-checkbox"
|
|
13
|
+
dense={true}
|
|
14
|
+
indeterminate={false}
|
|
15
|
+
label="User organisation unit"
|
|
16
|
+
onChange={[Function]}
|
|
17
|
+
/>
|
|
18
|
+
<Checkbox
|
|
19
|
+
checked={false}
|
|
20
|
+
dataTest="dhis2-uicore-checkbox"
|
|
21
|
+
dense={true}
|
|
22
|
+
indeterminate={false}
|
|
23
|
+
label="User sub-units"
|
|
24
|
+
onChange={[Function]}
|
|
25
|
+
/>
|
|
26
|
+
<Checkbox
|
|
27
|
+
checked={false}
|
|
28
|
+
dataTest="dhis2-uicore-checkbox"
|
|
29
|
+
dense={true}
|
|
30
|
+
indeterminate={false}
|
|
31
|
+
label="User sub-x2-units"
|
|
32
|
+
onChange={[Function]}
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
className="orgUnitTreeWrapper"
|
|
37
|
+
>
|
|
38
|
+
<OrganisationUnitTree
|
|
39
|
+
dataTest="org-unit-tree"
|
|
40
|
+
filter={Array []}
|
|
41
|
+
highlighted={Array []}
|
|
42
|
+
initiallyExpanded={Array []}
|
|
43
|
+
onChange={[Function]}
|
|
44
|
+
renderNodeLabel={[Function]}
|
|
45
|
+
roots={Array []}
|
|
46
|
+
selected={Array []}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
className="selectsWrapper"
|
|
51
|
+
>
|
|
52
|
+
<MultiSelect
|
|
53
|
+
dataTest="org-unit-level-select"
|
|
54
|
+
dense={true}
|
|
55
|
+
loading={true}
|
|
56
|
+
onChange={[Function]}
|
|
57
|
+
placeholder="Select a level"
|
|
58
|
+
selected={Array []}
|
|
59
|
+
/>
|
|
60
|
+
<MultiSelect
|
|
61
|
+
dataTest="org-unit-group-select"
|
|
62
|
+
dense={true}
|
|
63
|
+
loading={true}
|
|
64
|
+
onChange={[Function]}
|
|
65
|
+
placeholder="Select a group"
|
|
66
|
+
selected={Array []}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
<div
|
|
70
|
+
className="summaryWrapper"
|
|
71
|
+
>
|
|
72
|
+
<span
|
|
73
|
+
className="summaryText"
|
|
74
|
+
>
|
|
75
|
+
Nothing selected
|
|
76
|
+
</span>
|
|
77
|
+
<div
|
|
78
|
+
className="deselectButton"
|
|
79
|
+
>
|
|
80
|
+
<Button
|
|
81
|
+
dataTest="dhis2-uicore-button"
|
|
82
|
+
disabled={true}
|
|
83
|
+
onClick={[Function]}
|
|
84
|
+
secondary={true}
|
|
85
|
+
small={true}
|
|
86
|
+
type="button"
|
|
87
|
+
>
|
|
88
|
+
Deselect all
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<style />
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _defineProperty(
|
|
3
|
-
function _toPropertyKey(
|
|
4
|
-
function _toPrimitive(
|
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { Component } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { getNowInCalendar } from '@dhis2/multi-calendar-dates';
|
|
4
4
|
import { IconInfo16, TabBar, Tab, Transfer } from '@dhis2/ui';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
@@ -6,7 +6,7 @@ describe('The Fixed Period Single Select component', () => {
|
|
|
6
6
|
let shallowFixedPeriodSelect;
|
|
7
7
|
const getWrapper = () => {
|
|
8
8
|
if (!shallowFixedPeriodSelect) {
|
|
9
|
-
shallowFixedPeriodSelect = shallow(
|
|
9
|
+
shallowFixedPeriodSelect = shallow(/*#__PURE__*/React.createElement(FixedPeriodSelect, props));
|
|
10
10
|
}
|
|
11
11
|
return shallowFixedPeriodSelect;
|
|
12
12
|
};
|
|
@@ -19,7 +19,7 @@ describe('The Period Dimension component', () => {
|
|
|
19
19
|
let shallowPeriodDimension;
|
|
20
20
|
const getWrapper = () => {
|
|
21
21
|
if (!shallowPeriodDimension) {
|
|
22
|
-
shallowPeriodDimension = shallow(
|
|
22
|
+
shallowPeriodDimension = shallow(/*#__PURE__*/React.createElement(PeriodDimension, props));
|
|
23
23
|
}
|
|
24
24
|
return shallowPeriodDimension;
|
|
25
25
|
};
|
|
@@ -6,7 +6,7 @@ describe('The Period Selector component', () => {
|
|
|
6
6
|
let shallowPeriodTransfer;
|
|
7
7
|
const getWrapper = () => {
|
|
8
8
|
if (!shallowPeriodTransfer) {
|
|
9
|
-
shallowPeriodTransfer = shallow(
|
|
9
|
+
shallowPeriodTransfer = shallow(/*#__PURE__*/React.createElement(PeriodTransfer, props));
|
|
10
10
|
}
|
|
11
11
|
return shallowPeriodTransfer;
|
|
12
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { PivotTableCell } from './PivotTableCell.js';
|
|
5
5
|
import { cell as cellStyle } from './styles/PivotTable.style.js';
|
|
@@ -18,7 +18,7 @@ describe('RichText: Editor component', () => {
|
|
|
18
18
|
mockConvertCtrlKey.mockClear();
|
|
19
19
|
});
|
|
20
20
|
const renderComponent = props => {
|
|
21
|
-
return render(
|
|
21
|
+
return render(/*#__PURE__*/React.createElement(Editor, props));
|
|
22
22
|
};
|
|
23
23
|
it('renders a result', () => {
|
|
24
24
|
renderComponent(componentProps);
|