From 6060e21273817b09aa8415b4ef6617250a06f84c Mon Sep 17 00:00:00 2001 From: Monish Nandakumaran Date: Tue, 5 Nov 2024 10:37:31 +0530 Subject: [PATCH] Fix for automatic reset view rups package link --- src/chart/table/TableChart.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/chart/table/TableChart.tsx b/src/chart/table/TableChart.tsx index b08530736..4b508c202 100644 --- a/src/chart/table/TableChart.tsx +++ b/src/chart/table/TableChart.tsx @@ -129,6 +129,7 @@ export const NeoTableChart = (props: ChartProps) => { } const { records } = props; + const isApiSpecEnabled = props.settings?.apiSpec && props.settings?.apiSpec.apiEnabled; const generateSafeColumnKey = (key) => { return key != 'id' ? key : `${key} `; @@ -346,6 +347,12 @@ export const NeoTableChart = (props: ChartProps) => { props.updateReportSetting('apiSpec', { ...props.settings?.apiSpec, response: null }); }; + useEffect(() => { + if (isApiSpecEnabled) { + handleResetApiResponse(); + } + }, [records]); + const apiCallButton = () => ( )} - - - {props.settings?.apiSpec.response ? ( { ); - const isApiSpecEnabled = props.settings?.apiSpec && props.settings?.apiSpec.apiEnabled; - const tableStyle: any = isApiSpecEnabled ? { marginTop: 10, height: '90%', width: '100%', position: 'relative' } : { height: '100%', width: '100%', position: 'relative' };