File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
projects/js-packages/components/components/threats-data-views Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
- import { getThreatType , type Threat } from '@automattic/jetpack-scan' ;
1
+ import { getFixerAction , getThreatType , type Threat } from '@automattic/jetpack-scan' ;
2
2
import {
3
3
type Action ,
4
4
type ActionButton ,
@@ -447,10 +447,12 @@ export default function ThreatsDataViews( {
447
447
const actions = useMemo ( ( ) => {
448
448
const result : Action < Threat > [ ] = [ ] ;
449
449
450
- if ( dataFields . includes ( 'fixable' ) ) {
450
+ if ( dataFields . includes ( 'fixable' ) && view . type === 'list' ) {
451
451
result . push ( {
452
452
id : THREAT_ACTION_FIX ,
453
- label : __ ( 'Auto-fix' , 'jetpack-components' ) ,
453
+ label : items => {
454
+ return getFixerAction ( items [ 0 ] ) ;
455
+ } ,
454
456
isPrimary : true ,
455
457
callback : onFixThreats ,
456
458
isEligible ( item ) {
@@ -505,6 +507,7 @@ export default function ThreatsDataViews( {
505
507
506
508
return result ;
507
509
} , [
510
+ view . type ,
508
511
dataFields ,
509
512
onFixThreats ,
510
513
onIgnoreThreats ,
You can’t perform that action at this time.
0 commit comments