Skip to content
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 Meets Core: Project Branch #40191

Draft
wants to merge 54 commits into
base: trunk
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
76e4c62
Init project branch
nateweller Nov 14, 2024
f5daa56
Protect: Add Go to Cloud and Scan now button to Protect primary heade…
dkmyta Nov 14, 2024
0d57966
Protect: Update Scan and History headers (#40058)
dkmyta Nov 14, 2024
8218695
Protect: de-emphasize cloud link by using link variant (#40211)
nateweller Nov 18, 2024
49a26fd
Protect: add ShieldIcon component
nateweller Nov 30, 2024
a69819e
Protect: Add ShieldIcon Component (#40402)
nateweller Dec 5, 2024
f38a7a6
Protect: Integrate ThreatsDataViews Component (#40076)
nateweller Dec 5, 2024
62ec5d8
Components: Add ScanReport (#40419)
dkmyta Dec 5, 2024
8263fff
Fix type errors
nateweller Dec 6, 2024
262a47a
Protect: Refactor AdminSectionHero (#40516)
nateweller Dec 9, 2024
91c8aa1
Protect: Update Scan History extension types (#40548)
dkmyta Dec 10, 2024
fb2c44c
Protect: Add Home page (#40317)
dkmyta Dec 10, 2024
42c7de9
Protect: Integrate ScanReport (#40420)
dkmyta Dec 11, 2024
ea88d26
Fix duplicate imports
nateweller Dec 15, 2024
463632c
ScanReport: Fix defaultLayout (#40603)
dkmyta Dec 15, 2024
c413a79
Update onboarding popover placement (#40550)
dkmyta Dec 15, 2024
6a5ef67
Protect Meets Core: Home Page Scan Report Data Adjustments (#40616)
nateweller Dec 18, 2024
501fb14
Scan Report: Align Status Icon (#40617)
nateweller Dec 18, 2024
30a0fb9
Apply max width to hero content (#40618)
nateweller Dec 18, 2024
a4977a6
Protect: Hide Scan Report When No Data (#40619)
nateweller Dec 18, 2024
4bb8555
Protect: Hide Threats Report When No Data (#40620)
nateweller Dec 18, 2024
ea4af61
Protect: Update Threat Icons (#40621)
nateweller Dec 18, 2024
657089b
Protect: fix home page stat card spacing (#40623)
nateweller Dec 18, 2024
27abf44
Fix ESLint issue
nateweller Jan 1, 2025
1da1a03
ScanReport: Disable hiding relevant fields (#40602)
dkmyta Jan 2, 2025
cdb57a6
Use error variant (#40832)
dkmyta Jan 3, 2025
d739b84
Protect: Restore HistoryAdminSectionHero (#40551)
dkmyta Jan 4, 2025
b90fd02
Protect: Separate scan results and history DataViews (#40845)
dkmyta Jan 14, 2025
f386309
ThreatsDataViews: Improve responsiveness (#40670)
dkmyta Jan 14, 2025
467ac5b
ThreatsDataViews: ThreatModal integration (#40202)
dkmyta Jan 14, 2025
1c8c3c0
Protect Meets Core: Fix "0" rendered by conditional render chain (#40…
nateweller Jan 14, 2025
4ab7996
Fix: add missing return
nateweller Jan 16, 2025
eec7070
Fix: reduce of empty array with no initial value
nateweller Jan 16, 2025
b72035e
Fix: hide home report when first protect report scan initializing
nateweller Jan 16, 2025
617d615
minor adjustments
nateweller Jan 31, 2025
fb479e3
Update lockfile
nateweller Jan 31, 2025
1169e60
Remove changes to protect-status package
nateweller Jan 31, 2025
fb00e93
Remove changes to badge components, moved to #41450
nateweller Jan 31, 2025
cf5c650
Fix type error
nateweller Feb 3, 2025
1f1c359
Fix stories
nateweller Feb 4, 2025
fe56960
Fix case where status.core is empty
nateweller Feb 4, 2025
f9b61e6
Spacing and sizing adjustments
nateweller Feb 5, 2025
40e5597
Restore unintended webpack-cli version change
nateweller Feb 5, 2025
36f2433
Fix ThreatsDataViews test
nateweller Feb 6, 2025
04ce70d
changelog
nateweller Feb 9, 2025
480ee62
Fix width of hero content
nateweller Feb 9, 2025
cbd6c5e
Improve threat ignore/unignore queries
nateweller Feb 9, 2025
118ba4a
Remove close button from threat details modal actions
nateweller Feb 9, 2025
dc9df04
Remove unneccessary changes to protect-status package
nateweller Feb 22, 2025
731cda5
Fix z-index conflict between Notice and DataViews components
nateweller Feb 22, 2025
e0ee566
Fix ThreatsDataViews title line wrapping
nateweller Feb 22, 2025
1b1a2a7
Add alternate 'how to fix it' message when no fixer or fixed in versi…
nateweller Feb 23, 2025
ce9c0e6
Fix imports and enhance types
nateweller Feb 23, 2025
3673c90
Additional import fixes and type improvements
nateweller Feb 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ThreatsDataViews: Improve responsiveness (#40670)
* Init project branch

* Init project branch

* Improve component responsiveness

* Init project branch

* Fix merge conflict

* Simplify, and only default to list view in mobile

* Fix spacing

* Minor adjustments to initialization of defaultLayouts, remove memo

* Remove style overrides on core component

* Reapply min-width for ScanToggleGroupControl

---------

Co-authored-by: Nate Weller <hello@nateweller.com>
dkmyta and nateweller committed Mar 18, 2025
commit f3863092c6d5f21a06056578ef6dc6b6f72994e2
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { useCallback, useMemo, useState } from 'react';
import Badge from '../badge/index.js';
import useBreakpointMatch from '../layout/use-breakpoint-match/index.js';
import ThreatFixerButton from '../threat-fixer-button/index.js';
import ThreatSeverityBadge from '../threat-severity-badge/index.js';
import {
@@ -91,6 +92,8 @@ export default function ThreatsDataViews( {
onUnignoreThreats?: ActionButton< Threat >[ 'callback' ];
header?: JSX.Element;
} ): JSX.Element {
const [ isSm ] = useBreakpointMatch( [ 'sm', 'lg' ], [ null, '<' ] );

const baseView = {
sort: {
field: 'severity',
@@ -126,14 +129,21 @@ export default function ThreatsDataViews( {
},
};

/**
* Default View Type.
*
* Set the default view type (list or table) based on the initial screen size.
*/
const defaultViewType: 'list' | 'table' = isSm ? 'list' : 'table';

/**
* DataView view object - configures how the dataset is visible to the user.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-dataviews/#view-object
*/
const [ view, setView ] = useState< View >( {
type: 'table',
...defaultLayouts.table,
type: defaultViewType,
...defaultLayouts[ defaultViewType ],
} );

/**
Original file line number Diff line number Diff line change
@@ -2,11 +2,6 @@
padding-left: 0;
padding-right: 0;
overflow: hidden;

> * {
margin-left: calc( var( --spacing-base ) * -3 ); // -24px
margin-right: calc( var( --spacing-base ) * -3 ); // -24px
}
}

.view-scan-report {
21 changes: 16 additions & 5 deletions projects/plugins/protect/src/js/routes/scan/styles.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.scan-results-container {
:global {
@media ( max-width: 599px ) {
div.dataviews-wrapper .dataviews__view-actions {
flex-wrap: wrap;
justify-content: center;
gap: calc( var( --spacing-base ) * 1.5 ); // 12px;
}
}
}
}

.hero-main {
max-width: 550px;
}
@@ -17,11 +29,6 @@
padding-left: 0;
padding-right: 0;
overflow: hidden;

> * {
margin-left: calc( var( --spacing-base ) * -3 ); // -24px
margin-right: calc( var( --spacing-base ) * -3 ); // -24px
}
}

.progress-animation {
@@ -33,3 +40,7 @@
.last-checked {
width: fit-content;
}

.toggle-group-control {
min-width: 300px;
}