-
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 scan results and history DataViews #40845
base: add/protect/core
Are you sure you want to change the base?
Protect: Separate scan results and history DataViews #40845
Conversation
#40057) Co-authored-by: Nate Weller <[email protected]>
* Update Scan and History section header structure/content * changelog * Update projects/plugins/protect/src/js/routes/scan/scan-admin-section-hero.tsx Co-authored-by: Nate Weller <[email protected]> --------- Co-authored-by: Nate Weller <[email protected]>
Protect: add HMR support Revert "Protect: add HMR support" This reverts commit 06497a0.
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. 🔴 Action required: Please add missing changelog entries for the following projects: Use the Jetpack CLI tool to generate changelog entries by running the following command: Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Protect plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
}: { | ||
historic?: boolean; |
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.
What do you think about using a const type for this prop, something like type: 'current' | 'historic'
?
Motivation being to keep things flexible for the future.
const selectedValue = location.pathname.includes( '/history' ) ? 'historic' : 'active'; | ||
|
||
const onChange = useCallback( | ||
( value: string ) => { |
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.
( value: string ) => { | |
( value: 'active' | 'historic' ) => { |
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.
(IIRC, the threat status value used is "current", we could potentially use that here for consistency)
Looking good and testing great so far 👍 This PR really bakes-in the boolean "is current or is historic" pattern, which I recognize matches the current implementation plans in Protect, but I think it is possible to achieve the two table integration without adding this specific logic to the The main variation between the two tables is the fields/columns - could we allow the package consumer to specify specific table presets? import ThreatsDataViews, { HISTORIC_TABLE_FIELDS } from '@...';
export const ThreatsHistory = () => {
return <ThreatsDataViews fields={ HISTORIC_TABLE_FIELDS } />;
}; Interested on your take! |
Description
ThreatsDataViews
instance for scan history.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
ThreatsDataViews
storybooks/scan
,/scan/history
,/scan/history/fixed
,/scan/history/ignored
update the UI correctlyScreenshots