Skip to content

feat: allow sorting endpoints by active findings count#14462

Open
valentijnscholten wants to merge 2 commits intoDefectDojo:bugfixfrom
valentijnscholten:feat/sort-endpoints-by-active-findings
Open

feat: allow sorting endpoints by active findings count#14462
valentijnscholten wants to merge 2 commits intoDefectDojo:bugfixfrom
valentijnscholten:feat/sort-endpoints-by-active-findings

Conversation

@valentijnscholten
Copy link
Member

Summary

  • Add ability to sort the endpoint list and host list by active findings count in the UI (ascending and descending)
  • Annotate the endpoint queryset with active_finding_count before filtering so the sort operates at the database level
  • Add active_finding_count to EndpointFilterHelper and ApiEndpointFilter ordering fields, and expose it in EndpointSerializer
  • V3 Locations path: add active_findings ordering to URLFilter (UI) and V3EndpointCompatibleFilterSet (API compat); expose active_finding_count in V3EndpointCompatibleSerializer; the annotation is already provided by annotate_location_counts_and_status and annotate_host_contents
  • Update endpoints.html and url/list.html templates to render the column header as a sortable link and use the annotated count directly from the queryset
  • Add Selenium integration tests to endpoint_extended_test.py covering ascending and descending sort for both endpoint list and host list views; tests automatically select the correct sort field name based on DD_V3_FEATURE_LOCATIONS

Closes #10540

Add ability to sort the endpoint list (and host list) by the number of
active findings, for both the UI and API, including the V3 Locations
code path.
@valentijnscholten valentijnscholten added this to the 2.56.1 milestone Mar 7, 2026
@valentijnscholten valentijnscholten changed the title feat: sort endpoints by active findings count feat: allow sorting endpoints by active findings count Mar 7, 2026
@valentijnscholten valentijnscholten marked this pull request as ready for review March 8, 2026 10:30
@Maffooch Maffooch modified the milestones: 2.56.1, 2.56.2 Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants