Add project filter toggles to component search#1505
Open
hoobio wants to merge 5 commits intoDependencyTrack:masterfrom
Open
Add project filter toggles to component search#1505hoobio wants to merge 5 commits intoDependencyTrack:masterfrom
hoobio wants to merge 5 commits intoDependencyTrack:masterfrom
Conversation
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>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
4 tasks
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>
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>
Author
|
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:
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds two project-scope toggles to the Component Search page (
/components):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_projectsswitch used onProjectList,PolicyViolationAudit,VulnerabilityAuditByOccurrence,VulnerabilityAuditGroupedByVulnerability, andAffectedProjects. Theshow_inactive_projectsi18n key is reused;show_non_latest_project_versionsis new and follows the same parallel structure (label states what gets hidden when off).The page saves toggle state to
localStorageso the chosen scope persists across sessions.Checklist