Skip to content

Commit

Permalink
Protect: only show Threats DataViews when scan is in progress or has …
Browse files Browse the repository at this point in the history
…results to show
  • Loading branch information
nateweller committed Dec 15, 2024
1 parent 02683dc commit c0531a2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
2 changes: 0 additions & 2 deletions projects/plugins/protect/src/js/routes/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ const HomePage = () => {

const showReport = status.lastChecked || isScanInProgress( status );

const showReport = status.lastChecked || isScanInProgress( status );

return (
<AdminPage>
<HomeAdminSectionHero />
Expand Down
58 changes: 31 additions & 27 deletions projects/plugins/protect/src/js/routes/scan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const ScanPage = () => {
currentScanStatus = 'active';
}

const showResults = status.lastChecked || isScanInProgress( status );

const filters = useMemo( () => {
if ( location.pathname.includes( '/scan/history' ) ) {
return [
Expand Down Expand Up @@ -69,33 +71,35 @@ const ScanPage = () => {
<OnboardingContext.Provider value={ onboardingSteps }>
<AdminPage>
<ScanAdminSectionHero />
<AdminSection>
<Container
className={ styles[ 'scan-results-container' ] }
horizontalSpacing={ 5 }
horizontalGap={ 4 }
>
<Col>
<div ref={ setScanResultsAnchor }>
<ScanResultsDataView filters={ filters } />
</div>
{ !! status && ! isScanInProgress( status ) && (
<OnboardingPopover
id={ hasPlan ? 'paid-scan-results' : 'free-scan-results' }
anchor={ scanResultsAnchor }
position={ 'top' }
/>
) }
{ !! status && ! isScanInProgress( status ) && hasPlan && (
<OnboardingPopover
id={ 'paid-understand-severity' }
anchor={ scanResultsAnchor }
position={ 'top' }
/>
) }
</Col>
</Container>
</AdminSection>
{ showResults && (
<AdminSection>
<Container
className={ styles[ 'scan-results-container' ] }
horizontalSpacing={ 5 }
horizontalGap={ 4 }
>
<Col>
<div ref={ setScanResultsAnchor }>
<ScanResultsDataView filters={ filters } />
</div>
{ !! status && ! isScanInProgress( status ) && (
<OnboardingPopover
id={ hasPlan ? 'paid-scan-results' : 'free-scan-results' }
anchor={ scanResultsAnchor }
position={ 'top' }
/>
) }
{ !! status && ! isScanInProgress( status ) && hasPlan && (
<OnboardingPopover
id={ 'paid-understand-severity' }
anchor={ scanResultsAnchor }
position={ 'top' }
/>
) }
</Col>
</Container>
</AdminSection>
) }
</AdminPage>
</OnboardingContext.Provider>
);
Expand Down

0 comments on commit c0531a2

Please sign in to comment.