Skip to content

Commit

Permalink
Add link to affected packages list #95
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Aug 23, 2024
1 parent 050d360 commit a0b674b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions component_catalog/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ class PackageFilterSet(DataspacedFilterSet):
field_name="affected_by_vulnerabilities",
widget=DropDownRightWidget(link_content='<i class="fas fa-bug"></i>'),
)
affected_by = django_filters.CharFilter(
field_name="affected_by_vulnerabilities__vulnerability_id",
label=_("Affected by"),
)

class Meta:
model = Package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@
{% endif %}
</td>
<td>
{{ vulnerability.affected_packages_count }}
{% if vulnerability.affected_packages_count %}
<a href="{% url 'component_catalog:package_list' %}?affected_by={{ vulnerability.vulnerability_id }}">
{{ vulnerability.affected_packages_count }}
</a>
{% else %}
0
{% endif %}
</td>
<td>
{{ vulnerability.fixed_packages_length }}
Expand Down

0 comments on commit a0b674b

Please sign in to comment.