From 97a8beb3f971768b7341b5d20aae3296889fbd17 Mon Sep 17 00:00:00 2001 From: nitin <142569587+ehconitin@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:35:24 +0530 Subject: [PATCH] on pie chart, slice should not be clickable when in edit mode (#16129) --- .../components/GraphWidgetPieChartRenderer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChartRenderer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChartRenderer.tsx index 059e73a1a7..d2f8b6cf44 100644 --- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChartRenderer.tsx +++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChartRenderer.tsx @@ -1,8 +1,10 @@ +import { isPageLayoutInEditModeComponentState } from '@/page-layout/states/isPageLayoutInEditModeComponentState'; import { ChartSkeletonLoader } from '@/page-layout/widgets/graph/components/ChartSkeletonLoader'; import { GraphWidgetChartHasTooManyGroupsEffect } from '@/page-layout/widgets/graph/components/GraphWidgetChartHasTooManyGroupsEffect'; import { useGraphPieChartWidgetData } from '@/page-layout/widgets/graph/graphWidgetPieChart/hooks/useGraphPieChartWidgetData'; import { type PieChartDataItem } from '@/page-layout/widgets/graph/graphWidgetPieChart/types/PieChartDataItem'; import { buildChartDrilldownQueryParams } from '@/page-layout/widgets/graph/utils/buildChartDrilldownQueryParams'; +import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue'; import { coreIndexViewIdFromObjectMetadataItemFamilySelector } from '@/views/states/selectors/coreIndexViewIdFromObjectMetadataItemFamilySelector'; import { lazy, Suspense } from 'react'; import { useNavigate } from 'react-router-dom'; @@ -44,6 +46,9 @@ export const GraphWidgetPieChartRenderer = ({ const navigate = useNavigate(); const configuration = widget.configuration as PieChartConfiguration; + const isPageLayoutInEditMode = useRecoilComponentValue( + isPageLayoutInEditModeComponentState, + ); const indexViewId = useRecoilValue( coreIndexViewIdFromObjectMetadataItemFamilySelector({ objectMetadataItemId: objectMetadataItem.id, @@ -88,7 +93,7 @@ export const GraphWidgetPieChartRenderer = ({ id={widget.id} showLegend={showLegend} displayType="shortNumber" - onSliceClick={handleSliceClick} + onSliceClick={isPageLayoutInEditMode ? undefined : handleSliceClick} showDataLabels={showDataLabels} showCenterMetric={showCenterMetric} />