diff --git a/component_catalog/filters.py b/component_catalog/filters.py index b72ab827..c1a51c70 100644 --- a/component_catalog/filters.py +++ b/component_catalog/filters.py @@ -244,6 +244,10 @@ class PackageFilterSet(DataspacedFilterSet): field_name="affected_by_vulnerabilities", widget=DropDownRightWidget(link_content=''), ) + affected_by = django_filters.CharFilter( + field_name="affected_by_vulnerabilities__vulnerability_id", + label=_("Affected by"), + ) class Meta: model = Package diff --git a/component_catalog/templates/component_catalog/includes/vulnerability_list_table.html b/component_catalog/templates/component_catalog/includes/vulnerability_list_table.html index c34d7469..d7254f80 100644 --- a/component_catalog/templates/component_catalog/includes/vulnerability_list_table.html +++ b/component_catalog/templates/component_catalog/includes/vulnerability_list_table.html @@ -47,7 +47,13 @@ {% endif %} - {{ vulnerability.affected_packages_count }} + {% if vulnerability.affected_packages_count %} + + {{ vulnerability.affected_packages_count }} + + {% else %} + 0 + {% endif %} {{ vulnerability.fixed_packages_length }}