@@ -53,38 +53,38 @@ const Vulnerabilities = ({
53
53
54
54
useEffect ( ( ) => {
55
55
if ( scanResultResponse && isScanV2Enabled ) {
56
- setVulnerabilityCount ( scanResultResponse ? .result ? .imageScan ? .vulnerability ?. list ?. length )
56
+ setVulnerabilityCount ( scanResultResponse . result . imageScan . vulnerability ?. list ?. length )
57
57
return
58
58
}
59
59
if ( vulnerabilitiesResponse && ! isScanV2Enabled ) {
60
60
setVulnerabilityCount ( vulnerabilitiesResponse . result . vulnerabilities ?. length )
61
61
}
62
62
} , [ vulnerabilitiesResponse , scanResultResponse ] )
63
63
64
- if (
65
- ! isScanned ||
66
- ( vulnerabilitiesResponse && ! vulnerabilitiesResponse . result . scanned ) ||
67
- ( scanResultResponse && ! scanResultResponse ?. result . scanned )
68
- ) {
64
+ if ( ! isScanEnabled ) {
69
65
return (
70
66
< div className = "security-tab-empty" >
71
- < p className = "security-tab-empty__title" > Image was not scanned </ p >
67
+ < p className = "security-tab-empty__title" > Scan is Disabled </ p >
72
68
</ div >
73
69
)
74
70
}
75
71
76
- if ( ! isScanEnabled ) {
72
+ if ( areVulnerabilitiesLoading || scanResultLoading ) {
77
73
return (
78
74
< div className = "security-tab-empty" >
79
- < p className = "security-tab-empty__title" > Scan is Disabled </ p >
75
+ < Progressing / >
80
76
</ div >
81
77
)
82
78
}
83
79
84
- if ( areVulnerabilitiesLoading || scanResultLoading ) {
80
+ if (
81
+ ! isScanned ||
82
+ ( vulnerabilitiesResponse && ! vulnerabilitiesResponse . result . scanned ) ||
83
+ ( scanResultResponse && ! scanResultResponse ?. result . scanned )
84
+ ) {
85
85
return (
86
86
< div className = "security-tab-empty" >
87
- < Progressing / >
87
+ < p className = "security-tab-empty__title" > Image was not scanned </ p >
88
88
</ div >
89
89
)
90
90
}
@@ -113,7 +113,7 @@ const Vulnerabilities = ({
113
113
low : imageScanSeverities ?. LOW || 0 ,
114
114
unknown : imageScanSeverities ?. UNKNOWN || 0 ,
115
115
}
116
- : vulnerabilitiesResponse ? .result . severityCount
116
+ : vulnerabilitiesResponse . result . severityCount
117
117
118
118
const totalCount =
119
119
severityCount . critical + severityCount . high + severityCount . low + severityCount . medium + severityCount . unknown
@@ -129,9 +129,9 @@ const Vulnerabilities = ({
129
129
{ vulnerabilitiesResponse ?. result . lastExecution ??
130
130
scanResultResponse ?. result . imageScan . vulnerability . list [ 0 ] . StartedOn }
131
131
</ p >
132
- < p className = "pt-8 pb-8 pl-16 pr-16 flexbox dc__align-items-center" >
132
+ < div className = "pt-8 pb-8 pl-16 pr-16 flexbox dc__align-items-center" >
133
133
< ScannedByToolModal scanToolId = { vulnerabilitiesResponse ?. result . scanToolId ?? SCAN_TOOL_ID_TRIVY } />
134
- </ p >
134
+ </ div >
135
135
</ div >
136
136
)
137
137
}
0 commit comments