Skip to content

Add project filter toggles to component search#1505

Open
hoobio wants to merge 5 commits intoDependencyTrack:masterfrom
hoobio:feat/4570-component-project-filters
Open

Add project filter toggles to component search#1505
hoobio wants to merge 5 commits intoDependencyTrack:masterfrom
hoobio:feat/4570-component-project-filters

Conversation

@hoobio
Copy link
Copy Markdown

@hoobio hoobio commented May 1, 2026

Description

Adds two project-scope toggles to the Component Search page (/components):

  • "Show inactive projects"
  • "Show non-latest project versions"

Both default to on, so search behavior matches the pre-PR baseline. Switching either off sends the corresponding query parameter on GET /v1/component/identity (excludeInactiveProjects, onlyLatestProjectVersion) to filter results.

Addressed Issue

Refs DependencyTrack/dependency-track#4570

Additional Details

Backend support: DependencyTrack/dependency-track#6085. The Impact Analysis doc update lives in the backend PR alongside the API param description.

Toggle labels and the default-on behavior mirror the existing show_inactive_projects switch used on ProjectList, PolicyViolationAudit, VulnerabilityAuditByOccurrence, VulnerabilityAuditGroupedByVulnerability, and AffectedProjects. The show_inactive_projects i18n key is reused; show_non_latest_project_versions is new and follows the same parallel structure (label states what gets hidden when off).

The page saves toggle state to localStorage so the chosen scope persists across sessions.

Checklist

  • I have read and understand the contributing guidelines
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Adds two toggles to the Component Search page that map to the
new onlyActive and onlyLatestVersion query parameters on
GET /v1/component/identity. Toggle state is persisted in
localStorage so users keep their preferred scope across sessions.
Lets portfolio-wide component searches be scoped to active
projects and/or projects flagged as the latest version, cutting
noise from archived projects and older versions during triage.

Refs DependencyTrack/dependency-track#4570

Signed-off-by: Hoobi <7289249+hoobio@users.noreply.github.com>
@owasp-dt-bot
Copy link
Copy Markdown

owasp-dt-bot commented May 1, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Drops "that belong to" filler from the new toggle tooltips and
switches the labelIcon characters to ✓/✕ escape
sequences to match the style used in ProjectList.vue.

Signed-off-by: hoobio <7289249+hoobio@users.noreply.github.com>
@hoobio hoobio marked this pull request as ready for review May 1, 2026 01:57
hoobio added 2 commits May 2, 2026 10:54
Update query string emissions to match the renamed backend
parameters (excludeInactiveProjects, onlyLatestProjectVersion).
Reorder the latest-version Vue data field, localStorage key, and
i18n keys from onlyLatestVersionProjects to onlyLatestProjectVersions
so they read in line with the toggle label "Only latest project
versions".

Refs DependencyTrack/dependency-track#4570

Signed-off-by: hoobio <7289249+hoobio@users.noreply.github.com>
Switch the component search toggles to mirror the convention used
by ProjectList, PolicyViolationAudit, VulnerabilityAuditByOccurrence,
VulnerabilityAuditGroupedByVulnerability, and AffectedProjects, which
all expose a "Show inactive projects" switch defaulting to on.

Renames:
- onlyActiveProjects -> showInactiveProjects (default true; reuses
  the existing show_inactive_projects i18n key)
- onlyLatestProjectVersions -> showAllProjectVersions (default true;
  new show_all_project_versions key, no precedent for this filter)

Toggling either switch off sends the corresponding query parameter
to the backend (excludeInactiveProjects, onlyLatestProjectVersion).

Refs DependencyTrack/dependency-track#4570

Signed-off-by: hoobio <7289249+hoobio@users.noreply.github.com>
@hoobio
Copy link
Copy Markdown
Author

hoobio commented May 2, 2026

Open question on placement: the two toggles currently sit on a new row directly below the search inputs, which adds vertical space to the page (the original issue notes there's a desire to keep the page compact and even hinted at dropping the portfolio widgets at the top to make room).

A few options I considered:

  1. New row below search inputs (current). Simple, readable, but adds a row.
  2. Inline with the search row (after the Search button or after the column-toggle/refresh icons). Compact, but cramps the row on narrower viewports.
  3. Inline with the bootstrap-table toolbar (right of the column-show / refresh icons that the table already exposes). Mirrors how ProjectList.vue puts its show_inactive_projects switch alongside the create button.

I went with option 1 to avoid touching the existing search row layout. Happy to move them if there's a preferred home.

The previous label "Show all project versions" required users to
infer that switching it off filters to the latest. Renaming so the
label states what the toggle hides when off, matching the parallel
structure of "Show inactive projects" (off -> inactive hidden).

Signed-off-by: hoobio <7289249+hoobio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants