-
Notifications
You must be signed in to change notification settings - Fork 843
Protect: Separate scan results and history DataViews #40845
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
Conversation
|
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. |
| onUnignoreThreats, | ||
| header, | ||
| }: { | ||
| 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)
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
It is! I initially chose active as it first came up in the ToggleGroupControl task as Active threats was the toggle text, that then got passed along to keep things the same. Using current makes sense to me, what do think about updating the toggle text to Current threats also?
|
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! |
I like it! I agree with anything that leads to less conditional checks/content in the component as possible - I believe we'll have some similar challenges once we implement the more robust free view (with custom fields in the table and content in the modal), so setting a standard early is a good call! |
61b5561 to
060637b
Compare
060637b to
9e6adfb
Compare
f65e174 to
8960ec6
Compare
nateweller
left a comment
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.
Rebased and made some minor adjustments in additional commits. Looks good to me! 🚀
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
* Init project branch * Protect: Refactor AdminSectionHero (#40516) * Restore history header * Pass status filter presets to consumer * Restore early return * Add plan level restrictions * Init project branch * Protect: Integrate ThreatsDataViews Component (#40076) * Separate scan and history DataViews * Reapply history routes * Add filters * Add toggle group control * Add historic flag * Update stories * Remove unneeded filter handling * Revert unnecessary threats data views updates * Fix import * Include fixer action as label in list view action dropdown * Add field constants * Reorg * Add initialFields prop, update active to current where applicable * Init project branch * Fix exports and imports * Move default values to function params * Fix ts warning * minor adjustment to definition of initial filters * Add tsc-expect-error to dummy arg for minification cases --------- Co-authored-by: Nate Weller <[email protected]> Co-authored-by: Nate Weller <[email protected]>
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Protect: Add Go to Cloud and Scan now button to Protect primary header (#40057) Protect: Update Scan and History headers (#40058) Protect: de-emphasize cloud link by using link variant (#40211) Protect: Add ShieldIcon Component (#40402) Protect: Integrate ThreatsDataViews Component (#40076) Components: Add ScanReport (#40419) Protect: Refactor AdminSectionHero (#40516) Protect: Update Scan History extension types (#40548) Protect: Add Home page (#40317) Protect: Integrate ScanReport (#40420) ScanReport: Fix defaultLayout (#40603) Update onboarding popover placement (#40550) Protect Meets Core: Home Page Scan Report Data Adjustments (#40616) Scan Report: Align Status Icon (#40617) Apply max width to hero content (#40618) Protect: Hide Scan Report When No Data (#40619) Protect: Hide Threats Report When No Data (#40620) Protect: Update Threat Icons (#40621) Protect: fix home page stat card spacing (#40623) ScanReport: Disable hiding relevant fields (#40602) Use error variant (#40832) Protect: Restore HistoryAdminSectionHero (#40551) Protect: Separate scan results and history DataViews (#40845) ThreatsDataViews: Improve responsiveness (#40670) ThreatsDataViews: ThreatModal integration (#40202) Protect Meets Core: Fix "0" rendered by conditional render chain (#40882)
Description
ThreatsDataViewsinstance for scan history.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
ThreatsDataViewsstorybooks/scan,/scan/history,/scan/history/fixed,/scan/history/ignoredupdate the UI correctlyScreenshots