@@ -7,6 +7,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
7
7
import { CippPage } from '../../../components'
8
8
import PropTypes from 'prop-types'
9
9
import { faRedo } from '@fortawesome/free-solid-svg-icons'
10
+ import cellGetProperty from '../../../components/cipp/cellGetProperty'
11
+ import { useDispatch } from 'react-redux'
12
+ import { showModal } from '../../../store/features/modal'
10
13
11
14
const columns = [
12
15
{
@@ -35,11 +38,6 @@ const columns = [
35
38
selector : ( row ) => row [ 'Status' ] ,
36
39
sortable : true ,
37
40
} ,
38
- {
39
- name : 'RawResult' ,
40
- selector : ( row ) => row [ 'RawResult' ] ,
41
- sortable : true ,
42
- } ,
43
41
]
44
42
45
43
const AlertBox = ( { value, title, fetching } ) => {
@@ -60,6 +58,7 @@ AlertBox.propTypes = {
60
58
}
61
59
62
60
const ListAlerts = ( ) => {
61
+ const dispatch = useDispatch ( )
63
62
const [ execAlertsList , results ] = useLazyExecAlertsListQuery ( )
64
63
const { data : alerts = { } , isFetching, error } = results
65
64
const {
@@ -76,6 +75,35 @@ const ListAlerts = () => {
76
75
execAlertsList ( )
77
76
} , [ execAlertsList ] )
78
77
78
+ const handleShowModal = ( value ) =>
79
+ dispatch (
80
+ showModal ( {
81
+ title : 'More Information' ,
82
+ body : (
83
+ < div >
84
+ < pre > { JSON . stringify ( value , null , 2 ) } </ pre >
85
+ </ div >
86
+ ) ,
87
+ visible : true ,
88
+ size : 'xl' ,
89
+ } ) ,
90
+ )
91
+
92
+ columns . push ( {
93
+ name : 'RawResult' ,
94
+ selector : ( row ) => row [ 'RawResult' ] ,
95
+ sortable : true ,
96
+ cell : ( row , index , column , id ) => {
97
+ const value = cellGetProperty ( row , index , column , id )
98
+
99
+ return (
100
+ < CButton size = "sm" onClick = { ( ) => handleShowModal ( value ) } >
101
+ More
102
+ </ CButton >
103
+ )
104
+ } ,
105
+ } )
106
+
79
107
return (
80
108
< CippPage tenantSelector = { false } title = "List Alerts" >
81
109
< CCardGroup >
0 commit comments