-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protect: Separate scanner and history views via React Router and UI adjustments #38325
Merged
nateweller
merged 13 commits into
add/protect-threat-history
from
add/protect-threat-history-routes
Jul 30, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f493b9a
Init feature branch
nateweller d58a7f9
Init feature branch
nateweller ef404d6
Init feature branch
nateweller d7b7c42
Init feature branch
nateweller 037d594
Use react router for threat history, separate scan and history root c…
nateweller 785fff3
changelog
nateweller 86c6ee6
Add dummy args to avoid bad minification
nateweller e125791
Hide scan section navigation when user has no plan
nateweller 34b0acb
Wrap ScanButton with forwardRef
nateweller 59d3f4e
Add onboarding popover to Scan Now button in empty state
nateweller a165fd8
Fix filtering of core threat history
nateweller cd4fdb4
Redirect to /scan from /scan/history when user has no plan
nateweller 71f1191
Fix animation glitch in onboarding popover
nateweller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/protect-models/changelog/add-protect-threat-history
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 | ||
|
||
Add Scan History model. |
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
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
24 changes: 24 additions & 0 deletions
24
projects/plugins/protect/src/js/components/button-group/index.jsx
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,24 @@ | ||
import { Button } from '@automattic/jetpack-components'; | ||
import { ButtonGroup as WordPressButtonGroup } from '@wordpress/components'; | ||
import React from 'react'; | ||
import styles from './styles.module.scss'; | ||
|
||
/** | ||
* Button Group | ||
* | ||
* @param {object} props - Component props. | ||
* @param { React.ReactNode } props.children - Component children. | ||
* | ||
* @returns { React.ReactNode } The Button Group component. | ||
*/ | ||
function ButtonGroup( { children, ...props } ) { | ||
return ( | ||
<WordPressButtonGroup className={ styles[ 'button-group' ] } { ...props }> | ||
{ children } | ||
</WordPressButtonGroup> | ||
); | ||
} | ||
|
||
ButtonGroup.Button = props => <Button { ...props } />; | ||
|
||
export default ButtonGroup; |
18 changes: 18 additions & 0 deletions
18
projects/plugins/protect/src/js/components/button-group/stories/index.stories.jsx
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,18 @@ | ||
/* eslint-disable react/react-in-jsx-scope */ | ||
import { Button } from '@automattic/jetpack-components'; | ||
import React from 'react'; | ||
import ButtonGroup from '../index.jsx'; | ||
|
||
export default { | ||
title: 'Plugins/Protect/Button Group', | ||
component: ButtonGroup, | ||
argTypes: {}, | ||
}; | ||
|
||
const Template = args => ( | ||
<ButtonGroup { ...args }> | ||
<Button>Button 1</Button> | ||
<Button>Button 2</Button> | ||
</ButtonGroup> | ||
); | ||
export const Default = Template.bind( {} ); |
22 changes: 22 additions & 0 deletions
22
projects/plugins/protect/src/js/components/button-group/styles.module.scss
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,22 @@ | ||
.button-group { | ||
:global .components-button { | ||
position: relative; | ||
box-shadow: inset 0 0 0 1.5px var( --jp-gray ); | ||
|
||
&:first-child { | ||
border-radius: var(--jp-border-radius) 0 0 var(--jp-border-radius); | ||
} | ||
|
||
&:last-child { | ||
border-radius: 0 var(--jp-border-radius) var(--jp-border-radius) 0; | ||
} | ||
|
||
&:hover { | ||
z-index: 1; | ||
} | ||
|
||
+ .components-button { | ||
margin-left: -1.5px; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we shouldn't treat this like
refreshStatus
with a hard refresh?