-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ThreatsDataViews: ThreatModal integration (#40202)
- Loading branch information
Showing
26 changed files
with
747 additions
and
313 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ects/js-packages/components/changelog/add-components-threats-data-views-modal-integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Integrates ThreatModal in ThreatsDataViews |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
projects/js-packages/components/components/threat-modal/threat-ignore-details.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { createInterpolateElement } from '@wordpress/element'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { useContext } from 'react'; | ||
import { Text, Button, getRedirectUrl } from '@automattic/jetpack-components'; | ||
import styles from './styles.module.scss'; | ||
import { ThreatModalContext } from '.'; | ||
|
||
const ThreatIgnoreDetails = () => { | ||
const { threat, isSupportedEnvironment } = useContext( ThreatModalContext ); | ||
|
||
if ( ! threat?.status || [ 'ignored', 'fixed' ].includes( threat.status ) ) { | ||
return null; | ||
} | ||
|
||
const codeableURL = getRedirectUrl( 'jetpack-protect-codeable-referral' ); | ||
|
||
return ( | ||
<div className={ styles.section }> | ||
<Text variant="title-small"> | ||
{ __( 'Do you really want to ignore this threat?', 'jetpack-components' ) } | ||
</Text> | ||
<Text> | ||
{ __( | ||
'By choosing to ignore this threat, you acknowledge that you have reviewed the detected code. You are accepting the risks of maintaining a potentially malicious or vulnerable file on your site.', | ||
'jetpack-components' | ||
) }{ ' ' } | ||
{ isSupportedEnvironment && | ||
createInterpolateElement( | ||
__( | ||
'If you are unsure, please request an estimate with <codeableLink>Codeable</codeableLink>.', | ||
'jetpack-components' | ||
), | ||
{ | ||
codeableLink: <Button variant="link" isExternalLink={ true } href={ codeableURL } />, | ||
} | ||
) } | ||
</Text> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ThreatIgnoreDetails; |
Oops, something went wrong.