@gooddata/sdk-ui-ext 11.68.0-alpha.1 → 11.68.0-alpha.11
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/NOTICE +8336 -63104
- package/esm/insightView/InsightRenderer.d.ts.map +1 -1
- package/esm/insightView/InsightRenderer.js +4 -4
- package/esm/internal/components/BaseVisualization.d.ts.map +1 -1
- package/esm/internal/components/BaseVisualization.js +7 -7
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogFooter.js +2 -2
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogProvider.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogProvider.js +4 -4
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/useBackendProvider.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/useBackendProvider.js +2 -2
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/utils.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/utils.js +2 -2
- package/esm/internal/components/configurationControls/CheckboxControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/CheckboxControl.js +3 -3
- package/esm/internal/components/configurationControls/ConfigSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/ConfigSection.js +3 -3
- package/esm/internal/components/configurationControls/ConfigSubsection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/ConfigSubsection.js +3 -3
- package/esm/internal/components/configurationControls/ContinuousLineControl.js +3 -3
- package/esm/internal/components/configurationControls/DistintcPointShapesControl.js +3 -3
- package/esm/internal/components/configurationControls/DropdownControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/DropdownControl.js +3 -3
- package/esm/internal/components/configurationControls/GeoViewportControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/GeoViewportControl.js +14 -14
- package/esm/internal/components/configurationControls/InputControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/InputControl.js +4 -4
- package/esm/internal/components/configurationControls/LineShapeControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/LineShapeControl.js +2 -2
- package/esm/internal/components/configurationControls/PagingSection.js +5 -5
- package/esm/internal/components/configurationControls/PivotTableTextWrappingControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/PivotTableTextWrappingControl.js +3 -3
- package/esm/internal/components/configurationControls/PushpinShapeControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/PushpinShapeControl.js +5 -5
- package/esm/internal/components/configurationControls/advanced/AdvancedSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/advanced/AdvancedSection.js +3 -3
- package/esm/internal/components/configurationControls/advanced/ConfigEditor.js +2 -2
- package/esm/internal/components/configurationControls/colors/ColorsSection.js +3 -3
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorCheckbox.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorCheckbox.js +4 -4
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorItem.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorItem.js +3 -3
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorResetButton.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorResetButton.js +6 -6
- package/esm/internal/components/configurationControls/comparison/values/numberFormat/NumberFormatControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/values/numberFormat/NumberFormatControl.js +3 -3
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.js +2 -2
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.js +3 -3
- package/esm/internal/components/configurationControls/customTooltip/CustomTooltipSection.js +3 -3
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.d.ts +1 -2
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.js +2 -2
- package/esm/internal/components/configurationControls/total/TotalSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/total/TotalSection.js +4 -4
- package/esm/internal/components/configurationPanels/BaseChartConfigurationPanel.js +2 -2
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.js +1 -2
- package/esm/internal/components/configurationPanels/LineChartBasedConfigurationPanel.js +1 -1
- package/esm/internal/components/configurationPanels/UnsupportedConfigurationPanel.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.js +3 -3
- package/esm/internal/components/dialogs/userManagementDialogs/types.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/types.js +6 -6
- package/esm/internal/components/insightList/useInsightPagedList.d.ts.map +1 -1
- package/esm/internal/components/insightList/useInsightPagedList.js +3 -3
- package/esm/internal/components/pluggableVisualizations/AbstractPluggableVisualization.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/AbstractPluggableVisualization.js +4 -4
- package/esm/internal/components/pluggableVisualizations/PluggableColumnBarCharts.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/PluggableColumnBarCharts.js +3 -4
- package/esm/internal/components/pluggableVisualizations/areaChart/PluggableAreaChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/areaChart/PluggableAreaChart.js +6 -6
- package/esm/internal/components/pluggableVisualizations/barChart/PluggableBarChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/barChart/PluggableBarChart.js +7 -7
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.js +9 -8
- package/esm/internal/components/pluggableVisualizations/bubbleChart/PluggableBubbleChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/bubbleChart/PluggableBubbleChart.js +4 -5
- package/esm/internal/components/pluggableVisualizations/bulletChart/PluggableBulletChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/bulletChart/PluggableBulletChart.js +3 -3
- package/esm/internal/components/pluggableVisualizations/columnChart/PluggableColumnChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/columnChart/PluggableColumnChart.js +7 -7
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChart.js +6 -6
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChartDeprecated.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChartDeprecated.js +5 -4
- package/esm/internal/components/pluggableVisualizations/geoAreaChart/PluggableGeoAreaChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoAreaChart/PluggableGeoAreaChart.js +4 -5
- package/esm/internal/components/pluggableVisualizations/geoChart/PluggableGeoPushpinChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoChart/PluggableGeoPushpinChart.js +8 -9
- package/esm/internal/components/pluggableVisualizations/geoChartNext/PluggableGeoPushpinChartNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoChartNext/PluggableGeoPushpinChartNext.js +15 -16
- package/esm/internal/components/pluggableVisualizations/geoCommon/geoPropertySanitization.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoCommon/geoPropertySanitization.js +8 -8
- package/esm/internal/components/pluggableVisualizations/headline/PluggableHeadline.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/headline/PluggableHeadline.js +2 -3
- package/esm/internal/components/pluggableVisualizations/headline/headlineBucketHelper.js +3 -3
- package/esm/internal/components/pluggableVisualizations/heatMap/PluggableHeatmap.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/heatMap/PluggableHeatmap.js +8 -7
- package/esm/internal/components/pluggableVisualizations/lineChart/PluggableLineChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/lineChart/PluggableLineChart.js +8 -8
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.js +11 -11
- package/esm/internal/components/pluggableVisualizations/pieChart/PluggablePieChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pieChart/PluggablePieChart.js +8 -8
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.js +5 -5
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableAdditionalFactories.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableAdditionalFactories.js +2 -2
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableConfigFromInsight.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableConfigFromInsight.js +6 -6
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.js +4 -5
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextAdditionalFactories.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextAdditionalFactories.js +2 -2
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/sortHelpers.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/sortHelpers.js +2 -2
- package/esm/internal/components/pluggableVisualizations/radarChart/PluggableRadarChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/radarChart/PluggableRadarChart.js +4 -4
- package/esm/internal/components/pluggableVisualizations/repeater/PluggableRepeater.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/repeater/PluggableRepeater.js +6 -7
- package/esm/internal/components/pluggableVisualizations/sankeyChart/PluggableSankeyChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/sankeyChart/PluggableSankeyChart.js +3 -4
- package/esm/internal/components/pluggableVisualizations/scatterPlot/PluggableScatterPlot.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/scatterPlot/PluggableScatterPlot.js +5 -6
- package/esm/internal/components/pluggableVisualizations/treeMap/PluggableTreemap.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/treeMap/PluggableTreemap.js +6 -5
- package/esm/internal/components/pluggableVisualizations/waterfallChart/PluggableWaterfallChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/waterfallChart/PluggableWaterfallChart.js +11 -11
- package/esm/internal/components/pluggableVisualizations/xirr/PluggableXirr.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/xirr/PluggableXirr.js +2 -3
- package/esm/internal/interfaces/Visualization.d.ts.map +1 -1
- package/esm/internal/interfaces/Visualization.js +6 -6
- package/esm/internal/translations/en-US.localization-bundle.d.ts +28 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +29 -1
- package/esm/internal/translations/fr-CA.localization-bundle.js +1 -1
- package/esm/internal/translations/it-IT.localization-bundle.js +2 -2
- package/esm/internal/translations/ru-RU.localization-bundle.js +1 -1
- package/esm/internal/translations/tr-TR.localization-bundle.js +1 -1
- package/esm/internal/translations/zh-Hant.localization-bundle.js +4 -4
- package/esm/internal/utils/bucketConfig.d.ts.map +1 -1
- package/esm/internal/utils/bucketConfig.js +5 -5
- package/esm/internal/utils/bucketHelper.d.ts.map +1 -1
- package/esm/internal/utils/bucketHelper.js +15 -14
- package/esm/internal/utils/bucketRules.d.ts.map +1 -1
- package/esm/internal/utils/bucketRules.js +3 -2
- package/esm/internal/utils/colors.d.ts.map +1 -1
- package/esm/internal/utils/colors.js +11 -11
- package/esm/internal/utils/controlsHelper.d.ts.map +1 -1
- package/esm/internal/utils/controlsHelper.js +7 -7
- package/esm/internal/utils/dimensions.d.ts.map +1 -1
- package/esm/internal/utils/dimensions.js +4 -4
- package/esm/internal/utils/drillablePredicates.d.ts.map +1 -1
- package/esm/internal/utils/drillablePredicates.js +4 -4
- package/esm/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.d.ts.map +1 -1
- package/esm/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.js +11 -11
- package/esm/internal/utils/propertiesHelper.d.ts.map +1 -1
- package/esm/internal/utils/propertiesHelper.js +16 -15
- package/esm/internal/utils/removeUseless.js +3 -3
- package/esm/internal/utils/sort.d.ts.map +1 -1
- package/esm/internal/utils/sort.js +9 -8
- package/esm/internal/utils/translations.d.ts.map +1 -1
- package/esm/internal/utils/translations.js +2 -3
- package/esm/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.js +19 -19
- package/esm/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.js +2 -2
- package/esm/internal/utils/uiConfigHelpers/columnBarChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/columnBarChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelperDeprecated.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelperDeprecated.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/dependencyWheelChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/donutChartUiConfigHelper.js +5 -5
- package/esm/internal/utils/uiConfigHelpers/funnelChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/funnelChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/geoAreaChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/geoAreaChartUiConfigHelper.js +3 -3
- package/esm/internal/utils/uiConfigHelpers/geoPushpinChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/geoPushpinChartUiConfigHelper.js +15 -15
- package/esm/internal/utils/uiConfigHelpers/headlineUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/headlineUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/heatmapUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/heatmapUiConfigHelper.js +7 -7
- package/esm/internal/utils/uiConfigHelpers/lineChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/lineChartUiConfigHelper.js +13 -13
- package/esm/internal/utils/uiConfigHelpers/mekkoUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/mekkoUiConfigHelper.js +7 -7
- package/esm/internal/utils/uiConfigHelpers/pieChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pieChartUiConfigHelper.js +12 -12
- package/esm/internal/utils/uiConfigHelpers/pivotTableNextUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pivotTableNextUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/pivotTableUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pivotTableUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/pyramidChartUiConfigHelper.js +5 -5
- package/esm/internal/utils/uiConfigHelpers/radarChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/radarChartUiConfigHelper.js +13 -13
- package/esm/internal/utils/uiConfigHelpers/repeaterUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/repeaterUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/sankeyChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/sankeyChartUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/scatterPlotUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/scatterPlotUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/treemapUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/treemapUiConfigHelper.js +12 -12
- package/esm/internal/utils/uiConfigHelpers/waterfallChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/waterfallChartUiConfigHelper.js +11 -11
- package/esm/internal/utils/uiConfigHelpers/xirrUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/xirrUiConfigHelper.js +5 -5
- package/esm/notificationsPanel/Notification/Notification.d.ts.map +1 -1
- package/esm/notificationsPanel/Notification/Notification.js +4 -4
- package/esm/sdk-ui-ext.d.ts +1 -1
- package/esm/share/ObjectShareDialog.d.ts +1 -1
- package/esm/share/ObjectShareDialog.js +3 -3
- package/esm/share/messages.d.ts +28 -0
- package/esm/share/messages.d.ts.map +1 -1
- package/esm/share/messages.js +14 -0
- package/esm/share/removeAccessConfirm.d.ts +21 -0
- package/esm/share/removeAccessConfirm.d.ts.map +1 -0
- package/esm/share/removeAccessConfirm.js +27 -0
- package/esm/share/useObjectShareDialog.d.ts +14 -11
- package/esm/share/useObjectShareDialog.d.ts.map +1 -1
- package/esm/share/useObjectShareDialog.js +54 -24
- package/package.json +21 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { set } from "lodash-es";
|
|
3
2
|
import { bucketItems, bucketsFind, insightBuckets, insightProperties, } from "@gooddata/sdk-model";
|
|
4
3
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
4
|
+
import { _set } from "@gooddata/util";
|
|
5
5
|
import { messages } from "../../locales.js";
|
|
6
6
|
import { getMeasureGroupDimensionFromProperties } from "./propertiesHelper.js";
|
|
7
7
|
import { getTranslation } from "./translations.js";
|
|
@@ -31,7 +31,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
31
31
|
const maxNumberValue = fixEmptyMaxValue(maxValue);
|
|
32
32
|
const maxIsMinus = maxValue === "-";
|
|
33
33
|
const { propertiesMeta, pushData } = props;
|
|
34
|
-
|
|
34
|
+
_set(propertiesMeta, "undoApplied", false);
|
|
35
35
|
// dash, non-numeric or min/max mismatch: set error
|
|
36
36
|
if (isInvalidOrMinMaxError(maxValue, minNumberValue, maxNumberValue)) {
|
|
37
37
|
setState({
|
|
@@ -52,7 +52,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
52
52
|
// valid, set new value
|
|
53
53
|
const { properties } = props;
|
|
54
54
|
if (properties) {
|
|
55
|
-
|
|
55
|
+
_set(properties, `controls.${basePath}.max`, maxValue);
|
|
56
56
|
}
|
|
57
57
|
// if incorrect value was set previously but now validation passed, set incorrect value as correct value
|
|
58
58
|
if (isNaN(parseFloat(incorrectMinValue))) {
|
|
@@ -62,7 +62,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
if (properties) {
|
|
65
|
-
|
|
65
|
+
_set(properties, `controls.${basePath}.min`, incorrectMinValue);
|
|
66
66
|
}
|
|
67
67
|
setState(defaultState);
|
|
68
68
|
}
|
|
@@ -80,7 +80,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
80
80
|
const minNumberValue = fixEmptyMinValue(minValue);
|
|
81
81
|
const minIsDash = minValue === "-";
|
|
82
82
|
const { propertiesMeta, pushData } = props;
|
|
83
|
-
|
|
83
|
+
_set(propertiesMeta, "undoApplied", false);
|
|
84
84
|
// dash, non-numeric or min/max mismatch: set error
|
|
85
85
|
if (isInvalidOrMinMaxError(minValue, minNumberValue, maxNumberValue)) {
|
|
86
86
|
setState({
|
|
@@ -101,7 +101,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
101
101
|
// valid, set new value
|
|
102
102
|
const { properties } = props;
|
|
103
103
|
if (properties) {
|
|
104
|
-
|
|
104
|
+
_set(properties, `controls.${basePath}.min`, minValue);
|
|
105
105
|
}
|
|
106
106
|
// if incorrect value was set previously but now validation passed, set incorrect value as correct value
|
|
107
107
|
if (isNaN(parseFloat(incorrectMaxValue))) {
|
|
@@ -111,7 +111,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
113
|
if (properties) {
|
|
114
|
-
|
|
114
|
+
_set(properties, `controls.${basePath}.max`, incorrectMaxValue);
|
|
115
115
|
}
|
|
116
116
|
setState(defaultState);
|
|
117
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/dimensions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/dimensions.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,UAAU,EACf,KAAK,kBAAkB,EAS1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,KAAK,OAAO,EAAsB,MAAM,kBAAkB,CAAC;AA4BjF,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,kBAAkB,EAC3B,yBAAyB,CAAC,EAAE,GAAG,GAChC,UAAU,EAAE,CAMd;AAwCD,wBAAgB,sBAAsB,IAAI,UAAU,EAAE,CAErD;AAmCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,OAAO,EACb,yBAAyB,CAAC,EAAE,GAAG,GAChC,UAAU,EAAE,CAiDd;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,EAAE,CAKnF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
|
-
import { compact } from "lodash-es";
|
|
3
2
|
import { MeasureGroupIdentifier, bucketAttributes, insightAttributes, insightBucket, insightBuckets, insightProperties, newDimension, newTwoDimensional, } from "@gooddata/sdk-model";
|
|
4
3
|
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
5
4
|
import { getPivotTableDimensions as getPivotTableDimensionsShared, } from "@gooddata/sdk-ui-pivot";
|
|
5
|
+
import { _compact } from "@gooddata/util";
|
|
6
6
|
import { getMeasureGroupDimensionFromProperties } from "./propertiesHelper.js";
|
|
7
7
|
const COLUMNS = "columns";
|
|
8
8
|
const ROWS = "rows";
|
|
@@ -41,8 +41,8 @@ function getAreaDimensions(insight) {
|
|
|
41
41
|
const seriesAttribute = viewByAttributes[0];
|
|
42
42
|
const sliceAttribute = stackByAttributes[0] ?? viewByAttributes[1];
|
|
43
43
|
return sliceAttribute
|
|
44
|
-
? newTwoDimensional([sliceAttribute],
|
|
45
|
-
: newTwoDimensional([MeasureGroupIdentifier],
|
|
44
|
+
? newTwoDimensional([sliceAttribute], _compact([seriesAttribute, MeasureGroupIdentifier]))
|
|
45
|
+
: newTwoDimensional([MeasureGroupIdentifier], _compact([seriesAttribute]));
|
|
46
46
|
}
|
|
47
47
|
function getLineDimensions(insight) {
|
|
48
48
|
const trendAttributes = safeBucketAttributes(insight, BucketNames.TREND);
|
|
@@ -75,7 +75,7 @@ function getBubbleDimensions(insight) {
|
|
|
75
75
|
function getSankeyDimensions(insight) {
|
|
76
76
|
const fromAttributes = safeBucketAttributes(insight, BucketNames.ATTRIBUTE_FROM);
|
|
77
77
|
const toAttributes = safeBucketAttributes(insight, BucketNames.ATTRIBUTE_TO);
|
|
78
|
-
return newTwoDimensional([MeasureGroupIdentifier],
|
|
78
|
+
return newTwoDimensional([MeasureGroupIdentifier], _compact([...fromAttributes, ...toAttributes]));
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Generates dimensions based on buckets and visualization objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,0BAA0B,EAGlC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiB3E;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,EACpD,IAAI,EACJ,WAAW,EACX,YAAY,GACf,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CAsBjD;AAED,eAAO,MAAM,wBAAwB;;CAEpC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { uniq, uniqBy } from "lodash-es";
|
|
3
2
|
import { HeaderPredicates } from "@gooddata/sdk-ui";
|
|
3
|
+
import { _uniq, _uniqBy } from "@gooddata/util";
|
|
4
4
|
const toQualifier = (identifier) => typeof identifier === "string" ? { identifier } : identifier;
|
|
5
5
|
/**
|
|
6
6
|
* An untyped entry stays distinct from the same identifier typed, and two types of one identifier stay
|
|
7
7
|
* distinct from each other, because each activates drilling on a different object.
|
|
8
8
|
*/
|
|
9
9
|
const uniqueQualifiers = (identifiers) => Array.isArray(identifiers)
|
|
10
|
-
?
|
|
10
|
+
? _uniqBy(identifiers.map(toQualifier), ({ identifier, type }) => `${type ?? ""}.${identifier}`)
|
|
11
11
|
: [];
|
|
12
12
|
/**
|
|
13
13
|
* Converts post message with drilling specification into header predicates. Given the message with
|
|
@@ -21,9 +21,9 @@ const uniqueQualifiers = (identifiers) => Array.isArray(identifiers)
|
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
23
|
export function convertPostMessageToDrillablePredicates({ uris, identifiers, composedFrom, }) {
|
|
24
|
-
const simpleUris = Array.isArray(uris) ?
|
|
24
|
+
const simpleUris = Array.isArray(uris) ? _uniq(uris) : [];
|
|
25
25
|
const simpleIdentifiers = uniqueQualifiers(identifiers);
|
|
26
|
-
const composedFromUris = composedFrom?.uris && Array.isArray(composedFrom.uris) ?
|
|
26
|
+
const composedFromUris = composedFrom?.uris && Array.isArray(composedFrom.uris) ? _uniq(composedFrom.uris) : [];
|
|
27
27
|
const composedFromIdentifiers = uniqueQualifiers(composedFrom?.identifiers);
|
|
28
28
|
// note: not passing factory function to maps to make testing assertions simpler (passing factory fun-as-is
|
|
29
29
|
// will call the factory with 3 args (value, index and all values)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReactEmbeddingCodeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getReactEmbeddingCodeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGxF,OAAO,EAEH,KAAK,oCAAoC,EAI5C,MAAM,YAAY,CAAC;AA0JpB;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,SAAS,MAAM,EAAE,EAClE,SAAS,EACT,cAAc,EACd,mBAAmB,GACtB,EAAE,oCAAoC,CAAC,MAAM,CAAC,GAAG,CAC9C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,CAAC,EAAE,oBAAoB,KAC5B,MAAM,CA4BV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { compact, groupBy, isEmpty, partition, sortBy, uniqBy } from "lodash-es";
|
|
3
2
|
import { factoryNotationFor } from "@gooddata/sdk-model";
|
|
3
|
+
import { _compact, _groupBy, _isEmpty, _partition, _sortBy, _uniqBy } from "@gooddata/util";
|
|
4
4
|
import { normalizeInsight } from "./normalizeInsight.js";
|
|
5
5
|
// these are in line with what `factoryNotationFor` supports
|
|
6
6
|
const defaultFactories = [
|
|
@@ -59,15 +59,15 @@ function indent(str, tabs) {
|
|
|
59
59
|
.map((chunk) => `${" ".repeat(tabs * TAB_SIZE)}${chunk}`)
|
|
60
60
|
.join("\n");
|
|
61
61
|
}
|
|
62
|
-
const renderImports = (imports) => Object.entries(
|
|
62
|
+
const renderImports = (imports) => Object.entries(_groupBy(imports, (i) => i.package))
|
|
63
63
|
.map(([pkg, imports]) => {
|
|
64
|
-
const [[defaultImport], namedImports] =
|
|
65
|
-
return
|
|
64
|
+
const [[defaultImport], namedImports] = _partition(imports, (i) => i.importType === "default");
|
|
65
|
+
return _compact([
|
|
66
66
|
"import",
|
|
67
|
-
|
|
67
|
+
_compact([
|
|
68
68
|
defaultImport?.name,
|
|
69
69
|
namedImports.length &&
|
|
70
|
-
`{ ${
|
|
70
|
+
`{ ${_sortBy(namedImports.map((i) => i.name), (i) => i.toLowerCase()).join(", ")} }`,
|
|
71
71
|
]).join(", "),
|
|
72
72
|
"from",
|
|
73
73
|
`"${pkg}";`,
|
|
@@ -80,11 +80,11 @@ function walkProps(props, additionalFactories, config) {
|
|
|
80
80
|
const propsToOmit = config?.omitChartProps ?? [];
|
|
81
81
|
const importsUsed = [];
|
|
82
82
|
// we ignore undefined values and functions as there is no bullet-proof way to serialize them
|
|
83
|
-
// Note:
|
|
84
|
-
// Non-empty strings are handled correctly by
|
|
83
|
+
// Note: _isEmpty() returns true for primitive values like numbers/booleans, so we check for them explicitly
|
|
84
|
+
// Non-empty strings are handled correctly by _isEmpty(), but we explicitly check to be safe
|
|
85
85
|
const propPairsIgnoredFunctions = Object.entries(props).filter(([_, meta]) => meta !== undefined &&
|
|
86
86
|
!(typeof meta.value === "function") &&
|
|
87
|
-
(typeof meta.value === "number" || typeof meta.value === "boolean" || !
|
|
87
|
+
(typeof meta.value === "number" || typeof meta.value === "boolean" || !_isEmpty(meta.value)));
|
|
88
88
|
//omit chart configuration when define in config
|
|
89
89
|
const propPairs = propPairsIgnoredFunctions.filter(([key, _]) => !propsToOmit.includes(key));
|
|
90
90
|
// get variable declaration for each prop to render outside of the component
|
|
@@ -112,7 +112,7 @@ function walkProps(props, additionalFactories, config) {
|
|
|
112
112
|
const detectedFactories = detectFactoryImports(propDeclarations, additionalFactories ?? []);
|
|
113
113
|
importsUsed.push(...detectedFactories);
|
|
114
114
|
return {
|
|
115
|
-
importsUsed:
|
|
115
|
+
importsUsed: _uniqBy(importsUsed, (i) => `${i.package}#${i.name}`),
|
|
116
116
|
propDeclarations,
|
|
117
117
|
propUsages,
|
|
118
118
|
};
|
|
@@ -132,7 +132,7 @@ export function getReactEmbeddingCodeGenerator({ component, insightToProps, addi
|
|
|
132
132
|
const normalizedInsight = normalizeInsight(insight);
|
|
133
133
|
const props = insightToProps(normalizedInsight, config?.context);
|
|
134
134
|
const { importsUsed, propDeclarations, propUsages } = walkProps(props, additionalFactories, config);
|
|
135
|
-
const imports =
|
|
135
|
+
const imports = _compact([REACT_IMPORT_INFO, ...importsUsed, component]);
|
|
136
136
|
const height = config?.height ?? DEFAULT_HEIGHT;
|
|
137
137
|
const stringifiedHeight = typeof height === "string" ? `"${height}"` : height.toString();
|
|
138
138
|
const componentBody = `<${component.name}\n${indent(propUsages.join("\n"), 1)}\n/>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/propertiesHelper.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,yCAAyC,EACjD,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"propertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/propertiesHelper.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
2
|
// eslint-disable-next-line no-restricted-imports
|
|
3
|
-
import {
|
|
3
|
+
import { get, has } from "lodash-es";
|
|
4
4
|
import { bucketsIsEmpty, insightBuckets, insightProperties, insightVisualizationUrl, } from "@gooddata/sdk-model";
|
|
5
5
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
6
|
+
import { _cloneDeep, _isEmpty, _set } from "@gooddata/util";
|
|
6
7
|
import { AXIS } from "../constants/axis.js";
|
|
7
8
|
import { PROPERTY_CONTROLS } from "../constants/properties.js";
|
|
8
9
|
import { OPTIONAL_STACKING_PROPERTIES } from "../constants/supportedProperties.js";
|
|
9
10
|
import { UICONFIG_AXIS } from "../constants/uiConfig.js";
|
|
10
11
|
import { getAllMeasuresShowOnSecondaryAxis, getItemsCount, getItemsLocalIdentifiers, getMeasureItems, getStackItems, } from "./bucketHelper.js";
|
|
11
12
|
export function getSupportedPropertiesControls(visualizationControlsProperties, supportedPropertiesList) {
|
|
12
|
-
const clonedControls =
|
|
13
|
+
const clonedControls = _cloneDeep(visualizationControlsProperties);
|
|
13
14
|
if (supportedPropertiesList) {
|
|
14
|
-
return supportedPropertiesList.reduce((props, current) => has(clonedControls, current) ?
|
|
15
|
+
return supportedPropertiesList.reduce((props, current) => has(clonedControls, current) ? _set(props, current, get(clonedControls, current)) : props, {});
|
|
15
16
|
}
|
|
16
17
|
return {};
|
|
17
18
|
}
|
|
@@ -22,7 +23,7 @@ export function setSecondaryMeasures(referencePoint, axisName) {
|
|
|
22
23
|
if (!axisName) {
|
|
23
24
|
return referencePoint;
|
|
24
25
|
}
|
|
25
|
-
const newReferencePoint =
|
|
26
|
+
const newReferencePoint = _cloneDeep(referencePoint);
|
|
26
27
|
const path = `${PROPERTY_CONTROLS}.${axisName}`;
|
|
27
28
|
const secondaryAxisProperties = newReferencePoint?.properties?.controls?.[axisName];
|
|
28
29
|
const buckets = newReferencePoint?.buckets ?? [];
|
|
@@ -39,8 +40,8 @@ export function setSecondaryMeasures(referencePoint, axisName) {
|
|
|
39
40
|
0: AXIS.PRIMARY,
|
|
40
41
|
[allMeasures.length]: AXIS.SECONDARY,
|
|
41
42
|
}[secondaryMeasures.length] || AXIS.DUAL;
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
_set(newReferencePoint, path, secondaryAxis);
|
|
44
|
+
_set(newReferencePoint, UICONFIG_AXIS, axis);
|
|
44
45
|
return newReferencePoint;
|
|
45
46
|
}
|
|
46
47
|
export function isEmptyObject(obj) {
|
|
@@ -49,7 +50,7 @@ export function isEmptyObject(obj) {
|
|
|
49
50
|
export function getSupportedProperties(visualizationProperties, supportedPropertiesList) {
|
|
50
51
|
const controls = visualizationProperties?.controls ?? {};
|
|
51
52
|
const supportedControls = getSupportedPropertiesControls(controls, supportedPropertiesList);
|
|
52
|
-
return
|
|
53
|
+
return _isEmpty(supportedControls)
|
|
53
54
|
? {}
|
|
54
55
|
: {
|
|
55
56
|
controls: supportedControls,
|
|
@@ -59,9 +60,9 @@ export function getReferencePointWithSupportedProperties(referencePoint, support
|
|
|
59
60
|
const supportedControlsProperties = referencePoint.properties
|
|
60
61
|
? getSupportedPropertiesControls(referencePoint.properties.controls, supportedPropertiesList)
|
|
61
62
|
: {};
|
|
62
|
-
if (
|
|
63
|
+
if (_isEmpty(supportedControlsProperties)) {
|
|
63
64
|
const sortItems = referencePoint.properties?.sortItems;
|
|
64
|
-
const sortItemsExpand = sortItems && !
|
|
65
|
+
const sortItemsExpand = sortItems && !_isEmpty(sortItems) ? { sortItems } : {};
|
|
65
66
|
return {
|
|
66
67
|
...referencePoint,
|
|
67
68
|
properties: {
|
|
@@ -149,7 +150,7 @@ const AXIS_TYPES = ["xaxis", "yaxis", "secondary_xaxis", "secondary_yaxis"];
|
|
|
149
150
|
export function getHighchartsAxisNameConfiguration(controlProperties) {
|
|
150
151
|
const axisProperties = AXIS_TYPES.reduce((result, axis) => {
|
|
151
152
|
const axisNameConfig = controlProperties?.[axis]?.name;
|
|
152
|
-
if (
|
|
153
|
+
if (_isEmpty(axisNameConfig)) {
|
|
153
154
|
return result;
|
|
154
155
|
}
|
|
155
156
|
if (axisNameConfig.position) {
|
|
@@ -254,20 +255,20 @@ export function getColumnHeadersPositionFromProperties(visualizationProperties)
|
|
|
254
255
|
}
|
|
255
256
|
export function getLegendConfiguration(controlProperties, insight) {
|
|
256
257
|
const legendPosition = getLegendPosition(controlProperties, insight);
|
|
257
|
-
|
|
258
|
+
_set(controlProperties, "legend.position", legendPosition);
|
|
258
259
|
return controlProperties;
|
|
259
260
|
}
|
|
260
261
|
export function getLegendConfigurationDashboardsEnv(controlProperties, options) {
|
|
261
262
|
const legendPosition = getLegendPositionDashboardsEnv(controlProperties, options);
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
_set(controlProperties, "legend.position", legendPosition);
|
|
264
|
+
_set(controlProperties, "legend.responsive", "autoPositionWithPopup");
|
|
264
265
|
return controlProperties;
|
|
265
266
|
}
|
|
266
267
|
export function getChartSupportedControls(controlProperties, insight) {
|
|
267
|
-
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfiguration(
|
|
268
|
+
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfiguration(_cloneDeep(controlProperties ?? {}), insight)));
|
|
268
269
|
}
|
|
269
270
|
export function getChartSupportedControlsDashboardsEnv(controlProperties, options) {
|
|
270
|
-
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfigurationDashboardsEnv(
|
|
271
|
+
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfigurationDashboardsEnv(_cloneDeep(controlProperties ?? {}), options)));
|
|
271
272
|
}
|
|
272
273
|
function getLegendPosition(controlProperties, insight) {
|
|
273
274
|
const legendPosition = controlProperties?.["legend"]?.position ?? "auto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { _compact, _isEmpty } from "@gooddata/util";
|
|
3
3
|
function isUseless(obj) {
|
|
4
|
-
return obj === null || obj === undefined || (typeof obj === "object" &&
|
|
4
|
+
return obj === null || obj === undefined || (typeof obj === "object" && _isEmpty(obj));
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* For a given object returns a copy that has all properties that are empty objects or arrays or nil removed.
|
|
@@ -13,7 +13,7 @@ function isUseless(obj) {
|
|
|
13
13
|
export function removeUseless(obj) {
|
|
14
14
|
let res = obj;
|
|
15
15
|
if (Array.isArray(obj)) {
|
|
16
|
-
res =
|
|
16
|
+
res = _compact(obj.map(removeUseless));
|
|
17
17
|
}
|
|
18
18
|
else if (obj !== null && typeof obj === "object") {
|
|
19
19
|
res = Object.fromEntries(Object.entries(obj)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/sort.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,aAAa,EAerB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/sort.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,aAAa,EAerB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAChC,MAAM,gCAAgC,CAAC;AAIxC,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,GAAE,aAAqB,EAChC,WAAW,GAAE,OAAe,GAC7B,SAAS,CAcX;AAqCD,wBAAgB,gCAAgC,CAC5C,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,SAAS,EAAE,OAAO,GAAG,SAAS,EAC9B,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,GACjC,SAAS,EAAE,CAYb;AAwCD;;;GAGG;AAEH,wBAAgB,WAAW,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,EAAE,wBAAwB,GAC5C,SAAS,EAAE,CAuBb;AAmBD,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAO1F;AAED,wBAAgB,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,uBAAuB,CAiBrG;AAoGD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAC/B,sBAAsB,GAAE,oBAAoB,EAAO,EACnD,YAAY,GAAE,SAAS,EAAO,EAC9B,cAAc,GAAE,oBAAoB,EAAO,EAC3C,WAAW,GAAE,SAAS,EAAO,GAC9B,SAAS,EAAE,CA8Bb;AAED,wBAAgB,gCAAgC,CAC5C,gBAAgB,EAAE,WAAW,EAAE,EAC/B,kBAAkB,EAAE,WAAW,EAAE,EACjC,IAAI,EAAE,SAAS,GAChB,MAAM,GAAG,SAAS,CAUpB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { omitBy } from "lodash-es";
|
|
3
3
|
import { areObjRefsEqual, bucketAttributes, insightBucket, insightMeasures, insightSorts, isAttributeAreaSort, isAttributeValueSort, isMeasureSort, newAttributeAreaSort, newAttributeSort, newMeasureSort, newMeasureSortFromLocators, sortDirection, sortMeasureLocators, } from "@gooddata/sdk-model";
|
|
4
4
|
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
5
|
+
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
5
6
|
import { messages } from "../../locales.js";
|
|
6
7
|
import { SORT_DIR_DESC } from "../constants/sort.js";
|
|
7
8
|
import { getTranslation } from "./translations.js";
|
|
@@ -37,18 +38,18 @@ function getDefaultBarChartSort(insight, canSortStackTotalValue = false) {
|
|
|
37
38
|
newAttributeAreaSort(viewBy[1], SORT_DIR_DESC),
|
|
38
39
|
];
|
|
39
40
|
}
|
|
40
|
-
if (!
|
|
41
|
+
if (!_isEmpty(viewBy) && !_isEmpty(stackBy)) {
|
|
41
42
|
return [newAttributeAreaSort(viewBy[0], SORT_DIR_DESC)];
|
|
42
43
|
}
|
|
43
|
-
if (!
|
|
44
|
+
if (!_isEmpty(viewBy) && canSortStackTotalValue) {
|
|
44
45
|
return [newAttributeAreaSort(viewBy[0], SORT_DIR_DESC)];
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return _isEmpty(stackBy) && !_isEmpty(measures) ? [newMeasureSort(measures[0], SORT_DIR_DESC)] : [];
|
|
47
48
|
}
|
|
48
49
|
export function getDefaultTreemapSortFromBuckets(viewBy, segmentBy, measures) {
|
|
49
50
|
const viewAttr = viewBy ? bucketAttributes(viewBy) : [];
|
|
50
51
|
const stackAttr = segmentBy ? bucketAttributes(segmentBy) : [];
|
|
51
|
-
if (!
|
|
52
|
+
if (!_isEmpty(viewAttr) && !_isEmpty(stackAttr)) {
|
|
52
53
|
return [
|
|
53
54
|
newAttributeSort(viewAttr[0], "asc"),
|
|
54
55
|
...(measures ?? []).map((m) => newMeasureSort(m, "desc")),
|
|
@@ -61,7 +62,7 @@ function getDefaultTreemapSort(insight) {
|
|
|
61
62
|
}
|
|
62
63
|
function getDefaultHeatmapSortFromBuckets(viewBy) {
|
|
63
64
|
const viewAttr = viewBy ? bucketAttributes(viewBy) : [];
|
|
64
|
-
if (!
|
|
65
|
+
if (!_isEmpty(viewAttr)) {
|
|
65
66
|
return [newAttributeSort(viewAttr[0], "desc")];
|
|
66
67
|
}
|
|
67
68
|
return [];
|
|
@@ -77,7 +78,7 @@ function getDefaultPieDonutPyramidFunnelSort(insight) {
|
|
|
77
78
|
const measures = insightMeasures(insight);
|
|
78
79
|
const viewBucket = insightBucket(insight, BucketNames.VIEW);
|
|
79
80
|
const viewBy = viewBucket ? bucketAttributes(viewBucket) : [];
|
|
80
|
-
if (!
|
|
81
|
+
if (!_isEmpty(measures) && !_isEmpty(viewBy)) {
|
|
81
82
|
return [newMeasureSort(measures[0], SORT_DIR_DESC)];
|
|
82
83
|
}
|
|
83
84
|
return [];
|
|
@@ -145,7 +146,7 @@ export function removeSort(referencePoint) {
|
|
|
145
146
|
}
|
|
146
147
|
function validateMeasureSortLocators(sortLocators, availableLocators) {
|
|
147
148
|
return (sortLocators.length === availableLocators.length &&
|
|
148
|
-
sortLocators.every((sortLocator, locatorIndex) =>
|
|
149
|
+
sortLocators.every((sortLocator, locatorIndex) => _isEqual(sortLocator, availableLocators[locatorIndex])));
|
|
149
150
|
}
|
|
150
151
|
function isValidMeasureSort(measureSort, availableSort) {
|
|
151
152
|
return (availableSort &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/translations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAEH,KAAK,aAAa,EAErB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAgB,cAAc,CAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,IAAI,CAAC,EAAE,SAAS,EAChB,MAAM,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,GACvC,MAAM,CAKR;AAED,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,aAAa,EAAE,CAM3G;AAQD;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAyDxC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAqC,CAAC;AAE7G,eAAO,MAAM,gBAAgB;;;;CAK5B,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { memoize } from "lodash-es";
|
|
3
2
|
import { DEFAULT_MESSAGES as DEFAULT_MESSAGES_SDK_UI, resolveMessages as sdkUiresolveMessages, } from "@gooddata/sdk-ui";
|
|
4
|
-
import { removeMetadata } from "@gooddata/util";
|
|
3
|
+
import { _memoize, removeMetadata } from "@gooddata/util";
|
|
5
4
|
export function getTranslation(translationId, intl, values = {}) {
|
|
6
5
|
if (!translationId) {
|
|
7
6
|
return "";
|
|
@@ -80,7 +79,7 @@ const resolveMessagesInternal = async (locale) => {
|
|
|
80
79
|
*
|
|
81
80
|
* @internal
|
|
82
81
|
*/
|
|
83
|
-
export const resolveMessages =
|
|
82
|
+
export const resolveMessages = _memoize(resolveMessagesInternal);
|
|
84
83
|
export const DEFAULT_MESSAGES = {
|
|
85
84
|
[DEFAULT_LANGUAGE]: {
|
|
86
85
|
...DEFAULT_OWN_MESSAGES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"areaChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"areaChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,OAAO,EAGH,KAAK,uBAAuB,EAE/B,MAAM,mCAAmC,CAAC;AAiE3C,wBAAgB,oBAAoB,CAChC,cAAc,EAAE,uBAAuB,EACvC,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CAuCzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { cloneDeep, set } from "lodash-es";
|
|
3
2
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
3
|
+
import { _cloneDeep, _set } from "@gooddata/util";
|
|
4
4
|
import { messages } from "../../../locales.js";
|
|
5
5
|
import { ATTRIBUTE, BUCKETS, DATE } from "../../constants/bucket.js";
|
|
6
6
|
import { UICONFIG } from "../../constants/uiConfig.js";
|
|
@@ -45,11 +45,11 @@ function setAreaChartBucketWarningMessages(referencePoint, messageConfig) {
|
|
|
45
45
|
if (!uiConfig) {
|
|
46
46
|
return uiConfig;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return _set(uiConfig, [BUCKETS, localIdentifier, "warningMessage"], warningMessage);
|
|
49
49
|
}, updatedUiConfig);
|
|
50
50
|
}
|
|
51
51
|
export function setAreaChartUiConfig(referencePoint, intl, visualizationType) {
|
|
52
|
-
const referencePointConfigured =
|
|
52
|
+
const referencePointConfigured = _cloneDeep(referencePoint);
|
|
53
53
|
const buckets = referencePointConfigured?.buckets ?? [];
|
|
54
54
|
const categoriesCount = getItemsCount(buckets, BucketNames.VIEW);
|
|
55
55
|
const stackItems = getStackItems(buckets, [ATTRIBUTE, DATE]);
|
|
@@ -64,13 +64,13 @@ export function setAreaChartUiConfig(referencePoint, intl, visualizationType) {
|
|
|
64
64
|
[BucketNames.VIEW]: getWarningMessageForViewByBucket(intl, measuresCount, stackItems),
|
|
65
65
|
[BucketNames.STACK]: getWarningMessageForStackByBucket(intl, categoriesCount),
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
_set(referencePointConfigured, UICONFIG, setBucketTitles(referencePoint, visualizationType, intl));
|
|
68
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.MEASURES, "canAddItems"], canAddMeasuresItems);
|
|
69
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.VIEW, "canAddItems"], canAddViewItems);
|
|
70
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.STACK, "canAddItems"], canAddStackItems);
|
|
71
71
|
setAreaChartBucketWarningMessages(referencePointConfigured, messageConfig);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.MEASURES, "icon"], areaMeasuresIcon);
|
|
73
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.VIEW, "icon"], areaViewIcon);
|
|
74
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.STACK, "icon"], areaStackIcon);
|
|
75
75
|
return referencePointConfigured;
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,OAAO,EACH,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAE/B,MAAM,mCAAmC,CAAC;AA8D3C,wBAAgB,oBAAoB,CAChC,cAAc,EAAE,uBAAuB,EACvC,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CAwDzB;AAED,wBAAgB,mCAAmC,CAC/C,cAAc,EAAE,uBAAuB,EACvC,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CAoBzB;AAgBD,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,WAAW,EAAE,GAC3B,MAAM,CAMR"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { cloneDeep, set } from "lodash-es";
|
|
3
2
|
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
3
|
+
import { _cloneDeep, _set } from "@gooddata/util";
|
|
4
4
|
import { messages } from "../../../locales.js";
|
|
5
5
|
import { ATTRIBUTE, BUCKETS, DATE } from "../../constants/bucket.js";
|
|
6
6
|
import { OPEN_AS_REPORT, RECOMMENDATIONS, SUPPORTED, UICONFIG } from "../../constants/uiConfig.js";
|
|
@@ -19,7 +19,7 @@ const barViewIcon = "local:bar/bucket-title-view.svg";
|
|
|
19
19
|
const barStackIcon = "local:bar/bucket-title-stack.svg";
|
|
20
20
|
function setBaseChartBucketWarningMessages(referencePoint, intl) {
|
|
21
21
|
const buckets = referencePoint?.buckets ?? [];
|
|
22
|
-
const updatedUiConfig =
|
|
22
|
+
const updatedUiConfig = _cloneDeep(referencePoint?.uiConfig);
|
|
23
23
|
const stackItems = getStackItems(buckets, [ATTRIBUTE, DATE]);
|
|
24
24
|
if (!updatedUiConfig) {
|
|
25
25
|
return updatedUiConfig;
|
|
@@ -40,22 +40,22 @@ function setBaseChartBucketWarningMessages(referencePoint, intl) {
|
|
|
40
40
|
warningMessage = getTranslation(messages["categoryStack"].id, intl);
|
|
41
41
|
}
|
|
42
42
|
if (warningMessage) {
|
|
43
|
-
|
|
43
|
+
_set(updatedUiConfig, [BUCKETS, localIdentifier, "warningMessage"], warningMessage);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
return updatedUiConfig;
|
|
48
48
|
}
|
|
49
49
|
export function setBaseChartUiConfig(referencePoint, intl, visualizationType) {
|
|
50
|
-
const referencePointConfigured =
|
|
50
|
+
const referencePointConfigured = _cloneDeep(referencePoint);
|
|
51
51
|
const buckets = referencePointConfigured?.buckets ?? [];
|
|
52
52
|
const measuresCanAddItems = hasNoMeasures(buckets) || hasNoStacksWithDate(buckets);
|
|
53
53
|
const stackCanAddItems = !hasMoreThanOneMasterMeasure(buckets, BucketNames.MEASURES);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
_set(referencePointConfigured, [UICONFIG], setBucketTitles(referencePoint, visualizationType, intl));
|
|
55
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.MEASURES, "canAddItems"], measuresCanAddItems);
|
|
56
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.VIEW, "canAddItems"], true);
|
|
57
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.STACK, "canAddItems"], stackCanAddItems);
|
|
58
|
+
_set(referencePointConfigured, [UICONFIG, OPEN_AS_REPORT, SUPPORTED], !hasColorMapping(referencePointConfigured.properties));
|
|
59
59
|
const iconsMap = {
|
|
60
60
|
column: {
|
|
61
61
|
[BucketNames.MEASURES]: columnMeasuresIcon,
|
|
@@ -68,26 +68,26 @@ export function setBaseChartUiConfig(referencePoint, intl, visualizationType) {
|
|
|
68
68
|
[BucketNames.STACK]: barStackIcon,
|
|
69
69
|
},
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.MEASURES, "icon"], iconsMap[visualizationType]?.[BucketNames.MEASURES]);
|
|
72
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.VIEW, "icon"], iconsMap[visualizationType]?.[BucketNames.VIEW]);
|
|
73
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.STACK, "icon"], iconsMap[visualizationType]?.[BucketNames.STACK]);
|
|
74
|
+
_set(referencePointConfigured, UICONFIG, setBaseChartBucketWarningMessages(referencePointConfigured, intl));
|
|
75
75
|
return referencePointConfigured;
|
|
76
76
|
}
|
|
77
77
|
export function setBaseChartUiConfigRecommendations(referencePoint, visualizationType) {
|
|
78
78
|
if (visualizationType === VisualizationTypes.COLUMN) {
|
|
79
|
-
const newReferencePoint =
|
|
79
|
+
const newReferencePoint = _cloneDeep(referencePoint);
|
|
80
80
|
const buckets = newReferencePoint?.buckets;
|
|
81
81
|
const filters = newReferencePoint?.filters;
|
|
82
82
|
const percentEnabled = percentRecommendationEnabled(buckets, filters);
|
|
83
83
|
const comparisonAndTrending = comparisonAndTrendingRecommendationEnabled(buckets);
|
|
84
84
|
const overTimeComparison = overTimeComparisonRecommendationEnabled(newReferencePoint);
|
|
85
85
|
const previousPeriod = previousPeriodRecommendationEnabled(buckets);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
_set(newReferencePoint, [UICONFIG, RECOMMENDATIONS, "percent"], percentEnabled);
|
|
87
|
+
_set(newReferencePoint, [UICONFIG, RECOMMENDATIONS, "comparison"], comparisonAndTrending);
|
|
88
|
+
_set(newReferencePoint, [UICONFIG, RECOMMENDATIONS, "trending"], comparisonAndTrending);
|
|
89
|
+
_set(newReferencePoint, [UICONFIG, RECOMMENDATIONS, "overTimeComparison"], overTimeComparison);
|
|
90
|
+
_set(newReferencePoint, [UICONFIG, RECOMMENDATIONS, "previousPeriod"], previousPeriod);
|
|
91
91
|
return newReferencePoint;
|
|
92
92
|
}
|
|
93
93
|
return referencePoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbleChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bubbleChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAWjF,wBAAgB,sBAAsB,CAClC,cAAc,EAAE,uBAAuB,EACvC,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CAmBzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// (C) 2019-
|
|
2
|
-
import { cloneDeep, set } from "lodash-es";
|
|
1
|
+
// (C) 2019-2026 GoodData Corporation
|
|
3
2
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
3
|
+
import { _cloneDeep, _set } from "@gooddata/util";
|
|
4
4
|
import { BUCKETS } from "../../constants/bucket.js";
|
|
5
5
|
import { UICONFIG } from "../../constants/uiConfig.js";
|
|
6
6
|
import { setBucketTitles } from "../bucketHelper.js";
|
|
@@ -12,11 +12,11 @@ const bubbleMeasuresYIcon = "local:bubble/bucket-title-measures-y.svg";
|
|
|
12
12
|
const bubbleSizeIcon = "local:bubble/bucket-title-size.svg";
|
|
13
13
|
const bubbleViewByIcon = "local:bubble/bucket-title-view-by.svg";
|
|
14
14
|
export function setBubbleChartUiConfig(referencePoint, intl, visualizationType) {
|
|
15
|
-
const referencePointConfigured =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const referencePointConfigured = _cloneDeep(referencePoint);
|
|
16
|
+
_set(referencePointConfigured, UICONFIG, setBucketTitles(referencePoint, visualizationType, intl));
|
|
17
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.MEASURES, "icon"], bubbleMeasuresXIcon);
|
|
18
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.SECONDARY_MEASURES, "icon"], bubbleMeasuresYIcon);
|
|
19
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.TERTIARY_MEASURES, "icon"], bubbleSizeIcon);
|
|
20
|
+
_set(referencePointConfigured, [UICONFIG, BUCKETS, BucketNames.VIEW, "icon"], bubbleViewByIcon);
|
|
21
21
|
return referencePointConfigured;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulletChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulletChartUiConfigHelper.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAYjF,wBAAgB,sBAAsB,CAClC,cAAc,EAAE,uBAAuB,EACvC,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CA0CzB"}
|