@dhis2/analytics 28.0.3 → 28.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/__demo__/DataDimension.stories.js +1 -2
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +19 -1
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -2
- package/build/cjs/__demo__/PivotTable.stories.js +166 -224
- package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
- package/build/cjs/__demo__/SingleValue.stories.js +1 -2
- package/build/cjs/__demo__/Toolbar.stories.js +1 -2
- package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
- package/build/cjs/api/analytics/Analytics.js +8 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/cjs/api/analytics/utils.js +11 -17
- package/build/cjs/api/dimensions.js +119 -148
- package/build/cjs/api/expression.js +39 -60
- package/build/cjs/api/organisationUnits.js +23 -35
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
- package/build/cjs/components/CachedDataQueryProvider.js +7 -9
- package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/cjs/components/DataDimension/DataDimension.js +20 -32
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
- package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
- package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/cjs/components/DataDimension/TransferOption.js +35 -39
- package/build/cjs/components/DimensionMenu.js +13 -14
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +12 -11
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/cjs/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +48 -41
- package/build/cjs/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +110 -114
- package/build/cjs/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +36 -33
- 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__/DeleteDialog.spec.js +24 -27
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +55 -31
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +35 -39
- package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +17 -11
- package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +44 -37
- package/build/cjs/components/FileMenu/utils.js +10 -12
- package/build/cjs/components/Filter/Filter.js +21 -27
- package/build/cjs/components/Filter/__tests__/Filter.spec.js +29 -34
- 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 +28 -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 +50 -79
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +65 -36
- package/build/cjs/components/OpenFileDialog/__tests__/OpenFileDialog.spec.js +51 -0
- package/build/cjs/components/Options/VisualizationOptions.js +35 -46
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
- package/build/cjs/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +78 -44
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +17 -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 +25 -30
- package/build/cjs/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +14 -21
- package/build/cjs/components/PeriodDimension/__tests__/PeriodDimension.spec.js +27 -23
- 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/Editor/__tests__/Editor.spec.js +6 -7
- package/build/cjs/components/RichText/Parser/Parser.js +5 -10
- package/build/cjs/components/RichText/Parser/__tests__/MdParser.spec.js +1 -1
- package/build/cjs/components/RichText/Parser/__tests__/Parser.spec.js +22 -23
- 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 +56 -47
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -8
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +30 -23
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +23 -17
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/__snapshots__/HoverMenuList.spec.js.snap +63 -0
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +17 -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/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +19 -18
- package/build/cjs/components/Toolbar/__tests__/Toolbar.spec.js +8 -8
- package/build/cjs/components/Toolbar/__tests__/ToolbarSidebar.spec.js +14 -11
- package/build/cjs/components/Toolbar/__tests__/UpdateButton.spec.js +16 -14
- 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 +9 -10
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +25 -16
- 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__/OpenFileDialog.stories.js +17 -0
- 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 +11 -9
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/es/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +47 -40
- package/build/es/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +110 -114
- package/build/es/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +35 -32
- 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__/DeleteDialog.spec.js +23 -26
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +56 -32
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +34 -38
- package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +18 -12
- package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +43 -36
- package/build/es/components/FileMenu/utils.js +10 -12
- package/build/es/components/Filter/Filter.js +21 -27
- package/build/es/components/Filter/__tests__/Filter.spec.js +28 -33
- 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 +26 -25
- 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 +49 -78
- package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +64 -36
- package/build/es/components/OpenFileDialog/__tests__/OpenFileDialog.spec.js +49 -0
- package/build/es/components/Options/VisualizationOptions.js +34 -44
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
- package/build/es/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +77 -43
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +17 -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 +25 -30
- package/build/es/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +13 -20
- package/build/es/components/PeriodDimension/__tests__/PeriodDimension.spec.js +26 -22
- 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/Editor/__tests__/Editor.spec.js +7 -8
- package/build/es/components/RichText/Parser/Parser.js +4 -8
- package/build/es/components/RichText/Parser/__tests__/MdParser.spec.js +1 -1
- package/build/es/components/RichText/Parser/__tests__/Parser.spec.js +21 -22
- 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 +57 -48
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +7 -7
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +27 -20
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +21 -15
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/__snapshots__/HoverMenuList.spec.js.snap +63 -0
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +17 -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/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +18 -17
- package/build/es/components/Toolbar/__tests__/Toolbar.spec.js +7 -7
- package/build/es/components/Toolbar/__tests__/ToolbarSidebar.spec.js +13 -10
- package/build/es/components/Toolbar/__tests__/UpdateButton.spec.js +15 -13
- 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 +8 -8
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +24 -15
- 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 +13 -15
- package/build/cjs/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +0 -89
- package/build/cjs/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -29
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -93
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -17
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodSelector.spec.js.snap +0 -89
- package/build/es/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +0 -89
- package/build/es/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -26
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -93
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -17
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodSelector.spec.js.snap +0 -89
|
@@ -5,24 +5,22 @@ import { Box, Modal, ModalTitle, ModalContent, DataTable, DataTableHead, DataTab
|
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { useCallback, useEffect, useMemo, useReducer, useState } from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import { CreatedByFilter, CREATED_BY_ALL, CREATED_BY_ALL_BUT_CURRENT_USER, CREATED_BY_CURRENT_USER } from './CreatedByFilter.js';
|
|
8
|
+
import { CreatedByFilter, formatUserFilter, CREATED_BY_ALL } from './CreatedByFilter.js';
|
|
10
9
|
import { FileList } from './FileList.js';
|
|
11
10
|
import { NameFilter } from './NameFilter.js';
|
|
12
11
|
import { styles } from './OpenFileDialog.styles.js';
|
|
13
12
|
import { PaginationControls } from './PaginationControls.js';
|
|
14
13
|
import { getTranslatedString, AOTypeMap } from './utils.js';
|
|
15
|
-
import { VisTypeFilter } from './VisTypeFilter.js';
|
|
14
|
+
import { VisTypeFilter, formatTypeFilter } from './VisTypeFilter.js';
|
|
16
15
|
const getQuery = type => ({
|
|
17
16
|
files: {
|
|
18
17
|
resource: AOTypeMap[type].apiEndpoint,
|
|
19
|
-
params:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
18
|
+
params: ({
|
|
19
|
+
sortField = 'displayName',
|
|
20
|
+
sortDirection = 'iasc',
|
|
21
|
+
page = 1,
|
|
22
|
+
filters
|
|
23
|
+
}) => {
|
|
26
24
|
const queryParams = {
|
|
27
25
|
filter: filters,
|
|
28
26
|
fields: `id,type,displayName,title,displayDescription,created,lastUpdated,user,access,href`,
|
|
@@ -37,17 +35,25 @@ const getQuery = type => ({
|
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
});
|
|
40
|
-
export const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
export const formatFilters = (currentUser, filters, filterVisTypes) => {
|
|
39
|
+
const queryFilters = [];
|
|
40
|
+
filters.searchTerm && queryFilters.push(`identifiable:token:${filters.searchTerm}`);
|
|
41
|
+
const userFilter = formatUserFilter(filters.createdBy, currentUser.id);
|
|
42
|
+
userFilter && queryFilters.push(userFilter);
|
|
43
|
+
const typeFilter = formatTypeFilter(filterVisTypes, filters.visType);
|
|
44
|
+
typeFilter && queryFilters.push(typeFilter);
|
|
45
|
+
return queryFilters;
|
|
46
|
+
};
|
|
47
|
+
export const OpenFileDialog = ({
|
|
48
|
+
type,
|
|
49
|
+
open,
|
|
50
|
+
filterVisTypes,
|
|
51
|
+
defaultFilterVisType,
|
|
52
|
+
onClose,
|
|
53
|
+
onFileSelect,
|
|
54
|
+
onNew,
|
|
55
|
+
currentUser
|
|
56
|
+
}) => {
|
|
51
57
|
const filesQuery = useMemo(() => getQuery(type), [type]);
|
|
52
58
|
const defaultFilters = {
|
|
53
59
|
searchTerm: '',
|
|
@@ -70,36 +76,7 @@ export const OpenFileDialog = _ref2 => {
|
|
|
70
76
|
});
|
|
71
77
|
const [nameFilterValue, setNameFilterValue] = useState(defaultFilters.searchTerm);
|
|
72
78
|
const [searchTimeout, setSearchTimeout] = useState(null);
|
|
73
|
-
const
|
|
74
|
-
const queryFilters = [];
|
|
75
|
-
switch (filters.createdBy) {
|
|
76
|
-
case CREATED_BY_ALL_BUT_CURRENT_USER:
|
|
77
|
-
queryFilters.push(`user.id:!eq:${currentUser.id}`);
|
|
78
|
-
break;
|
|
79
|
-
case CREATED_BY_CURRENT_USER:
|
|
80
|
-
queryFilters.push(`user.id:eq:${currentUser.id}`);
|
|
81
|
-
break;
|
|
82
|
-
case CREATED_BY_ALL:
|
|
83
|
-
default:
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
if (filters.visType) {
|
|
87
|
-
switch (filters.visType) {
|
|
88
|
-
case VIS_TYPE_GROUP_ALL:
|
|
89
|
-
break;
|
|
90
|
-
case VIS_TYPE_GROUP_CHARTS:
|
|
91
|
-
queryFilters.push('type:!eq:PIVOT_TABLE');
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
queryFilters.push(`type:eq:${filters.visType}`);
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (filters.searchTerm) {
|
|
99
|
-
queryFilters.push(`identifiable:token:${filters.searchTerm}`);
|
|
100
|
-
}
|
|
101
|
-
return queryFilters;
|
|
102
|
-
}, [currentUser, filters]);
|
|
79
|
+
const formatFiltersCb = useCallback(() => formatFilters(currentUser, filters, filterVisTypes), [currentUser, filters, filterVisTypes]);
|
|
103
80
|
const formatSortDirection = useCallback(() => {
|
|
104
81
|
if (sortField === 'displayName' && sortDirection !== 'default') {
|
|
105
82
|
return `i${sortDirection}`;
|
|
@@ -129,17 +106,14 @@ export const OpenFileDialog = _ref2 => {
|
|
|
129
106
|
const setPage = pageNum => setState({
|
|
130
107
|
page: pageNum
|
|
131
108
|
});
|
|
132
|
-
const sortData =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
page: 1
|
|
141
|
-
});
|
|
142
|
-
};
|
|
109
|
+
const sortData = ({
|
|
110
|
+
name,
|
|
111
|
+
direction
|
|
112
|
+
}) => setState({
|
|
113
|
+
sortField: name,
|
|
114
|
+
sortDirection: direction,
|
|
115
|
+
page: 1
|
|
116
|
+
});
|
|
143
117
|
useEffect(() => {
|
|
144
118
|
// only fetch data when the dialog is open
|
|
145
119
|
if (open) {
|
|
@@ -147,10 +121,10 @@ export const OpenFileDialog = _ref2 => {
|
|
|
147
121
|
page,
|
|
148
122
|
sortField,
|
|
149
123
|
sortDirection: formatSortDirection(),
|
|
150
|
-
filters:
|
|
124
|
+
filters: formatFiltersCb()
|
|
151
125
|
});
|
|
152
126
|
}
|
|
153
|
-
}, [open, page, sortField, filters, refetch,
|
|
127
|
+
}, [open, page, sortField, filters, refetch, formatFiltersCb, formatSortDirection]);
|
|
154
128
|
const headers = [{
|
|
155
129
|
field: 'displayName',
|
|
156
130
|
label: i18n.t('Name'),
|
|
@@ -233,20 +207,17 @@ export const OpenFileDialog = _ref2 => {
|
|
|
233
207
|
className: `jsx-${styles.__hash}` + " " + "data-table-wrapper"
|
|
234
208
|
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
235
209
|
layout: "fixed"
|
|
236
|
-
}, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, data !== null && data !== void 0 && data.files[AOTypeMap[type].apiEndpoint].length ? headers.map(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
sortDirection: getSortDirection(field)
|
|
248
|
-
}, label);
|
|
249
|
-
}) : /*#__PURE__*/React.createElement(DataTableColumnHeader, null))), /*#__PURE__*/React.createElement(DataTableBody, {
|
|
210
|
+
}, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, data !== null && data !== void 0 && data.files[AOTypeMap[type].apiEndpoint].length ? headers.map(({
|
|
211
|
+
field,
|
|
212
|
+
label,
|
|
213
|
+
width
|
|
214
|
+
}) => /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
215
|
+
width: width,
|
|
216
|
+
key: field,
|
|
217
|
+
name: field,
|
|
218
|
+
onSortIconClick: sortData,
|
|
219
|
+
sortDirection: getSortDirection(field)
|
|
220
|
+
}, label)) : /*#__PURE__*/React.createElement(DataTableColumnHeader, null))), /*#__PURE__*/React.createElement(DataTableBody, {
|
|
250
221
|
className: "data-table-body"
|
|
251
222
|
}, loading && /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, {
|
|
252
223
|
large: true
|
|
@@ -2,34 +2,28 @@ import i18n from '@dhis2/d2-i18n';
|
|
|
2
2
|
import { Pagination } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export const PaginationControls =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lastItemIndex,
|
|
28
|
-
totalNumberOfItems
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
5
|
+
export const PaginationControls = ({
|
|
6
|
+
page,
|
|
7
|
+
pager,
|
|
8
|
+
onPageChange
|
|
9
|
+
}) => /*#__PURE__*/React.createElement(Pagination, {
|
|
10
|
+
page: page,
|
|
11
|
+
pageCount: pager.pageCount,
|
|
12
|
+
pageSize: pager.pageSize,
|
|
13
|
+
total: pager.total,
|
|
14
|
+
onPageChange: onPageChange,
|
|
15
|
+
onPageSizeChange: Function.prototype,
|
|
16
|
+
hidePageSizeSelect: true,
|
|
17
|
+
pageSummaryText: ({
|
|
18
|
+
firstItem: firstItemIndex,
|
|
19
|
+
lastItem: lastItemIndex,
|
|
20
|
+
total: totalNumberOfItems
|
|
21
|
+
}) => i18n.t('{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}', {
|
|
22
|
+
firstItemIndex,
|
|
23
|
+
lastItemIndex,
|
|
24
|
+
totalNumberOfItems
|
|
25
|
+
})
|
|
26
|
+
});
|
|
33
27
|
PaginationControls.propTypes = {
|
|
34
28
|
page: PropTypes.number,
|
|
35
29
|
pager: PropTypes.object,
|
|
@@ -2,46 +2,74 @@ import i18n from '@dhis2/d2-i18n';
|
|
|
2
2
|
import { SingleSelect, colors } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { getDisplayNameByVisType, visTypeIcons } from '../../modules/visTypes.js';
|
|
5
|
+
import { getDisplayNameByVisType, visTypeIcons, VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS, VIS_TYPE_PIVOT_TABLE } from '../../modules/visTypes.js';
|
|
6
6
|
import { VisTypeIcon } from '../VisTypeIcon.js';
|
|
7
7
|
import { CustomSelectOption } from './CustomSelectOption.js';
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
14
|
-
return /*#__PURE__*/React.createElement(SingleSelect, {
|
|
15
|
-
selected: selected,
|
|
16
|
-
onChange: _ref2 => {
|
|
17
|
-
let {
|
|
18
|
-
selected
|
|
19
|
-
} = _ref2;
|
|
20
|
-
return onChange(selected);
|
|
21
|
-
},
|
|
22
|
-
prefix: i18n.t('Type'),
|
|
23
|
-
dense: true,
|
|
24
|
-
maxHeight: "400px"
|
|
25
|
-
}, visTypes === null || visTypes === void 0 ? void 0 : visTypes.map(_ref3 => {
|
|
26
|
-
let {
|
|
8
|
+
export const formatTypeFilter = (filterVisTypes, visType) => {
|
|
9
|
+
const defaultFilterTypes = [];
|
|
10
|
+
let defaultTypeFilter;
|
|
11
|
+
if (Array.isArray(filterVisTypes)) {
|
|
12
|
+
defaultFilterTypes.push(...filterVisTypes.filter(({
|
|
27
13
|
type,
|
|
28
|
-
disabled
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
disabled
|
|
15
|
+
}) => !(disabled || [VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS].includes(type))).map(({
|
|
16
|
+
type
|
|
17
|
+
}) => type));
|
|
18
|
+
if (defaultFilterTypes.length) {
|
|
19
|
+
defaultTypeFilter = `type:in:[${defaultFilterTypes.join(',')}]`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
switch (visType) {
|
|
23
|
+
case VIS_TYPE_GROUP_ALL:
|
|
24
|
+
{
|
|
25
|
+
return defaultTypeFilter;
|
|
26
|
+
}
|
|
27
|
+
case VIS_TYPE_GROUP_CHARTS:
|
|
28
|
+
{
|
|
29
|
+
if (defaultFilterTypes.length) {
|
|
30
|
+
return `type:in:[${defaultFilterTypes.filter(item => item !== VIS_TYPE_PIVOT_TABLE).join(',')}]`;
|
|
31
|
+
} else {
|
|
32
|
+
return `type:!eq:${VIS_TYPE_PIVOT_TABLE}`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
default:
|
|
36
|
+
{
|
|
37
|
+
if (visType) {
|
|
38
|
+
return `type:eq:${visType}`;
|
|
39
|
+
} else if (defaultTypeFilter) {
|
|
40
|
+
return defaultTypeFilter;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
44
|
};
|
|
45
|
+
export const VisTypeFilter = ({
|
|
46
|
+
visTypes,
|
|
47
|
+
selected,
|
|
48
|
+
onChange
|
|
49
|
+
}) => /*#__PURE__*/React.createElement(SingleSelect, {
|
|
50
|
+
selected: selected,
|
|
51
|
+
onChange: ({
|
|
52
|
+
selected
|
|
53
|
+
}) => onChange(selected),
|
|
54
|
+
prefix: i18n.t('Type'),
|
|
55
|
+
dense: true,
|
|
56
|
+
maxHeight: "400px"
|
|
57
|
+
}, visTypes === null || visTypes === void 0 ? void 0 : visTypes.map(({
|
|
58
|
+
type,
|
|
59
|
+
disabled,
|
|
60
|
+
insertDivider
|
|
61
|
+
}) => /*#__PURE__*/React.createElement(CustomSelectOption, {
|
|
62
|
+
key: type,
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
label: getDisplayNameByVisType(type),
|
|
65
|
+
insertDivider: insertDivider,
|
|
66
|
+
value: type,
|
|
67
|
+
icon: visTypeIcons[type] ? /*#__PURE__*/React.createElement(VisTypeIcon, {
|
|
68
|
+
type: type,
|
|
69
|
+
useSmall: true,
|
|
70
|
+
color: colors.grey600
|
|
71
|
+
}) : undefined
|
|
72
|
+
})));
|
|
45
73
|
VisTypeFilter.propTypes = {
|
|
46
74
|
selected: PropTypes.string,
|
|
47
75
|
visTypes: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { VIS_TYPE_COLUMN, VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS, VIS_TYPE_LINE_LIST, VIS_TYPE_PIVOT_TABLE } from '../../../modules/visTypes.js';
|
|
2
|
+
import { CREATED_BY_ALL, CREATED_BY_ALL_BUT_CURRENT_USER, CREATED_BY_CURRENT_USER } from '../CreatedByFilter.js';
|
|
3
|
+
import { formatFilters } from '../OpenFileDialog.js';
|
|
4
|
+
describe('OpenFileDialog - formatFilters', () => {
|
|
5
|
+
const currentUser = {
|
|
6
|
+
id: 'test-user'
|
|
7
|
+
};
|
|
8
|
+
const createdByTestCases = [[CREATED_BY_ALL, []], [CREATED_BY_CURRENT_USER, [`user.id:eq:${currentUser.id}`]], [CREATED_BY_ALL_BUT_CURRENT_USER, [`user.id:!eq:${currentUser.id}`]]];
|
|
9
|
+
test.each(createdByTestCases)('formats the createdBy filter given %p', (createdBy, expected) => expect(formatFilters(currentUser, {
|
|
10
|
+
createdBy
|
|
11
|
+
})).toEqual(expected));
|
|
12
|
+
test('formats the searchTerm filter', () => {
|
|
13
|
+
const testSearchTerm = 'test search term';
|
|
14
|
+
expect(formatFilters(currentUser, {
|
|
15
|
+
searchTerm: testSearchTerm
|
|
16
|
+
})).toEqual([`identifiable:token:${testSearchTerm}`]);
|
|
17
|
+
});
|
|
18
|
+
const typeTestCases = [
|
|
19
|
+
// no type filter when no visType nor filterVisTypes
|
|
20
|
+
[undefined, undefined, []],
|
|
21
|
+
// no type filter because VIS_TYPE_GROUP_ALL is selected
|
|
22
|
+
[undefined, VIS_TYPE_GROUP_ALL, []],
|
|
23
|
+
// only VIS_TYPE_PIVOT_TABLE ignored because no filterVisTypes is passed and VIS_TYPE_GROUP_CHARTS is selected
|
|
24
|
+
[undefined, VIS_TYPE_GROUP_CHARTS, [`type:!eq:${VIS_TYPE_PIVOT_TABLE}`]],
|
|
25
|
+
// no filterVisTypes and VIS_TYPE_PIVOT_TABLE selected
|
|
26
|
+
[undefined, VIS_TYPE_PIVOT_TABLE, [`type:eq:${VIS_TYPE_PIVOT_TABLE}`]],
|
|
27
|
+
// group types are ignored
|
|
28
|
+
[[VIS_TYPE_PIVOT_TABLE, VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS], VIS_TYPE_GROUP_ALL, [`type:in:[${VIS_TYPE_PIVOT_TABLE}]`]],
|
|
29
|
+
// VIS_TYPE_PIVOT_TABLE is ignored because VIS_TYPE_GROUP_CHARTS is selected
|
|
30
|
+
[[VIS_TYPE_PIVOT_TABLE, VIS_TYPE_COLUMN, VIS_TYPE_GROUP_CHARTS], VIS_TYPE_GROUP_CHARTS, [`type:in:[${VIS_TYPE_COLUMN}]`]],
|
|
31
|
+
// when filterVisTypes is passed the default type filter only include those
|
|
32
|
+
[[VIS_TYPE_PIVOT_TABLE], '', [`type:in:[${VIS_TYPE_PIVOT_TABLE}]`]], [[VIS_TYPE_LINE_LIST, VIS_TYPE_PIVOT_TABLE], '', [`type:in:[${VIS_TYPE_LINE_LIST},${VIS_TYPE_PIVOT_TABLE}]`]]];
|
|
33
|
+
test.each(typeTestCases)('formats the type filter given %p and %p', (types, visType, expected) => expect(formatFilters(currentUser, {
|
|
34
|
+
visType
|
|
35
|
+
}, types === null || types === void 0 ? void 0 : types.map(type => ({
|
|
36
|
+
type
|
|
37
|
+
})))).toEqual(expected));
|
|
38
|
+
test('combined filters', () => {
|
|
39
|
+
expect(formatFilters(currentUser, {
|
|
40
|
+
createdBy: CREATED_BY_CURRENT_USER,
|
|
41
|
+
searchTerm: 'test',
|
|
42
|
+
visType: VIS_TYPE_GROUP_ALL
|
|
43
|
+
}, [{
|
|
44
|
+
type: VIS_TYPE_LINE_LIST
|
|
45
|
+
}, {
|
|
46
|
+
type: VIS_TYPE_PIVOT_TABLE
|
|
47
|
+
}])).toEqual([`identifiable:token:test`, `user.id:eq:${currentUser.id}`, `type:in:[${VIS_TYPE_LINE_LIST},${VIS_TYPE_PIVOT_TABLE}]`]);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -3,40 +3,33 @@ import { ButtonStrip, Modal, ModalTitle, ModalContent, ModalActions, Button, Fie
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { modalContent, tabSection, tabSectionTitle, tabSectionTitleDisabled, tabSectionTitleMargin, tabSectionOption, tabSectionOptionItem, tabSectionOptionToggleable, tabSectionToggleableSubsection, tabSectionOptionComplexInline, tabSectionOptionText, tabBar, tabContent, tabSectionOptionIcon } from './styles/VisualizationOptions.style.js';
|
|
6
|
-
const VisualizationOptions =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
6
|
+
const VisualizationOptions = ({
|
|
7
|
+
initiallyActiveTabKey,
|
|
8
|
+
optionsConfig,
|
|
9
|
+
onClose,
|
|
10
|
+
onUpdate
|
|
11
|
+
}) => {
|
|
13
12
|
const [activeTabKey, setActiveTabKey] = useState(initiallyActiveTabKey);
|
|
14
|
-
const generateTabContent = sections => sections.map(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
key,
|
|
36
|
-
label,
|
|
37
|
-
content: generateTabContent(content)
|
|
38
|
-
};
|
|
39
|
-
});
|
|
13
|
+
const generateTabContent = sections => sections.map(({
|
|
14
|
+
key,
|
|
15
|
+
label,
|
|
16
|
+
content,
|
|
17
|
+
helpText
|
|
18
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
key: key,
|
|
20
|
+
className: tabSection.className
|
|
21
|
+
}, /*#__PURE__*/React.createElement(FieldSet, null, label ? /*#__PURE__*/React.createElement(Legend, null, /*#__PURE__*/React.createElement("span", {
|
|
22
|
+
className: tabSectionTitle.className
|
|
23
|
+
}, label)) : null, content, helpText ? /*#__PURE__*/React.createElement(Legend, null, /*#__PURE__*/React.createElement(Help, null, helpText)) : null)));
|
|
24
|
+
const generateTabs = tabs => tabs.map(({
|
|
25
|
+
key,
|
|
26
|
+
label,
|
|
27
|
+
content
|
|
28
|
+
}) => ({
|
|
29
|
+
key,
|
|
30
|
+
label,
|
|
31
|
+
content: generateTabContent(content)
|
|
32
|
+
}));
|
|
40
33
|
const getModalContent = () => {
|
|
41
34
|
const tabs = generateTabs(optionsConfig);
|
|
42
35
|
let activeTabIndex = tabs.findIndex(tab => tab.key === activeTabKey);
|
|
@@ -47,17 +40,14 @@ const VisualizationOptions = _ref => {
|
|
|
47
40
|
className: tabBar.className
|
|
48
41
|
}, /*#__PURE__*/React.createElement(TabBar, {
|
|
49
42
|
dataTest: 'options-modal-tab-bar'
|
|
50
|
-
}, tabs.map((
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
selected: index === activeTabIndex
|
|
59
|
-
}, label);
|
|
60
|
-
})), tabBar.styles), /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
}, tabs.map(({
|
|
44
|
+
key,
|
|
45
|
+
label
|
|
46
|
+
}, index) => /*#__PURE__*/React.createElement(Tab, {
|
|
47
|
+
key: key,
|
|
48
|
+
onClick: () => setActiveTabKey(key),
|
|
49
|
+
selected: index === activeTabIndex
|
|
50
|
+
}, label))), tabBar.styles), /*#__PURE__*/React.createElement("div", {
|
|
61
51
|
className: tabContent.className
|
|
62
52
|
}, tabs[activeTabIndex].content, tabContent.styles, tabSection.styles, tabSectionTitle.styles, tabSectionTitleDisabled.styles, tabSectionTitleMargin.styles, tabSectionOption.styles, tabSectionOptionItem.styles, tabSectionOptionToggleable.styles, tabSectionToggleableSubsection.styles, tabSectionOptionComplexInline.styles, tabSectionOptionText.styles, tabSectionOptionIcon.styles));
|
|
63
53
|
};
|
|
@@ -11,17 +11,16 @@ import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDC
|
|
|
11
11
|
import { DIMENSION_ID_ORGUNIT } from '../../modules/predefinedDimensions.js';
|
|
12
12
|
import styles from './styles/OrgUnitDimension.style.js';
|
|
13
13
|
const DYNAMIC_ORG_UNITS = [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN];
|
|
14
|
-
const OrgUnitDimension =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
14
|
+
const OrgUnitDimension = ({
|
|
15
|
+
roots,
|
|
16
|
+
selected,
|
|
17
|
+
onSelect,
|
|
18
|
+
hideGroupSelect = false,
|
|
19
|
+
hideLevelSelect = false,
|
|
20
|
+
hideUserOrgUnits = false,
|
|
21
|
+
warning,
|
|
22
|
+
displayNameProp
|
|
23
|
+
}) => {
|
|
25
24
|
const [ouLevels, setOuLevels] = useState([]);
|
|
26
25
|
const [ouGroups, setOuGroups] = useState([]);
|
|
27
26
|
const dataEngine = useDataEngine();
|
|
@@ -138,44 +137,35 @@ const OrgUnitDimension = _ref => {
|
|
|
138
137
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
139
138
|
label: i18n.t('User organisation unit'),
|
|
140
139
|
checked: selected.some(item => item.id === USER_ORG_UNIT),
|
|
141
|
-
onChange:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
displayName: i18n.t('User organisation unit')
|
|
149
|
-
});
|
|
150
|
-
},
|
|
140
|
+
onChange: ({
|
|
141
|
+
checked
|
|
142
|
+
}) => onSelectItems({
|
|
143
|
+
id: USER_ORG_UNIT,
|
|
144
|
+
checked,
|
|
145
|
+
displayName: i18n.t('User organisation unit')
|
|
146
|
+
}),
|
|
151
147
|
dense: true
|
|
152
148
|
}), /*#__PURE__*/React.createElement(Checkbox, {
|
|
153
149
|
label: i18n.t('User sub-units'),
|
|
154
150
|
checked: selected.some(item => item.id === USER_ORG_UNIT_CHILDREN),
|
|
155
|
-
onChange:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
displayName: i18n.t('User sub-units')
|
|
163
|
-
});
|
|
164
|
-
},
|
|
151
|
+
onChange: ({
|
|
152
|
+
checked
|
|
153
|
+
}) => onSelectItems({
|
|
154
|
+
id: USER_ORG_UNIT_CHILDREN,
|
|
155
|
+
checked,
|
|
156
|
+
displayName: i18n.t('User sub-units')
|
|
157
|
+
}),
|
|
165
158
|
dense: true
|
|
166
159
|
}), /*#__PURE__*/React.createElement(Checkbox, {
|
|
167
160
|
label: i18n.t('User sub-x2-units'),
|
|
168
161
|
checked: selected.some(item => item.id === USER_ORG_UNIT_GRANDCHILDREN),
|
|
169
|
-
onChange:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
displayName: i18n.t('User sub-x2-units')
|
|
177
|
-
});
|
|
178
|
-
},
|
|
162
|
+
onChange: ({
|
|
163
|
+
checked
|
|
164
|
+
}) => onSelectItems({
|
|
165
|
+
id: USER_ORG_UNIT_GRANDCHILDREN,
|
|
166
|
+
checked,
|
|
167
|
+
displayName: i18n.t('User sub-x2-units')
|
|
168
|
+
}),
|
|
179
169
|
dense: true
|
|
180
170
|
})), /*#__PURE__*/React.createElement("div", {
|
|
181
171
|
className: `jsx-${styles.__hash}` + " " + "orgUnitTreeWrapper"
|
|
@@ -191,12 +181,9 @@ const OrgUnitDimension = _ref => {
|
|
|
191
181
|
}) || "")
|
|
192
182
|
}, !hideLevelSelect && /*#__PURE__*/React.createElement(MultiSelect, {
|
|
193
183
|
selected: ouLevels.length ? selected.filter(item => ouIdHelper.hasLevelPrefix(item.id)).map(item => ouIdHelper.removePrefix(item.id)) : [],
|
|
194
|
-
onChange:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} = _ref5;
|
|
198
|
-
return onLevelChange(selected);
|
|
199
|
-
},
|
|
184
|
+
onChange: ({
|
|
185
|
+
selected
|
|
186
|
+
}) => onLevelChange(selected),
|
|
200
187
|
placeholder: i18n.t('Select a level'),
|
|
201
188
|
loading: !ouLevels.length,
|
|
202
189
|
dense: true,
|
|
@@ -208,12 +195,9 @@ const OrgUnitDimension = _ref => {
|
|
|
208
195
|
dataTest: `org-unit-level-select-option-${level.id}`
|
|
209
196
|
}))), !hideGroupSelect && /*#__PURE__*/React.createElement(MultiSelect, {
|
|
210
197
|
selected: ouGroups.length ? selected.filter(item => ouIdHelper.hasGroupPrefix(item.id)).map(item => ouIdHelper.removePrefix(item.id)) : [],
|
|
211
|
-
onChange:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
} = _ref6;
|
|
215
|
-
return onGroupChange(selected);
|
|
216
|
-
},
|
|
198
|
+
onChange: ({
|
|
199
|
+
selected
|
|
200
|
+
}) => onGroupChange(selected),
|
|
217
201
|
placeholder: i18n.t('Select a group'),
|
|
218
202
|
loading: !ouGroups.length,
|
|
219
203
|
dense: true,
|
|
@@ -244,11 +228,6 @@ const OrgUnitDimension = _ref => {
|
|
|
244
228
|
id: styles.__hash
|
|
245
229
|
}, styles));
|
|
246
230
|
};
|
|
247
|
-
OrgUnitDimension.defaultProps = {
|
|
248
|
-
hideGroupSelect: false,
|
|
249
|
-
hideLevelSelect: false,
|
|
250
|
-
hideUserOrgUnits: false
|
|
251
|
-
};
|
|
252
231
|
OrgUnitDimension.propTypes = {
|
|
253
232
|
displayNameProp: PropTypes.string,
|
|
254
233
|
hideGroupSelect: PropTypes.bool,
|