File tree 1 file changed +11
-1
lines changed
frontend/src/routes/Governance/policies
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
16
16
Stack ,
17
17
StackItem ,
18
18
} from '@patternfly/react-core'
19
+ import moment from 'moment'
19
20
import { fitContent } from '@patternfly/react-table'
20
21
import {
21
22
AcmAlert ,
@@ -258,7 +259,10 @@ export default function PoliciesPage() {
258
259
order : 8 ,
259
260
isDefault : false ,
260
261
exportContent : ( item ) => {
261
- return item . source ? item . source : '-'
262
+ const policyAutomationMatch = policyAutomations . find (
263
+ ( pa : PolicyAutomation ) => pa . spec . policyRef === item . policy . metadata . name
264
+ )
265
+ return policyAutomationMatch ?. metadata . name ? policyAutomationMatch ?. metadata . name : '-'
262
266
} ,
263
267
} ,
264
268
{
@@ -269,6 +273,12 @@ export default function PoliciesPage() {
269
273
order : 9 ,
270
274
isDefault : false ,
271
275
isFirstVisitChecked : false ,
276
+ exportContent : ( item ) => {
277
+ if ( item . policy . metadata ?. creationTimestamp ) {
278
+ return moment ( new Date ( item . policy . metadata ?. creationTimestamp ) ) . fromNow ( )
279
+ }
280
+ return '-'
281
+ } ,
272
282
} ,
273
283
{
274
284
header : '' ,
You can’t perform that action at this time.
0 commit comments