@@ -129,6 +129,7 @@ export const NeoTableChart = (props: ChartProps) => {
129
129
}
130
130
131
131
const { records } = props ;
132
+ const isApiSpecEnabled = props . settings ?. apiSpec && props . settings ?. apiSpec . apiEnabled ;
132
133
133
134
const generateSafeColumnKey = ( key ) => {
134
135
return key != 'id' ? key : `${ key } ` ;
@@ -346,6 +347,12 @@ export const NeoTableChart = (props: ChartProps) => {
346
347
props . updateReportSetting ( 'apiSpec' , { ...props . settings ?. apiSpec , response : null } ) ;
347
348
} ;
348
349
350
+ useEffect ( ( ) => {
351
+ if ( isApiSpecEnabled ) {
352
+ handleResetApiResponse ( ) ;
353
+ }
354
+ } , [ records ] ) ;
355
+
349
356
const apiCallButton = ( ) => (
350
357
< Stack direction = 'row' spacing = { 2 } justifyContent = 'flex-end' marginRight = { 2 } >
351
358
< Button variant = 'outlined' size = 'small' onClick = { handleApiCall } disabled = { isApiLoading } >
@@ -361,9 +368,6 @@ export const NeoTableChart = (props: ChartProps) => {
361
368
{ isApiLoading ? 'Loading...' : props . settings ?. viewResponseButtonName || 'view response' }
362
369
</ Button >
363
370
) }
364
- < IconButton clean = { true } grouped = { true } aria-label = { 'Reset' } onClick = { handleResetApiResponse } >
365
- < ArrowPathIconOutline aria-label = { 'Reset' } />
366
- </ IconButton >
367
371
{ props . settings ?. apiSpec . response ? (
368
372
< Popover
369
373
id = { id }
@@ -391,8 +395,6 @@ export const NeoTableChart = (props: ChartProps) => {
391
395
</ Stack >
392
396
) ;
393
397
394
- const isApiSpecEnabled = props . settings ?. apiSpec && props . settings ?. apiSpec . apiEnabled ;
395
-
396
398
const tableStyle : any = isApiSpecEnabled
397
399
? { marginTop : 10 , height : '90%' , width : '100%' , position : 'relative' }
398
400
: { height : '100%' , width : '100%' , position : 'relative' } ;
0 commit comments