@@ -68,7 +68,6 @@ export const SourceInfo = ({
6868 filteredEnvIds,
6969 deploymentUserActionState,
7070} : SourceInfoType ) => {
71- const [ showVulnerabilitiesCard , setShowVulnerabilitiesCard ] = useState < boolean > ( false )
7271 const isdeploymentAppDeleting = appDetails ?. deploymentAppDeleteRequest || false
7372 const isArgoCdApp = appDetails ?. deploymentAppType === DeploymentAppTypes . GITOPS
7473 const status = appDetails ?. resourceTree ?. status || ''
@@ -92,30 +91,6 @@ export const SourceInfo = ({
9291 message = Rollout [ 0 ] . health . message
9392 }
9493
95- const getScannedStatus = async ( ) => {
96- const { appId, ciArtifactId } = appDetails
97- try {
98- const {
99- result : { scanEnabled, scanned } ,
100- } = await getLastExecutionByAppArtifactId ( ciArtifactId , appId )
101- if ( scanEnabled && scanned ) {
102- // If scanEnabled and scanned is true, then show the vulnerabilities card
103- setShowVulnerabilitiesCard ( true )
104- } else {
105- setShowVulnerabilitiesCard ( false )
106- }
107- } catch ( error ) {
108- setShowVulnerabilitiesCard ( false )
109- showError ( error )
110- }
111- }
112-
113- useEffect ( ( ) => {
114- if ( appDetails ?. ciArtifactId && appDetails ?. appId ) {
115- getScannedStatus ( )
116- }
117- } , [ appDetails ?. ciArtifactId , appDetails ?. appId ] )
118-
11994 const onClickShowCommitInfo = ( e ) : void => {
12095 e . stopPropagation ( )
12196 showCommitInfo ( true )
@@ -328,13 +303,12 @@ export const SourceInfo = ({
328303 filteredEnvIds = { filteredEnvIds }
329304 />
330305 ) }
331- { ! appDetails ?. deploymentAppDeleteRequest &&
332- ! helmMigratedAppNotTriggered &&
333- ( showVulnerabilitiesCard || window . _env_ . ENABLE_RESOURCE_SCAN_V2 ) && (
306+ { ! appDetails ?. deploymentAppDeleteRequest && ! helmMigratedAppNotTriggered && (
334307 < SecurityVulnerabilityCard
335308 cardLoading = { cardLoading }
336309 appId = { params . appId }
337310 envId = { params . envId }
311+ artifactId = { ciArtifactId }
338312 isExternalCI = { isExternalCI }
339313 />
340314 ) }
0 commit comments