Skip to content

Commit

Permalink
feat(component-search): add license column
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy committed Mar 30, 2024
1 parent d345b2d commit 7215742
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/views/portfolio/components/ComponentSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export default {
title: this.$t('message.version'),
field: 'version',
sortable: true,
visible: true,
formatter(value, row, index) {
return xssFilters.inHTMLData(common.valueWithDefault(value, ''));
},
Expand Down Expand Up @@ -300,6 +301,23 @@ export default {
return `<a href="${url}">${xssFilters.inHTMLData(name)}</a>`;
},
},
{
title: this.$t('message.license_name'),
field: 'resolvedLicense.licenseId',
sortable: true,
visible: false,
formatter(resolvedLicense, row, index) {
if (typeof resolvedLicense === 'undefined') {
return '-'; // No resolvedLicense info available
}
let url = xssFilters.uriInUnQuotedAttr(
'../licenses/' +
encodeURIComponent(row.resolvedLicense.licenseId),
);
return `<a href="${url}">${xssFilters.inHTMLData(row.resolvedLicense.name)}</a>`;
},
},
{
title: this.$t('message.risk_score'),
field: 'lastInheritedRiskScore',
Expand Down

0 comments on commit 7215742

Please sign in to comment.