Skip to content

Commit

Permalink
Update stories and align auto-fix column
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweller committed Oct 21, 2024
1 parent 515fc0f commit be54d44
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ export function DataViewFixerStatus( {
view: View;
} ): JSX.Element {
if ( view.type === 'table' ) {
return <FixerStatusIcon fixer={ fixer } />;
return (
<div className={ styles.threat__fixer }>
<FixerStatusIcon fixer={ fixer } />
</div>
);
}

return <FixerStatusBadge fixer={ fixer } />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,115 @@ Default.args = {
),
};

export const FixerStatuses = args => <ThreatsDataView { ...args } />;
FixerStatuses.args = {
data: [
{
id: 13216959,
signature: 'Vulnerable.WP.Core',
title: 'Vulnerable WordPress Version (6.4.3)',
description: 'This threat has an auto-fixer available. ',
firstDetected: '2024-07-15T21:56:50.000Z',
severity: 4,
fixer: null,
fixedOn: '2024-07-15T22:01:42.000Z',
status: 'fixed',
fixable: { fixer: 'update', target: '6.4.4', extensionStatus: 'inactive' },
version: '6.4.3',
source: '',
},
{
id: 12345678910,
signature: 'Vulnerable.WP.Extension',
title: 'Vulnerable Plugin: Example Plugin (version 1.2.3)',
description: 'This threat has an in-progress auto-fixer.',
firstDetected: '2024-10-02T17:34:59.000Z',
fixedIn: '1.2.4',
fixedOn: null,
severity: 3,
fixable: { fixer: 'update', target: '1.12.4', extensionStatus: 'inactive' },
fixer: { status: 'in_progress', last_updated: new Date().toISOString() },
status: 'current',
filename: null,
context: null,
source: 'https://wpscan.com/vulnerability/733d8a02-0d44-4b78-bbb2-37e447acd2f3',
extension: {
name: 'Example Plugin',
slug: 'example-plugin',
version: '1.2.3',
type: 'plugin',
},
},
{
id: 12345678911,
signature: 'Vulnerable.WP.Extension',
title: 'Vulnerable Theme: Example Theme (version 2.2.2)',
description: 'This threat has an in-progress auto-fixer that is taking too long.',
firstDetected: '2024-10-02T17:34:59.000Z',
fixedIn: '2.22.22',
fixedOn: null,
severity: 3,
fixable: { fixer: 'update', target: '1.12.4', extensionStatus: 'inactive' },
fixer: { status: 'in_progress', last_updated: new Date( '1999-01-01' ).toISOString() },
status: 'current',
filename: null,
context: null,
source: 'https://wpscan.com/vulnerability/733d8a02-0d44-4b78-bbb2-37e447acd2f3',
extension: {
name: 'Example Theme',
slug: 'example-theme',
version: '2.2.2',
type: 'theme',
},
},
{
id: 12345678912,
signature: 'Vulnerable.WP.Extension',
title: 'Vulnerable Theme: Example Theme II (version 3.3.3)',
description: 'This threat has a fixer with an error status.',
firstDetected: '2024-10-02T17:34:59.000Z',
fixedIn: '3.4.5',
fixedOn: null,
severity: 3,
fixable: { fixer: 'update', target: '1.12.4', extensionStatus: 'inactive' },
fixer: { status: 'error', error: 'error' },
status: 'current',
filename: null,
context: null,
source: 'https://wpscan.com/vulnerability/733d8a02-0d44-4b78-bbb2-37e447acd2f3',
extension: {
name: 'Example Theme II',
slug: 'example-theme-2',
version: '3.3.3',
type: 'theme',
},
},
{
id: 185868972,
signature: 'EICAR_AV_Test_Suspicious',
title: 'Malicious code found in file: jptt_eicar.php',
description: 'This threat has no auto-fixer available.',
firstDetected: '2024-10-07T20:40:15.000Z',
fixedIn: null,
fixedOn: null,
severity: 1,
fixable: false,
status: 'current',
filename: '/var/www/html/wp-content/uploads/jptt_eicar.php',
context: {
'6': 'echo <<<HTML',
'7': 'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-SUSPICIOUS-ANTIVIRUS-TEST-FILE!$H+H*',
'8': 'HTML;',
'9': 'echo <<<HTML',
'10': 'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-SUSPICIOUS-ANTIVIRUS-TEST-FILE!$H+H*',
'11': 'HTML;',
marks: {},
},
source: null,
},
],
};

export const FreeResults = args => <ThreatsDataView { ...args } />;
FreeResults.args = {
data: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@
font-size: 12px;
}

.threat__severityHigh {
color: var( --jp-yellow-60 );
}

.threat__severityCritical {
color: var( --jp-red-60 );
.threat__fixer {
min-width: 48px;
text-align: center;
}

0 comments on commit be54d44

Please sign in to comment.