@@ -45,12 +45,12 @@ interface AuditWithStylesProps extends AuditProps {
4545
4646export interface AuditLogData {
4747 id : number
48- data_before : string
49- data_after : string
5048 action : string
5149 actor : string
5250 action_data : {
5351 processed_row_count : number
52+ data_before : Record < string , string > [ ]
53+ data_after : Record < string , string > [ ]
5454 }
5555 created_at : string
5656 table_name : string
@@ -193,9 +193,9 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
193193 }
194194
195195 getChangesTitle = ( r : AuditLogData ) => {
196- const displayedCount = r . data_before
197- ? r . data_before ?. length
198- : r . data_after ?. length
196+ const displayedCount = r . action_data && r . action_data . data_before
197+ ? r . action_data . data_before ?. length
198+ : r . action_data ?. data_after ?. length
199199 const objCount =
200200 r . action_data && r . action_data . processed_row_count
201201 ? r . action_data . processed_row_count
@@ -243,15 +243,6 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
243243 const pageTitle = (
244244 < ConsolePageTitle
245245 title = { auditTitle }
246- filterProps = {
247- logs && logs . length > 0
248- ? {
249- filterValue : this . state . filterValue ,
250- filterHandler : this . filterInputHandler ,
251- placeholder : 'Search audit log' ,
252- }
253- : null
254- }
255246 />
256247 )
257248
@@ -310,7 +301,7 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
310301 < TableRow hover className = { classes ?. row } key = { r . id } >
311302 < TableCell className = { classes ?. cell } >
312303 { this . formatAction ( r ) }
313- { ( r . data_before || r . data_after ) && (
304+ { ( ( r . action_data && r . action_data . data_before ) || ( r . action_data && r . action_data . data_after ) ) && (
314305 < div >
315306 < ExpansionPanel
316307 className = { classes ?. expansionPanel }
@@ -326,7 +317,7 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
326317 < ExpansionPanelDetails
327318 className = { classes ?. expansionPanelDetails }
328319 >
329- { r . data_before && (
320+ { r . action_data && r . action_data . data_before && (
330321 < div className = { classes ?. data } >
331322 { this . getDataSectionTitle ( r , true ) }
332323 < TextField
@@ -335,7 +326,7 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
335326 multiline
336327 fullWidth
337328 value = { JSON . stringify (
338- r . data_before ,
329+ r . action_data . data_before ,
339330 null ,
340331 4 ,
341332 ) }
@@ -347,7 +338,7 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
347338 />
348339 </ div >
349340 ) }
350- { r . data_after && (
341+ { r . action_data && r . action_data . data_after && (
351342 < div className = { classes ?. data } >
352343 { this . getDataSectionTitle ( r , false ) }
353344 < TextField
@@ -356,7 +347,7 @@ class Audit extends Component<AuditWithStylesProps, AuditState> {
356347 multiline
357348 fullWidth
358349 value = { JSON . stringify (
359- r . data_after ,
350+ r . action_data . data_after ,
360351 null ,
361352 4 ,
362353 ) }
0 commit comments