Skip to content

Commit ebaa75d

Browse files
committed
Add supplier to list of components in project
Using available data, allows to display the supplier in the list of components. This list is located inside of the project view. Implements #1269 Signed-off-by: Antoine FELIX <[email protected]>
1 parent 6d39df8 commit ebaa75d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,4 +967,4 @@
967967
"medium": "Medium Severity Vulnerabilities",
968968
"unassigned": "Unassigned Vulnerabilities"
969969
}
970-
}
970+
}

src/views/portfolio/projects/ProjectComponents.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,28 @@ export default {
261261
return value === true ? '<i class="fa fa-check-square-o" />' : '';
262262
},
263263
},
264+
{
265+
title: this.$t('message.supplier'),
266+
field: 'supplier',
267+
sortable: true,
268+
visible: false,
269+
formatter(value, row, index) {
270+
if (
271+
Object.prototype.hasOwnProperty.call(row, 'supplier') &&
272+
Object.prototype.hasOwnProperty.call(row.supplier, 'name')
273+
) {
274+
return xssFilters.inHTMLData(row.supplier.name);
275+
} else if (value) {
276+
return xssFilters.inHTMLData(common.valueWithDefault(value, ''));
277+
} else if (row.licenseExpression) {
278+
return xssFilters.inHTMLData(
279+
common.valueWithDefault(row.licenseExpression, ''),
280+
);
281+
} else {
282+
return '';
283+
}
284+
},
285+
},
264286
{
265287
title: this.$t('message.license'),
266288
field: 'license',

0 commit comments

Comments
 (0)