Skip to content

Commit

Permalink
fix: severit grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Dec 19, 2024
1 parent 774a4de commit e9eaa6c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
:v-model:expanded.sync="expanded"
>
<template v-slot:expanded-row="{ columns, item }">
<td :colspan="columns.length">
<td :colspan="columns.length" class="px-5 py-2">
<h3>{{ item.Title }}</h3>
<p>{{ item.Description }}</p>
<p>
Expand Down Expand Up @@ -112,12 +112,23 @@ const ignoredCves = computed(() => {
const vulnerabilityStats = computed(() => {
const total = props.selectedVulnerabilities.length
const fixable = props.selectedVulnerabilities.filter(
(v) => v.Severity === "Fixable",
(vulnerabilities) => vulnerabilities.FixedVersion != undefined,
).length
const severityInformation: VulnerabilitySeverityInformation[] = []
// Add logic to populate severityInformation
const vulnerabilitySeverityTypes: string[] = [
...new Set(props.selectedVulnerabilities.map((item) => item.Severity)),
]
const severityInformation = vulnerabilitySeverityTypes
.map((severity) => {
return {
severity,
count: props.selectedVulnerabilities.filter(
(vulnerabilities) => vulnerabilities.Severity === severity,
).length,
}
})
.sort((a, b) => compareBySeverity(a.severity, b.severity))
return {
total,
fixable,
Expand Down

0 comments on commit e9eaa6c

Please sign in to comment.