@dhis2/analytics 28.0.2 → 28.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/__demo__/DataDimension.stories.js +3 -4
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +3 -4
- package/build/cjs/__demo__/PeriodDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +166 -224
- package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
- package/build/cjs/__demo__/SingleValue.stories.js +1 -2
- package/build/cjs/__demo__/Toolbar.stories.js +1 -2
- package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
- package/build/cjs/api/analytics/Analytics.js +8 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/cjs/api/analytics/utils.js +11 -17
- package/build/cjs/api/dimensions.js +119 -148
- package/build/cjs/api/expression.js +39 -60
- package/build/cjs/api/organisationUnits.js +23 -35
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
- package/build/cjs/components/CachedDataQueryProvider.js +7 -9
- package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/cjs/components/DataDimension/DataDimension.js +20 -32
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
- package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
- package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/cjs/components/DataDimension/TransferOption.js +35 -39
- package/build/cjs/components/DimensionMenu.js +13 -14
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
- package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
- package/build/cjs/components/FileMenu/FileMenu.js +19 -30
- package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
- package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/cjs/components/FileMenu/utils.js +10 -12
- package/build/cjs/components/Filter/Filter.js +21 -27
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/cjs/components/LegendKey/LegendKey.js +3 -4
- package/build/cjs/components/OfflineTooltip.js +18 -26
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
- package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
- package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/cjs/components/Options/VisualizationOptions.js +35 -46
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
- package/build/cjs/components/PivotTable/PivotTable.js +8 -10
- package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
- package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
- package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
- package/build/cjs/components/RichText/Editor/Editor.js +70 -85
- package/build/cjs/components/RichText/Parser/Parser.js +5 -10
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/cjs/components/Toolbar/Toolbar.js +10 -16
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
- package/build/cjs/components/TransferOption.js +14 -15
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +8 -10
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +52 -0
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/cjs/components/UserMention/UserList.js +6 -7
- package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
- package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
- package/build/cjs/components/VisTypeIcon.js +5 -6
- package/build/cjs/index.js +38 -39
- package/build/cjs/locales/ar_IQ/translations.json +20 -11
- package/build/cjs/locales/cs/translations.json +2 -0
- package/build/cjs/locales/en/translations.json +1 -0
- package/build/cjs/locales/es/translations.json +2 -0
- package/build/cjs/locales/fr/translations.json +2 -0
- package/build/cjs/locales/id/translations.json +20 -11
- package/build/cjs/locales/index.js +62 -62
- package/build/cjs/locales/lo/translations.json +2 -0
- package/build/cjs/locales/nb/translations.json +2 -0
- package/build/cjs/locales/prs/translations.json +2 -0
- package/build/cjs/locales/ps/translations.json +2 -0
- package/build/cjs/locales/pt/translations.json +2 -0
- package/build/cjs/locales/pt_BR/translations.json +2 -0
- package/build/cjs/locales/ru/translations.json +2 -0
- package/build/cjs/locales/si/translations.json +20 -11
- package/build/cjs/locales/sv/translations.json +20 -11
- package/build/cjs/locales/tet/translations.json +20 -11
- package/build/cjs/locales/tg/translations.json +2 -0
- package/build/cjs/locales/uk/translations.json +2 -0
- package/build/cjs/locales/ur/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/cjs/locales/vi/translations.json +2 -0
- package/build/cjs/locales/zh/translations.json +2 -0
- package/build/cjs/locales/zh_CN/translations.json +17 -15
- package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
- package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
- package/build/cjs/modules/dimensionListItem.js +4 -5
- package/build/cjs/modules/expressions.js +3 -9
- package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
- package/build/cjs/modules/layout/dimensionCreate.js +1 -3
- package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
- package/build/cjs/modules/legends.js +5 -6
- package/build/cjs/modules/outliers/index.js +5 -6
- package/build/cjs/modules/outliers/iqr.js +4 -6
- package/build/cjs/modules/outliers/modZScore.js +6 -14
- package/build/cjs/modules/outliers/zScore.js +3 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/cjs/modules/pivotTable/measureText.js +7 -9
- package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
- package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
- package/build/cjs/modules/relativeItems/index.js +1 -4
- package/build/cjs/modules/renderValue.js +1 -2
- package/build/cjs/modules/utils.js +11 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/cjs/visualizations/config/index.js +11 -12
- package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
- package/build/cjs/visualizations/index.js +1 -4
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/cjs/visualizations/store/index.js +15 -17
- package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
- package/build/cjs/visualizations/util/getFilterText.js +3 -6
- package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
- package/build/es/__demo__/DataDimension.stories.js +2 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/es/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/es/__demo__/PeriodDimension.stories.js +2 -2
- package/build/es/__demo__/PivotTable.stories.js +165 -222
- package/build/es/api/__tests__/dimensions.spec.js +1 -2
- package/build/es/api/analytics/Analytics.js +8 -9
- package/build/es/api/analytics/AnalyticsBase.js +58 -77
- package/build/es/api/analytics/AnalyticsRequest.js +1 -2
- package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/es/api/analytics/utils.js +11 -17
- package/build/es/api/dimensions.js +119 -148
- package/build/es/api/expression.js +39 -60
- package/build/es/api/organisationUnits.js +23 -35
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
- package/build/es/components/CachedDataQueryProvider.js +6 -7
- package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
- package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
- package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
- package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
- package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/es/components/DataDimension/DataDimension.js +19 -30
- package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
- package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
- package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
- package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
- package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
- package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
- package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/es/components/DataDimension/TransferOption.js +35 -39
- package/build/es/components/DimensionMenu.js +13 -14
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
- package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
- package/build/es/components/FileMenu/DeleteDialog.js +10 -14
- package/build/es/components/FileMenu/FileMenu.js +18 -28
- package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/es/components/FileMenu/RenameDialog.js +12 -19
- package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/es/components/FileMenu/utils.js +10 -12
- package/build/es/components/Filter/Filter.js +21 -27
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/es/components/Interpretations/common/Message/Message.js +6 -7
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/es/components/LegendKey/LegendKey.js +3 -4
- package/build/es/components/OfflineTooltip.js +18 -26
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/es/components/OpenFileDialog/DateField.js +3 -4
- package/build/es/components/OpenFileDialog/FileList.js +19 -22
- package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
- package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/es/components/Options/VisualizationOptions.js +34 -44
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
- package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/es/components/PeriodDimension/utils/index.js +1 -5
- package/build/es/components/PivotTable/PivotTable.js +7 -8
- package/build/es/components/PivotTable/PivotTableBody.js +20 -29
- package/build/es/components/PivotTable/PivotTableCell.js +8 -12
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
- package/build/es/components/PivotTable/PivotTableHead.js +13 -16
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/es/components/PivotTable/PivotTableRow.js +20 -27
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
- package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
- package/build/es/components/RichText/Editor/Editor.js +69 -83
- package/build/es/components/RichText/Parser/Parser.js +4 -8
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/es/components/Toolbar/Toolbar.js +10 -16
- package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/es/components/Toolbar/UpdateButton.js +18 -24
- package/build/es/components/TransferOption.js +14 -15
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -8
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +49 -0
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/es/components/UserMention/UserList.js +6 -7
- package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
- package/build/es/components/UserMention/useUserSearchResults.js +12 -16
- package/build/es/components/VisTypeIcon.js +5 -6
- package/build/es/locales/ar_IQ/translations.json +20 -11
- package/build/es/locales/cs/translations.json +2 -0
- package/build/es/locales/en/translations.json +1 -0
- package/build/es/locales/es/translations.json +2 -0
- package/build/es/locales/fr/translations.json +2 -0
- package/build/es/locales/id/translations.json +20 -11
- package/build/es/locales/lo/translations.json +2 -0
- package/build/es/locales/nb/translations.json +2 -0
- package/build/es/locales/prs/translations.json +2 -0
- package/build/es/locales/ps/translations.json +2 -0
- package/build/es/locales/pt/translations.json +2 -0
- package/build/es/locales/pt_BR/translations.json +2 -0
- package/build/es/locales/ru/translations.json +2 -0
- package/build/es/locales/si/translations.json +20 -11
- package/build/es/locales/sv/translations.json +20 -11
- package/build/es/locales/tet/translations.json +20 -11
- package/build/es/locales/tg/translations.json +2 -0
- package/build/es/locales/uk/translations.json +2 -0
- package/build/es/locales/ur/translations.json +2 -0
- package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/es/locales/vi/translations.json +2 -0
- package/build/es/locales/zh/translations.json +2 -0
- package/build/es/locales/zh_CN/translations.json +17 -15
- package/build/es/modules/__tests__/expressions.spec.js +4 -5
- package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
- package/build/es/modules/dimensionListItem.js +4 -5
- package/build/es/modules/expressions.js +3 -9
- package/build/es/modules/getPWAInstallationStatus.js +7 -9
- package/build/es/modules/layout/dimensionCreate.js +1 -3
- package/build/es/modules/layout/dimensionIsValid.js +3 -4
- package/build/es/modules/legends.js +5 -6
- package/build/es/modules/outliers/index.js +2 -3
- package/build/es/modules/outliers/iqr.js +4 -6
- package/build/es/modules/outliers/modZScore.js +6 -14
- package/build/es/modules/outliers/zScore.js +3 -4
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/es/modules/pivotTable/clipAxis.js +7 -8
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/es/modules/pivotTable/measureText.js +7 -9
- package/build/es/modules/pivotTable/useParentSize.js +1 -2
- package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/es/modules/pivotTable/useTableClipping.js +6 -7
- package/build/es/modules/relativeItems/index.js +1 -4
- package/build/es/modules/renderValue.js +1 -2
- package/build/es/modules/utils.js +9 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/es/visualizations/config/index.js +11 -12
- package/build/es/visualizations/config/validators/dhis/index.js +3 -4
- package/build/es/visualizations/index.js +1 -4
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/store/index.js +15 -17
- package/build/es/visualizations/store/validators/dhis/index.js +5 -6
- package/build/es/visualizations/util/getFilterText.js +3 -6
- package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
- package/package.json +12 -12
|
@@ -15,15 +15,15 @@ var _ItemSelector = _interopRequireDefault(require("./ItemSelector.js"));
|
|
|
15
15
|
var _DynamicDimensionStyle = _interopRequireDefault(require("./styles/DynamicDimension.style.js"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const ALL_DYNAMIC_DIMENSION_ITEMS = exports.ALL_DYNAMIC_DIMENSION_ITEMS = 'ALL_ITEMS';
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const SELECTED_ITEMS_PROP_DEFAULT = [];
|
|
19
|
+
const DynamicDimension = ({
|
|
20
|
+
dimensionId,
|
|
21
|
+
onSelect = Function.prototype,
|
|
22
|
+
selectedItems = SELECTED_ITEMS_PROP_DEFAULT,
|
|
23
|
+
rightFooter,
|
|
24
|
+
dimensionTitle,
|
|
25
|
+
displayNameProp
|
|
26
|
+
}) => {
|
|
27
27
|
const dataEngine = (0, _appRuntime.useDataEngine)();
|
|
28
28
|
const fetchItems = (page, searchTerm) => (0, _dimensions.apiFetchItemsByDimension)({
|
|
29
29
|
dataEngine,
|
|
@@ -104,8 +104,4 @@ DynamicDimension.propTypes = {
|
|
|
104
104
|
onSelect: _propTypes.default.func.isRequired,
|
|
105
105
|
rightFooter: _propTypes.default.node
|
|
106
106
|
};
|
|
107
|
-
DynamicDimension.defaultProps = {
|
|
108
|
-
selectedItems: [],
|
|
109
|
-
onSelect: Function.prototype
|
|
110
|
-
};
|
|
111
107
|
var _default = exports.default = DynamicDimension;
|
|
@@ -16,19 +16,18 @@ var _SelectedEmptyPlaceholder = require("../DataDimension/SelectedEmptyPlacehold
|
|
|
16
16
|
var _SourceEmptyPlaceholder = require("../DataDimension/SourceEmptyPlaceholder.js");
|
|
17
17
|
var _DimensionSelectorStyle = _interopRequireDefault(require("../styles/DimensionSelector.style.js"));
|
|
18
18
|
var _TransferOption = require("../TransferOption.js");
|
|
19
|
-
function
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
21
|
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); }
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
const SELECTED_ITEMS_PROP_DEFAULT = [];
|
|
23
|
+
const ItemSelector = ({
|
|
24
|
+
selectedItems = SELECTED_ITEMS_PROP_DEFAULT,
|
|
25
|
+
noItemsMessage,
|
|
26
|
+
onFetch,
|
|
27
|
+
onSelect,
|
|
28
|
+
rightFooter,
|
|
29
|
+
dataTest
|
|
30
|
+
}) => {
|
|
32
31
|
const [state, setState] = (0, _react.useState)({
|
|
33
32
|
searchTerm: '',
|
|
34
33
|
options: [],
|
|
@@ -48,18 +47,15 @@ const ItemSelector = _ref => {
|
|
|
48
47
|
loading: true
|
|
49
48
|
}));
|
|
50
49
|
const result = await onFetch(page, state.searchTerm);
|
|
51
|
-
const newOptions = (_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 ? void 0 : _result$dimensionItem.map(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
disabled
|
|
61
|
-
};
|
|
62
|
-
});
|
|
50
|
+
const newOptions = (_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 ? void 0 : _result$dimensionItem.map(({
|
|
51
|
+
id,
|
|
52
|
+
name,
|
|
53
|
+
disabled
|
|
54
|
+
}) => ({
|
|
55
|
+
label: name,
|
|
56
|
+
value: id,
|
|
57
|
+
disabled
|
|
58
|
+
}));
|
|
63
59
|
setState(state => ({
|
|
64
60
|
...state,
|
|
65
61
|
loading: false,
|
|
@@ -95,12 +91,9 @@ const ItemSelector = _ref => {
|
|
|
95
91
|
}
|
|
96
92
|
};
|
|
97
93
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.Transfer, {
|
|
98
|
-
onChange:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
} = _ref3;
|
|
102
|
-
return onChange(selected);
|
|
103
|
-
},
|
|
94
|
+
onChange: ({
|
|
95
|
+
selected
|
|
96
|
+
}) => onChange(selected),
|
|
104
97
|
selected: selectedItems.map(item => item.value),
|
|
105
98
|
options: [...state.options, ...selectedItems],
|
|
106
99
|
loading: state.loading,
|
|
@@ -116,12 +109,9 @@ const ItemSelector = _ref => {
|
|
|
116
109
|
filterPlaceholder: _index.default.t('Search'),
|
|
117
110
|
filterablePicked: false,
|
|
118
111
|
searchTerm: state.searchTerm,
|
|
119
|
-
onFilterChange:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} = _ref4;
|
|
123
|
-
return setSearchTerm(value);
|
|
124
|
-
},
|
|
112
|
+
onFilterChange: ({
|
|
113
|
+
value
|
|
114
|
+
}) => setSearchTerm(value),
|
|
125
115
|
enableOrderChange: true,
|
|
126
116
|
height: _dimensionSelectorHelper.TRANSFER_HEIGHT,
|
|
127
117
|
optionsWidth: _dimensionSelectorHelper.TRANSFER_OPTIONS_WIDTH,
|
|
@@ -151,7 +141,4 @@ ItemSelector.propTypes = {
|
|
|
151
141
|
value: _propTypes.default.string.isRequired
|
|
152
142
|
}))
|
|
153
143
|
};
|
|
154
|
-
ItemSelector.defaultProps = {
|
|
155
|
-
selectedItems: []
|
|
156
|
-
};
|
|
157
144
|
var _default = exports.default = ItemSelector;
|
|
@@ -10,27 +10,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _index = _interopRequireDefault(require("../../locales/index.js"));
|
|
12
12
|
var _utils = require("./utils.js");
|
|
13
|
-
function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
const getMutation = type => ({
|
|
17
16
|
resource: (0, _utils.endpointFromFileType)(type),
|
|
18
|
-
id:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
22
|
-
return id;
|
|
23
|
-
},
|
|
17
|
+
id: ({
|
|
18
|
+
id
|
|
19
|
+
}) => id,
|
|
24
20
|
type: 'delete'
|
|
25
21
|
});
|
|
26
|
-
const DeleteDialog =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref2;
|
|
22
|
+
const DeleteDialog = ({
|
|
23
|
+
type,
|
|
24
|
+
id,
|
|
25
|
+
onClose,
|
|
26
|
+
onDelete,
|
|
27
|
+
onError
|
|
28
|
+
}) => {
|
|
34
29
|
const mutation = (0, _react.useMemo)(() => getMutation(type), []);
|
|
35
30
|
const [mutate] = (0, _appRuntime.useDataMutation)(mutation, {
|
|
36
31
|
variables: {
|
|
@@ -16,27 +16,25 @@ var _GetLinkDialog = require("./GetLinkDialog.js");
|
|
|
16
16
|
var _RenameDialog = require("./RenameDialog.js");
|
|
17
17
|
var _SaveAsDialog = require("./SaveAsDialog.js");
|
|
18
18
|
var _utils = require("./utils.js");
|
|
19
|
-
function
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
-
const FileMenu =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
21
|
+
const FileMenu = ({
|
|
22
|
+
currentUser,
|
|
23
|
+
defaultFilterVisType,
|
|
24
|
+
fileType,
|
|
25
|
+
fileObject,
|
|
26
|
+
filterVisTypes,
|
|
27
|
+
onNew = Function.prototype,
|
|
28
|
+
onOpen = Function.prototype,
|
|
29
|
+
onSave,
|
|
30
|
+
onSaveAs,
|
|
31
|
+
onRename = Function.prototype,
|
|
32
|
+
onShare = Function.prototype,
|
|
33
|
+
onDelete = Function.prototype,
|
|
34
|
+
onError = Function.prototype,
|
|
35
|
+
onTranslate = Function.prototype
|
|
36
|
+
}) => {
|
|
37
|
+
var _fileObject$access, _fileObject$access2, _fileObject$access3, _fileObject$access4, _fileObject$access5, _fileObject$access6, _fileObject$access7, _fileObject$access8, _fileObject$access9, _fileObject$access0;
|
|
40
38
|
const [currentDialog, setCurrentDialog] = (0, _react.useState)(null);
|
|
41
39
|
const onMenuItemClick = dialogToOpen => () => {
|
|
42
40
|
setCurrentDialog(dialogToOpen);
|
|
@@ -193,21 +191,12 @@ const FileMenu = _ref => {
|
|
|
193
191
|
icon: /*#__PURE__*/_react.default.createElement(_ui.IconDelete24, {
|
|
194
192
|
color: fileObject !== null && fileObject !== void 0 && fileObject.id && fileObject !== null && fileObject !== void 0 && (_fileObject$access9 = fileObject.access) !== null && _fileObject$access9 !== void 0 && _fileObject$access9.delete ? _ui.colors.red700 : iconInactiveColor
|
|
195
193
|
}),
|
|
196
|
-
disabled: !(fileObject !== null && fileObject !== void 0 && fileObject.id && fileObject !== null && fileObject !== void 0 && (_fileObject$
|
|
194
|
+
disabled: !(fileObject !== null && fileObject !== void 0 && fileObject.id && fileObject !== null && fileObject !== void 0 && (_fileObject$access0 = fileObject.access) !== null && _fileObject$access0 !== void 0 && _fileObject$access0.delete),
|
|
197
195
|
onClick: onMenuItemClick('delete'),
|
|
198
196
|
dataTest: "file-menu-delete"
|
|
199
197
|
}))), renderDialog());
|
|
200
198
|
};
|
|
201
199
|
exports.FileMenu = FileMenu;
|
|
202
|
-
FileMenu.defaultProps = {
|
|
203
|
-
onDelete: Function.prototype,
|
|
204
|
-
onError: Function.prototype,
|
|
205
|
-
onNew: Function.prototype,
|
|
206
|
-
onOpen: Function.prototype,
|
|
207
|
-
onRename: Function.prototype,
|
|
208
|
-
onShare: Function.prototype,
|
|
209
|
-
onTranslate: Function.prototype
|
|
210
|
-
};
|
|
211
200
|
FileMenu.propTypes = {
|
|
212
201
|
currentUser: _propTypes.default.object,
|
|
213
202
|
defaultFilterVisType: _propTypes.default.string,
|
|
@@ -13,12 +13,11 @@ var _index = _interopRequireDefault(require("../../locales/index.js"));
|
|
|
13
13
|
var _GetLinkDialogStyles = require("./GetLinkDialog.styles.js");
|
|
14
14
|
var _utils = require("./utils.js");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
const GetLinkDialog =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
16
|
+
const GetLinkDialog = ({
|
|
17
|
+
type,
|
|
18
|
+
id,
|
|
19
|
+
onClose
|
|
20
|
+
}) => {
|
|
22
21
|
const {
|
|
23
22
|
apiVersion,
|
|
24
23
|
baseUrl
|
|
@@ -39,7 +38,8 @@ const GetLinkDialog = _ref => {
|
|
|
39
38
|
}, appUrl), /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
40
39
|
icon: /*#__PURE__*/_react.default.createElement(_ui.IconCopy24, null),
|
|
41
40
|
small: true,
|
|
42
|
-
onClick: () => navigator.clipboard.writeText(appUrl)
|
|
41
|
+
onClick: () => navigator.clipboard.writeText(appUrl),
|
|
42
|
+
"aria-label": _index.default.t('Copy to clipboard')
|
|
43
43
|
}))), /*#__PURE__*/_react.default.createElement(_ui.ModalActions, null, /*#__PURE__*/_react.default.createElement(_ui.ButtonStrip, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
44
44
|
onClick: onClose,
|
|
45
45
|
secondary: true
|
|
@@ -11,16 +11,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _index = _interopRequireDefault(require("../../locales/index.js"));
|
|
12
12
|
var _FileMenuStyles = require("./FileMenu.styles.js");
|
|
13
13
|
var _utils = require("./utils.js");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
const RenameDialog =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
16
|
+
const RenameDialog = ({
|
|
17
|
+
type,
|
|
18
|
+
object,
|
|
19
|
+
onClose,
|
|
20
|
+
onRename
|
|
21
|
+
}) => {
|
|
24
22
|
const [name, setName] = (0, _react.useState)(object.name);
|
|
25
23
|
const [description, setDescription] = (0, _react.useState)(object.description);
|
|
26
24
|
const renameObject = () => {
|
|
@@ -43,23 +41,17 @@ const RenameDialog = _ref => {
|
|
|
43
41
|
label: _index.default.t('Name'),
|
|
44
42
|
required: true,
|
|
45
43
|
value: name,
|
|
46
|
-
onChange:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = _ref2;
|
|
50
|
-
return setName(value);
|
|
51
|
-
},
|
|
44
|
+
onChange: ({
|
|
45
|
+
value
|
|
46
|
+
}) => setName(value),
|
|
52
47
|
dataTest: "file-menu-rename-modal-name"
|
|
53
48
|
}), /*#__PURE__*/_react.default.createElement(_ui.TextAreaField, {
|
|
54
49
|
label: _index.default.t('Description'),
|
|
55
50
|
value: description,
|
|
56
51
|
rows: 3,
|
|
57
|
-
onChange:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = _ref3;
|
|
61
|
-
return setDescription(value);
|
|
62
|
-
},
|
|
52
|
+
onChange: ({
|
|
53
|
+
value
|
|
54
|
+
}) => setDescription(value),
|
|
63
55
|
dataTest: "file-menu-rename-modal-description"
|
|
64
56
|
}))), /*#__PURE__*/_react.default.createElement(_ui.ModalActions, null, /*#__PURE__*/_react.default.createElement(_ui.ButtonStrip, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
65
57
|
onClick: onClose,
|
|
@@ -11,17 +11,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _index = _interopRequireDefault(require("../../locales/index.js"));
|
|
12
12
|
var _FileMenuStyles = require("./FileMenu.styles.js");
|
|
13
13
|
var _utils = require("./utils.js");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
const NAME_MAXLENGTH = 230;
|
|
18
|
-
const SaveAsDialog =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
17
|
+
const SaveAsDialog = ({
|
|
18
|
+
type,
|
|
19
|
+
object,
|
|
20
|
+
onClose,
|
|
21
|
+
onSaveAs
|
|
22
|
+
}) => {
|
|
25
23
|
const [name, setName] = (0, _react.useState)(object !== null && object !== void 0 && object.displayName || object !== null && object !== void 0 && object.name ? _index.default.t('{{- objectName}} (copy)', {
|
|
26
24
|
objectName: object.name
|
|
27
25
|
}) : '');
|
|
@@ -47,23 +45,17 @@ const SaveAsDialog = _ref => {
|
|
|
47
45
|
}, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
48
46
|
label: _index.default.t('Name'),
|
|
49
47
|
value: name,
|
|
50
|
-
onChange:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} = _ref2;
|
|
54
|
-
return setName(value.substring(0, NAME_MAXLENGTH));
|
|
55
|
-
},
|
|
48
|
+
onChange: ({
|
|
49
|
+
value
|
|
50
|
+
}) => setName(value.substring(0, NAME_MAXLENGTH)),
|
|
56
51
|
dataTest: "file-menu-saveas-modal-name"
|
|
57
52
|
}), /*#__PURE__*/_react.default.createElement(_ui.TextAreaField, {
|
|
58
53
|
label: _index.default.t('Description'),
|
|
59
54
|
value: description,
|
|
60
55
|
rows: 3,
|
|
61
|
-
onChange:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = _ref3;
|
|
65
|
-
return setDescription(value);
|
|
66
|
-
},
|
|
56
|
+
onChange: ({
|
|
57
|
+
value
|
|
58
|
+
}) => setDescription(value),
|
|
67
59
|
dataTest: "file-menu-saveas-modal-description"
|
|
68
60
|
}))), /*#__PURE__*/_react.default.createElement(_ui.ModalActions, null, /*#__PURE__*/_react.default.createElement(_ui.ButtonStrip, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
69
61
|
onClick: onClose,
|
|
@@ -54,8 +54,7 @@ describe('The FileMenu component ', () => {
|
|
|
54
54
|
href: 'http://dhis2.org'
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
const renderFileMenu =
|
|
58
|
-
let customProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
|
+
const renderFileMenu = (customProps = {}) => {
|
|
59
58
|
const props = {
|
|
60
59
|
...baseProps,
|
|
61
60
|
...customProps
|
|
@@ -72,6 +71,11 @@ describe('The FileMenu component ', () => {
|
|
|
72
71
|
userAccesses: [],
|
|
73
72
|
userGroupAccesses: []
|
|
74
73
|
}
|
|
74
|
+
},
|
|
75
|
+
visualizations: {
|
|
76
|
+
pager: {
|
|
77
|
+
page: 1
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
};
|
|
77
81
|
return (0, _react.render)(/*#__PURE__*/_react2.default.createElement(_appRuntime.CustomDataProvider, {
|
|
@@ -63,14 +63,13 @@ describe('The FileMenu - GetLinkDialog component', () => {
|
|
|
63
63
|
id: tests[0].id
|
|
64
64
|
}).find(_ui.Modal)).toHaveLength(1);
|
|
65
65
|
});
|
|
66
|
-
test.each(tests)('renders a <a> tag containing the correct app path and id',
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = _ref;
|
|
66
|
+
test.each(tests)('renders a <a> tag containing the correct app path and id', ({
|
|
67
|
+
apiVersion,
|
|
68
|
+
baseUrl,
|
|
69
|
+
type,
|
|
70
|
+
id,
|
|
71
|
+
expected
|
|
72
|
+
}) => {
|
|
74
73
|
mockUseConfig.mockReturnValueOnce({
|
|
75
74
|
apiVersion: apiVersion || 42,
|
|
76
75
|
baseUrl
|
|
@@ -43,12 +43,11 @@ const appPathFor = (fileType, id, apiVersion) => {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
exports.appPathFor = appPathFor;
|
|
46
|
-
const preparePayloadForSaveAs =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} = _ref;
|
|
46
|
+
const preparePayloadForSaveAs = ({
|
|
47
|
+
visualization,
|
|
48
|
+
name,
|
|
49
|
+
description
|
|
50
|
+
}) => {
|
|
52
51
|
delete visualization.id;
|
|
53
52
|
delete visualization.created;
|
|
54
53
|
delete visualization.createdBy;
|
|
@@ -65,12 +64,11 @@ const preparePayloadForSaveAs = _ref => {
|
|
|
65
64
|
return visualization;
|
|
66
65
|
};
|
|
67
66
|
exports.preparePayloadForSaveAs = preparePayloadForSaveAs;
|
|
68
|
-
const preparePayloadForSave =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = _ref2;
|
|
67
|
+
const preparePayloadForSave = ({
|
|
68
|
+
visualization,
|
|
69
|
+
name,
|
|
70
|
+
description
|
|
71
|
+
}) => {
|
|
74
72
|
visualization.name = name || visualization.name || _d2I18n.default.t('Untitled {{visualizationType}}, {{date}}', {
|
|
75
73
|
visualizationType: (0, _visTypes.getDisplayNameByVisType)(visualization.type),
|
|
76
74
|
date: new Date().toLocaleDateString(undefined, {
|
|
@@ -10,37 +10,31 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _FilterStyle = _interopRequireDefault(require("./styles/Filter.style.js"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const Filter =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
id: _FilterStyle.default.__hash
|
|
33
|
-
}, _FilterStyle.default));
|
|
34
|
-
};
|
|
13
|
+
const Filter = ({
|
|
14
|
+
text,
|
|
15
|
+
onChange,
|
|
16
|
+
onClear,
|
|
17
|
+
placeholder,
|
|
18
|
+
type = 'text',
|
|
19
|
+
dataTest
|
|
20
|
+
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
+
className: `jsx-${_FilterStyle.default.__hash}` + " " + "container"
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
23
|
+
placeholder: placeholder,
|
|
24
|
+
onChange: ref => ref.value.length ? onChange(ref.value) : onClear(),
|
|
25
|
+
value: text,
|
|
26
|
+
dense: true,
|
|
27
|
+
type: type,
|
|
28
|
+
dataTest: dataTest
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
30
|
+
id: _FilterStyle.default.__hash
|
|
31
|
+
}, _FilterStyle.default));
|
|
35
32
|
Filter.propTypes = {
|
|
36
33
|
placeholder: _propTypes.default.string.isRequired,
|
|
37
|
-
type: _propTypes.default.string.isRequired,
|
|
38
34
|
onChange: _propTypes.default.func.isRequired,
|
|
39
35
|
onClear: _propTypes.default.func.isRequired,
|
|
40
36
|
dataTest: _propTypes.default.string,
|
|
41
|
-
text: _propTypes.default.string
|
|
42
|
-
|
|
43
|
-
Filter.defaultProps = {
|
|
44
|
-
type: 'text'
|
|
37
|
+
text: _propTypes.default.string,
|
|
38
|
+
type: _propTypes.default.string
|
|
45
39
|
};
|
|
46
40
|
var _default = exports.default = Filter;
|
|
@@ -11,17 +11,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _index = require("../common/index.js");
|
|
12
12
|
var _CommentDeleteButton = require("./CommentDeleteButton.js");
|
|
13
13
|
var _CommentUpdateForm = require("./CommentUpdateForm.js");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
const Comment =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
16
|
+
const Comment = ({
|
|
17
|
+
comment,
|
|
18
|
+
currentUser,
|
|
19
|
+
interpretationId,
|
|
20
|
+
onThreadUpdated,
|
|
21
|
+
canComment
|
|
22
|
+
}) => {
|
|
25
23
|
const [isUpdateMode, setIsUpdateMode] = (0, _react.useState)(false);
|
|
26
24
|
const commentAccess = (0, _index.getCommentAccess)(comment, canComment, currentUser);
|
|
27
25
|
return isUpdateMode ? /*#__PURE__*/_react.default.createElement(_CommentUpdateForm.CommentUpdateForm, {
|
|
@@ -11,27 +11,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _index = require("../../RichText/index.js");
|
|
13
13
|
var _index2 = require("../common/index.js");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
const CommentAddForm =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
16
|
+
const CommentAddForm = ({
|
|
17
|
+
interpretationId,
|
|
18
|
+
currentUser,
|
|
19
|
+
onSave,
|
|
20
|
+
focusRef
|
|
21
|
+
}) => {
|
|
24
22
|
const [showRichTextEditor, setShowRichTextEditor] = (0, _react.useState)(false);
|
|
25
23
|
const [commentText, setCommentText] = (0, _react.useState)('');
|
|
26
24
|
const saveMutationRef = (0, _react.useRef)({
|
|
27
25
|
resource: `interpretations/${interpretationId}/comments`,
|
|
28
26
|
type: 'create',
|
|
29
|
-
data:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref2;
|
|
33
|
-
return commentText;
|
|
34
|
-
}
|
|
27
|
+
data: ({
|
|
28
|
+
commentText
|
|
29
|
+
}) => commentText
|
|
35
30
|
});
|
|
36
31
|
const [save, {
|
|
37
32
|
loading
|
|
@@ -11,26 +11,21 @@ var _ui = require("@dhis2/ui");
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _index = require("../common/index.js");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
const mutation = {
|
|
18
17
|
resource: 'interpretations',
|
|
19
|
-
id:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
24
|
-
return `${interpretationId}/comments/${commentId}`;
|
|
25
|
-
},
|
|
18
|
+
id: ({
|
|
19
|
+
interpretationId,
|
|
20
|
+
commentId
|
|
21
|
+
}) => `${interpretationId}/comments/${commentId}`,
|
|
26
22
|
type: 'delete'
|
|
27
23
|
};
|
|
28
|
-
const CommentDeleteButton =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref2;
|
|
24
|
+
const CommentDeleteButton = ({
|
|
25
|
+
commentId,
|
|
26
|
+
interpretationId,
|
|
27
|
+
onComplete
|
|
28
|
+
}) => {
|
|
34
29
|
const [deleteError, setDeleteError] = (0, _react.useState)(null);
|
|
35
30
|
const [remove, {
|
|
36
31
|
loading
|