@@ -8,7 +8,7 @@ import { useRouteMatch, useParams, useHistory, generatePath } from 'react-router
88import { BuildDetails , CIPipeline , HistoryLogsType , SecurityTabType } from './types'
99import { ReactComponent as Down } from '../../../../assets/icons/ic-dropdown-filled.svg'
1010import { getLastExecutionByArtifactId } from '../../../../services/service'
11- import { ScanDisabledView , ImageNotScannedView , NoVulnerabilityView , CIRunningView } from './cIDetails.util'
11+ import { ScanDisabledView , ImageNotScannedView , CIRunningView } from './cIDetails.util'
1212import './ciDetails.scss'
1313import { getModuleInfo } from '../../../v2/devtronStackManager/DevtronStackManager.service'
1414import { ModuleStatus } from '../../../v2/devtronStackManager/DevtronStackManager.type'
@@ -20,6 +20,8 @@ import Artifacts from '../cicdHistory/Artifacts'
2020import { CICDSidebarFilterOptionType , History , HistoryComponentType } from '../cicdHistory/types'
2121import LogsRenderer from '../cicdHistory/LogsRenderer'
2222import { EMPTY_STATE_STATUS } from '../../../../config/constantMessaging'
23+ import novulnerability from '../../../../assets/img/ic-vulnerability-not-found.svg' ;
24+ import { ScannedByToolModal } from '../../../common/security/ScannedByToolModal'
2325
2426const terminalStatus = new Set ( [ 'succeeded' , 'failed' , 'error' , 'cancelled' , 'nottriggered' , 'notbuilt' ] )
2527let statusSet = new Set ( [ 'starting' , 'running' , 'pending' ] )
@@ -390,6 +392,21 @@ const HistoryLogs = ({ triggerDetails, isBlobStorageConfigured, isJobView, appId
390392 </ div >
391393 )
392394}
395+ export function NoVulnerabilityViewWithTool ( { scanToolId} :{ scanToolId :number } ) {
396+ return (
397+ < div className = "flex h-100" >
398+ < GenericEmptyState
399+ image = { novulnerability }
400+ title = { EMPTY_STATE_STATUS . CI_DEATILS_NO_VULNERABILITY_FOUND }
401+ children = {
402+ < span className = "flex workflow__header dc__border-radius-24 bcn-0" >
403+ < ScannedByToolModal scanToolId = { scanToolId } />
404+ </ span >
405+ }
406+ />
407+ </ div >
408+ )
409+ }
393410
394411const SecurityTab = ( { ciPipelineId, artifactId, status, appIdFromParent } : SecurityTabType ) => {
395412 const [ isCollapsed , setIsCollapsed ] = useState ( false )
@@ -405,6 +422,7 @@ const SecurityTab = ({ ciPipelineId, artifactId, status, appIdFromParent }: Secu
405422 scanned : false ,
406423 isLoading : ! ! artifactId ,
407424 isError : false ,
425+ ScanToolId : null ,
408426 } )
409427 const { appId } = useParams < { appId : string } > ( )
410428 const { push } = useHistory ( )
@@ -419,6 +437,7 @@ const SecurityTab = ({ ciPipelineId, artifactId, status, appIdFromParent }: Secu
419437 scanned : result . scanned ,
420438 isLoading : false ,
421439 isError : false ,
440+ ScanToolId : result . scanToolId ,
422441 } )
423442 } catch ( error ) {
424443 // showError(error);
@@ -433,7 +452,7 @@ const SecurityTab = ({ ciPipelineId, artifactId, status, appIdFromParent }: Secu
433452 function toggleCollapse ( ) {
434453 setIsCollapsed ( ! isCollapsed )
435454 }
436-
455+
437456 useEffect ( ( ) => {
438457 if ( artifactId ) {
439458 callGetSecurityIssues ( )
@@ -472,8 +491,9 @@ const SecurityTab = ({ ciPipelineId, artifactId, status, appIdFromParent }: Secu
472491 return < ImageNotScannedView />
473492 }
474493 } else if ( artifactId && securityData . scanned && ! securityData . vulnerabilities . length ) {
475- return < NoVulnerabilityView />
494+ return < NoVulnerabilityViewWithTool scanToolId = { securityData . ScanToolId } />
476495 }
496+ const scanToolId = securityData . ScanToolId
477497
478498 return (
479499 < >
@@ -497,7 +517,9 @@ const SecurityTab = ({ ciPipelineId, artifactId, status, appIdFromParent }: Secu
497517 { severityCount . critical === 0 && severityCount . moderate === 0 && severityCount . low !== 0 ? (
498518 < span className = "dc__fill-low" > { severityCount . low } Low</ span >
499519 ) : null }
500- < div className = "security-scan__type" > post build execution</ div >
520+ < div className = "security-scan__type flex" >
521+ < ScannedByToolModal scanToolId = { scanToolId } />
522+ </ div >
501523 </ div >
502524 { isCollapsed ? (
503525 ''
0 commit comments