@@ -272,8 +272,6 @@ function ActiveOnlyHeader({activeOnly, setActiveOnly}) {
272272ActiveOnlyHeader . propTypes = {
273273 activeOnly : PropTypes . bool ,
274274 setActiveOnly : PropTypes . func ,
275- refresh : PropTypes . bool ,
276- setRefresh : PropTypes . func ,
277275} ;
278276
279277function Dashboard ( {
@@ -533,7 +531,7 @@ function Dashboard({
533531 maxSize : 35 ,
534532 minSize : 35 ,
535533 id : 'btn-terminate' ,
536- cell : getTerminateCell ( pgAdmin , sid , did , canTakeAction , setRefresh , ( ) => setRefresh ( ! refresh ) ) ,
534+ cell : getTerminateCell ( pgAdmin , sid , did , canTakeAction , ( ) => setRefresh ( ! refresh ) ) ,
537535 } ,
538536 {
539537 header : ( ) => null ,
@@ -544,7 +542,7 @@ function Dashboard({
544542 maxSize : 35 ,
545543 minSize : 35 ,
546544 id : 'btn-cancel' ,
547- cell : getCancelCell ( pgAdmin , sid , did , canTakeAction , setRefresh , ( ) => setRefresh ( ! refresh ) ) ,
545+ cell : getCancelCell ( pgAdmin , sid , did , canTakeAction , ( ) => setRefresh ( ! refresh ) ) ,
548546 } ,
549547 {
550548 header : ( ) => null ,
@@ -886,7 +884,7 @@ function Dashboard({
886884 type : 'GET' ,
887885 } )
888886 . then ( ( res ) => {
889- if ( res . data && res . data [ 'logs_disabled' ] ) {
887+ if ( res ? .data ?. [ 'logs_disabled' ] ) {
890888 setSsMsg ( gettext ( 'Please enable the logging to view the server logs or check the log file is in place or not.' ) ) ;
891889 } else {
892890 setDashData ( parseData ( res . data ) ) ;
@@ -938,7 +936,7 @@ function Dashboard({
938936 // we want to show 'idle in transaction', 'active', 'active in transaction', and future non-blank, non-"idle" status values
939937 return dashData [ 0 ] [ 'activity' ] ?. filter ( ( r ) => ( r . state && r . state != '' && r . state != 'idle' ) ) ;
940938 }
941- return dashData && dashData [ 0 ] && dashData [ 0 ] [ 'activity' ] || [ ] ;
939+ return dashData ?. [ 0 ] ?. [ 'activity' ] || [ ] ;
942940 } , [ dashData , activeOnly , mainTabVal ] ) ;
943941
944942 const showDefaultContents = ( ) => {
@@ -1089,7 +1087,7 @@ function Dashboard({
10891087 tableNoBorder = { false }
10901088 customHeader = { < ActiveOnlyHeader activeOnly = { activeOnly } setActiveOnly = { setActiveOnly } refresh = { refresh } setRefresh = { setRefresh } /> }
10911089 columns = { activityColumns }
1092- data = { ( dashData !== undefined && dashData [ 0 ] && filteredDashData ) || [ ] }
1090+ data = { ( dashData ?. [ 0 ] && filteredDashData ) || [ ] }
10931091 schema = { activeQSchemaObj }
10941092 > </ PgTable >
10951093 </ SectionContainer >
@@ -1098,15 +1096,15 @@ function Dashboard({
10981096 caveTable = { false }
10991097 tableNoBorder = { false }
11001098 columns = { databaseLocksColumns }
1101- data = { ( dashData !== undefined && dashData [ 0 ] && dashData [ 0 ] [ 'locks' ] ) || [ ] }
1099+ data = { ( dashData ?. [ 0 ] ?. [ 'locks' ] ) || [ ] }
11021100 > </ PgTable >
11031101 </ SectionContainer >
11041102 < SectionContainer title = { gettext ( 'Prepared Transactions' ) } style = { { height : 'auto' , minHeight : '200px' , maxHeight :'400px' , paddingBottom : '20px' } } >
11051103 < PgTable
11061104 caveTable = { false }
11071105 tableNoBorder = { false }
11081106 columns = { databasePreparedColumns }
1109- data = { ( dashData !== undefined && dashData [ 0 ] && dashData [ 0 ] [ 'prepared' ] ) || [ ] }
1107+ data = { ( dashData ?. [ 0 ] ?. [ 'prepared' ] ) || [ ] }
11101108 > </ PgTable >
11111109 </ SectionContainer >
11121110 </ Fragment >
0 commit comments