File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ $common.formatCweLabel = function formatCweLabel(cweId, cweName) {
8484 }
8585} ;
8686
87+ $common . formatCweShortLabel = function formatCweShortLabel ( cweId , cweName ) {
88+ if ( cweId && cweName ) {
89+ return "<span data-toggle='tooltip' data-placement='bottom' title='" + cweName + "'>CWE-" + cweId + "</span>" ;
90+ } else {
91+ return "" ;
92+ }
93+ } ;
94+
8795/**
8896 * Formats and returns a specialized label for a vulnerability analyzer (OSSINDEX_ANALYZER, INTERNAL_ANALYZER, etc).
8997 */
@@ -338,6 +346,7 @@ module.exports = {
338346 formatSeverityLabel : $common . formatSeverityLabel ,
339347 formatViolationStateLabel : $common . formatViolationStateLabel ,
340348 formatCweLabel : $common . formatCweLabel ,
349+ formatCweShortLabel : $common . formatCweShortLabel ,
341350 formatAnalyzerLabel : $common . formatAnalyzerLabel ,
342351 makeAnalysisStateLabelFormatter : $common . makeAnalysisStateLabelFormatter ,
343352 makeAnalysisJustificationLabelFormatter : $common . makeAnalysisJustificationLabelFormatter ,
Original file line number Diff line number Diff line change 5050 import permissionsMixin from " ../../../mixins/permissionsMixin" ;
5151 import BootstrapToggle from ' vue-bootstrap-toggle' ;
5252 import ProjectUploadVexModal from " @/views/portfolio/projects/ProjectUploadVexModal" ;
53+ import $ from " jquery" ;
5354
5455 export default {
5556 props: {
108109 },
109110 {
110111 title: this .$t (' message.cwe' ),
111- field: " vulnerability.cweId " ,
112+ field: " vulnerability.cwe " ,
112113 sortable: true ,
113114 class: " expand-20" ,
114115 visible: false ,
115116 formatter (value , row , index ) {
116117 if (typeof value !== ' undefined' ) {
117- return common .formatCweLabel (value, row .vulnerability .cweName );
118+ let label = " " ;
119+ for (let i= 0 ; i< value .length ; i++ ) {
120+ label += common .formatCweShortLabel (value[i].cweId , value[i].name );
121+ if (i < value .length - 1 ) label += " , "
122+ }
123+ return label;
118124 }
119125 }
120126 },
164170 ],
165171 data: [],
166172 options: {
173+ onPostBody: this .initializeTooltips ,
167174 search: true ,
168175 showColumns: true ,
169176 showRefresh: true ,
429436 },
430437 tableLoaded : function (data ) {
431438 this .$emit (' total' , data .total );
432- }
439+ },
440+ initializeTooltips : function () {
441+ $ (' [data-toggle="tooltip"]' ).tooltip ();
442+ },
433443 },
434444 watch: {
435445 showSuppressedFindings () {
You can’t perform that action at this time.
0 commit comments