Skip to content

Commit 6f32f12

Browse files
Added support for multiple CPEs in UI - DependencyTrack/dependency-track#1467
1 parent b8aa935 commit 6f32f12

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/views/portfolio/vulnerabilities/Vulnerability.vue

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464

6565
<div v-if="vulnerability.cwe">
6666
<b-card :title="this.$t('message.weakness')">
67-
<b-card-text>
68-
<a :href="cweLink">{{ cweLabel }}</a>
67+
<b-card-text v-for="cwe in vulnerability.cwe" :key="cwe.cweId">
68+
<a :href="cweLink(cwe)">{{ cweLabel(cwe) }}</a>
6969
</b-card-text>
7070
</b-card>
7171
</div>
@@ -137,20 +137,6 @@
137137
cvssExploitScore () {
138138
return common.valueWithDefault(((this.vulnerability.cvssV3ExploitabilitySubScore) ? this.vulnerability.cvssV3ExploitabilitySubScore : this.vulnerability.cvssV2ExploitabilitySubScore), 0);
139139
},
140-
cweLabel() {
141-
if (this.vulnerability.cwe) {
142-
return `CWE-${this.vulnerability.cwe.cweId}: ${this.vulnerability.cwe.name}`;
143-
} else {
144-
return null;
145-
}
146-
},
147-
cweLink () {
148-
if (this.vulnerability.cwe) {
149-
return `https://cwe.mitre.org/data/definitions/${this.vulnerability.cwe.cweId}`;
150-
} else {
151-
return null;
152-
}
153-
},
154140
sourceLabel () {
155141
switch (this.vulnerability.source) {
156142
case 'NVD':
@@ -224,6 +210,12 @@
224210
},
225211
syncProjectFields: function(vulnerability) {
226212
//todo future - when internal vulnerability editing is implemented
213+
},
214+
cweLabel: function(cwe) {
215+
return `CWE-${cwe.cweId}: ${cwe.name}`;
216+
},
217+
cweLink: function(cwe) {
218+
return `https://cwe.mitre.org/data/definitions/${cwe.cweId}`;
227219
}
228220
},
229221
beforeMount() {

0 commit comments

Comments
 (0)