Skip to content

Commit 137f2a8

Browse files
committed
Include fixer action as label in list view action dropdown
1 parent 856479c commit 137f2a8

File tree

1 file changed

+6
-3
lines changed
  • projects/js-packages/components/components/threats-data-views

1 file changed

+6
-3
lines changed

projects/js-packages/components/components/threats-data-views/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getThreatType, type Threat } from '@automattic/jetpack-scan';
1+
import { getFixerAction, getThreatType, type Threat } from '@automattic/jetpack-scan';
22
import {
33
type Action,
44
type ActionButton,
@@ -447,10 +447,12 @@ export default function ThreatsDataViews( {
447447
const actions = useMemo( () => {
448448
const result: Action< Threat >[] = [];
449449

450-
if ( dataFields.includes( 'fixable' ) ) {
450+
if ( dataFields.includes( 'fixable' ) && view.type === 'list' ) {
451451
result.push( {
452452
id: THREAT_ACTION_FIX,
453-
label: __( 'Auto-fix', 'jetpack-components' ),
453+
label: items => {
454+
return getFixerAction( items[ 0 ] );
455+
},
454456
isPrimary: true,
455457
callback: onFixThreats,
456458
isEligible( item ) {
@@ -505,6 +507,7 @@ export default function ThreatsDataViews( {
505507

506508
return result;
507509
}, [
510+
view.type,
508511
dataFields,
509512
onFixThreats,
510513
onIgnoreThreats,

0 commit comments

Comments
 (0)