@@ -6,23 +6,15 @@ import {
66 useActiveNamespace ,
77} from '@openshift-console/dynamic-plugin-sdk' ;
88import { BellIcon } from '@patternfly/react-icons' ;
9- import { Bullseye , DropdownItem , Spinner , Tooltip } from '@patternfly/react-core' ;
10- import { Link , useHistory } from 'react-router-dom' ;
9+ import { Bullseye , Spinner } from '@patternfly/react-core' ;
10+ import { Link } from 'react-router-dom' ;
1111import { AlertResource } from '../utils' ;
12- import KebabDropdown from '../kebab-dropdown' ;
1312import { useTranslation } from 'react-i18next' ;
14- import {
15- getAlertUrl ,
16- getNewSilenceAlertUrl ,
17- getRuleUrl ,
18- usePerspective ,
19- } from '../hooks/usePerspective' ;
20- import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons' ;
13+ import { getRuleUrl , usePerspective } from '../hooks/usePerspective' ;
2114import './incidents-styles.css' ;
2215import { SeverityBadge } from '../alerting/AlertUtils' ;
2316
2417const IncidentsDetailsRowTable = ( { alerts } ) => {
25- const history = useHistory ( ) ;
2618 const [ namespace ] = useActiveNamespace ( ) ;
2719 const { perspective } = usePerspective ( ) ;
2820 const { t } = useTranslation ( process . env . I18N_NAMESPACE ) ;
@@ -50,25 +42,9 @@ const IncidentsDetailsRowTable = ({ alerts }) => {
5042 < Tr key = { rowIndex } >
5143 < Td dataLabel = "expanded-details-alertname" >
5244 < ResourceIcon kind = { AlertResource . kind } />
53- < Link
54- to = {
55- alertDetails . rule . state === 'firing'
56- ? getAlertUrl (
57- perspective ,
58- alertDetails ,
59- alertDetails ?. rule ?. id ,
60- alertDetails ?. labels ?. namespace || namespace ,
61- )
62- : getRuleUrl ( perspective , alertDetails ?. rule , namespace )
63- }
64- >
45+ < Link to = { getRuleUrl ( perspective , alertDetails ?. rule , namespace ) } >
6546 { alertDetails . alertname }
6647 </ Link >
67- { ( ! alertDetails ?. rule || alertDetails . resolved ) && (
68- < Tooltip content = { < div > No details can be shown for inactive alerts.</ div > } >
69- < OutlinedQuestionCircleIcon className = "expanded-details-text-margin" />
70- </ Tooltip >
71- ) }
7248 </ Td >
7349 < Td dataLabel = "expanded-details-namespace" > { alertDetails . namespace || '---' } </ Td >
7450 < Td dataLabel = "expanded-details-severity" >
@@ -97,35 +73,6 @@ const IncidentsDetailsRowTable = ({ alerts }) => {
9773 < Timestamp simple = { true } timestamp = { alertDetails . alertsEndFiring } />
9874 ) }
9975 </ Td >
100- < Td >
101- < KebabDropdown
102- dropdownItems = { [
103- < DropdownItem
104- component = "button"
105- key = "silence alert"
106- isDisabled = { ! alertDetails ?. rule }
107- onClick = { ( ) =>
108- history . push (
109- getNewSilenceAlertUrl ( perspective , alertDetails . rule , namespace ) ,
110- )
111- }
112- >
113- { t ( 'Silence alert' ) }
114- </ DropdownItem > ,
115- < DropdownItem
116- key = "view-rule"
117- isDisabled = { alertDetails ?. alertstate === 'resolved' ? true : false }
118- >
119- < Link
120- to = { getRuleUrl ( perspective , alertDetails ?. rule ) }
121- style = { { color : 'inherit' , textDecoration : 'inherit' } }
122- >
123- { t ( 'View alerting rule' ) }
124- </ Link >
125- </ DropdownItem > ,
126- ] }
127- />
128- </ Td >
12976 </ Tr >
13077 ) ;
13178 } )
0 commit comments