@@ -26,13 +26,7 @@ import { SecurityModal } from '../SecurityModal'
2626import { DEFAULT_SECURITY_MODAL_IMAGE_STATE } from '../SecurityModal/constants'
2727import { CATEGORIES , SecurityModalStateType , SUB_CATEGORIES } from '../SecurityModal/types'
2828import { ScanCategories , ScanSubCategories } from '../types'
29- import {
30- getCompiledSecurityThreats ,
31- getSecurityConfig ,
32- getSecurityScanStatus ,
33- getStatusForScanList ,
34- getTotalSeverities ,
35- } from '../utils'
29+ import { getCompiledSecurityThreats , getSecurityConfig , getStatusForScanList , getTotalSeverities } from '../utils'
3630import { ReportTabEmptyState } from './ReportTabEmptyState'
3731import SecurityCard from './SecurityCard'
3832import { SecurityCardProps , SecurityDetailsCardsProps } from './types'
@@ -46,7 +40,6 @@ const SecurityDetailsCards = ({ scanResult, Sidebar }: SecurityDetailsCardsProps
4640
4741 const scanThreats = getCompiledSecurityThreats ( scanResult )
4842 const threatCount = getTotalSeverities ( scanThreats )
49- const securityScanStatus = getSecurityScanStatus ( scanResult )
5043
5144 const getScanToolInfo = ( category : string ) : { scanToolName : string ; scanToolUrl : string } => {
5245 const image = imageScan ?. vulnerability ?. list ?. [ 0 ]
@@ -77,9 +70,20 @@ const SecurityDetailsCards = ({ scanResult, Sidebar }: SecurityDetailsCardsProps
7770 </ div >
7871 )
7972
80- console . log ( 'securityScanStatus' , securityScanStatus , threatCount )
73+ if ( ! scanResult ?. scanned ) {
74+ return (
75+ < div className = "flexbox-col dc__gap-12 mw-600 dc__mxw-1000" >
76+ { renderHeader ( ) }
77+
78+ < ReportTabEmptyState
79+ title = { EMPTY_STATE_STATUS . CI_DETAILS_IMAGE_NOT_SCANNED . TITLE }
80+ subtitle = { EMPTY_STATE_STATUS . CI_DETAILS_IMAGE_NOT_SCANNED . SUBTITLE }
81+ />
82+ </ div >
83+ )
84+ }
8185
82- if ( ! threatCount && securityScanStatus === 'Completed' ) {
86+ if ( ! threatCount ) {
8387 return (
8488 < div className = "flexbox-col dc__gap-12 mw-600 dc__mxw-1000" >
8589 { renderHeader ( ) }
@@ -170,14 +174,7 @@ const SecurityDetailsCards = ({ scanResult, Sidebar }: SecurityDetailsCardsProps
170174 return (
171175 < div className = "flexbox-col dc__gap-12" key = { category } >
172176 { renderHeader ( category ) }
173- { ! scanResult ?. scanned ? (
174- < ReportTabEmptyState
175- title = { EMPTY_STATE_STATUS . CI_DETAILS_IMAGE_NOT_SCANNED . TITLE }
176- subtitle = { EMPTY_STATE_STATUS . CI_DETAILS_IMAGE_NOT_SCANNED . SUBTITLE }
177- />
178- ) : (
179- renderSecurityCards ( { category, categoryFailed } )
180- ) }
177+ { renderSecurityCards ( { category, categoryFailed } ) }
181178 </ div >
182179 )
183180 } ) }
0 commit comments