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 675f833 commit 8382ce8
Showing 1 changed file with 31 additions and 27 deletions.
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 8382ce8

Please sign in to comment.