@@ -4,13 +4,13 @@ import { PolicyAutomation, PolicySet } from '../../../resources'
4
4
import { PolicyTableItem } from './Policies'
5
5
import { NavigationPath } from '../../../NavigationPath'
6
6
import { Link } from 'react-router-dom'
7
- import { t } from 'i18next'
8
7
import { PolicySetList } from '../common/util'
9
8
import moment from 'moment'
10
9
import { PolicyActionDropdown } from '../components/PolicyActionDropdown'
11
10
import { AcmButton } from '../../../ui-components/AcmButton'
12
11
import { AutomationDetailsSidebar } from '../components/AutomationDetailsSidebar'
13
12
import { ButtonVariant } from '@patternfly/react-core'
13
+ import { TFunction } from 'react-i18next'
14
14
15
15
export function handleNameCell ( item : PolicyTableItem ) {
16
16
return (
@@ -29,7 +29,7 @@ export function handleNameCell(item: PolicyTableItem) {
29
29
)
30
30
}
31
31
32
- export function handleStatusCell ( item : PolicyTableItem ) {
32
+ export function handleStatusCell ( item : PolicyTableItem , t : TFunction < string , undefined > ) {
33
33
const disabled : string = t ( 'Disabled' )
34
34
const enabled : string = t ( 'Enabled' )
35
35
return < span > { item . policy . spec . disabled === true ? disabled : enabled } </ span >
@@ -58,7 +58,7 @@ export function handleBtnCell(item: PolicyTableItem, setModal: (modal: React.Rea
58
58
return < PolicyActionDropdown setModal = { setModal } item = { item } isKebab = { true } />
59
59
}
60
60
61
- export function handleActionGroupCell ( item : PolicyTableItem ) {
61
+ export function handleActionGroupCell ( item : PolicyTableItem , t : TFunction < string , undefined > ) {
62
62
const disabled : string = t ( 'policy.table.actionGroup.status.disabled' )
63
63
const enabled : string = t ( 'policy.table.actionGroup.status.enabled' )
64
64
return < span > { item . policy . spec . disabled === true ? disabled : enabled } </ span >
@@ -71,7 +71,8 @@ export function handleAutomationCell(
71
71
unauthorizedMessage : string ,
72
72
setDrawerContext : any ,
73
73
setModal : any ,
74
- canCreatePolicyAutomation : boolean
74
+ canCreatePolicyAutomation : boolean ,
75
+ t : TFunction < string , undefined >
75
76
) {
76
77
const policyAutomationMatch = policyAutomations . find (
77
78
( pa : PolicyAutomation ) => pa . spec . policyRef === item . policy . metadata . name
0 commit comments