feat(ui): add new scan jobs view#11258
Open
alejandrobailo wants to merge 27 commits into
Open
Conversation
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Contributor
|
✅ All necessary |
Contributor
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
Drops the legacy scans table chain and its supporting forms after the
new scans view replaced them. Nothing in the active render tree
referenced these files anymore — `ScansLaunchSection`, `LaunchScanWorkflow`,
`ScansTableWithPolling`, `ColumnGetScans` and the rest were only kept
alive by their own internal cross-references.
Removes:
- `components/scans/forms/` (edit-scan-form, schedule-form)
- `components/scans/launch-workflow/` (launch-scan-workflow-form, select-scan-provider)
- `components/scans/scans-launch-section.{tsx,test.tsx}`
- `components/scans/table/scans/{column-get-scans,data-table-row-actions,data-table-row-details,scans-table-with-polling,skeleton-scan-detail}.tsx`
- `editScanFormSchema` from `types/formSchemas.ts` (only used by the deleted form)
The `table/scans/index.ts` barrel is trimmed to the surviving entries
(scan-jobs-columns, scan-jobs-row-actions, scan-jobs-table).
Introduces `EditAliasModal`, a shadcn-based modal mirroring the styling and patterns of `LaunchScanModal` (Modal/Field/FieldLabel/Input, inline useState validation, toast() function). It reuses the existing `updateScan` server action which PATCHes the scan's `name` attribute. `ScanJobsRowActions` collapses the previous "Edit Alias" + disabled "Edit Scan Schedule" pair into a single "Edit" item that opens the alias modal. The schedule edit will be re-added to the same modal once the backend exposes a schedule update endpoint — a TODO comment marks the expansion point.
Drops the redundant "Scan" prefix from labels in the scans view since the user is already inside that context: - Column titles in `scan-jobs-columns.tsx`: "Scan Time" → "Duration", "Scan Schedule" → "Schedule", "Scan Date" → "Completed", "Next Scan" → "Next Run". - Tab labels in `scans-table.utils.ts`: "Active Scans" → "Active", "Completed Scans" → "Completed", "Scheduled Scans" → "Scheduled". Also adds the Alias column to the Scheduled tab for consistency with Active and Completed — schedules without an alias still surface their provider account in the first column.
When no rows in the table can expand, DataTableExpandAllToggle returned null, leaving the header without the 16px slot that its expandable cells still reserve via <div className="w-4" />. The result was a horizontal offset between the header checkbox and the row checkboxes in tables like Providers when a tenant has no organization rows. Always render the 16px placeholder when the toggle has nothing to do, mirroring the behaviour of the per-row DataTableExpandToggle. Header and cells now agree on the same layout grid regardless of whether expansion is currently available.
Adds backend-backed sorting to the columns whose value is listed in the ScanViewSet ordering_fields and exists on the Scan model: Alias (name), Schedule (trigger), Completed (updated_at) and Next Run (scheduled_at). Sorting is wired via accessorFn so TanStack Table's getCanSort() returns true and DataTableColumnHeader renders the sortable chevron button. Extracts the previously inlined Schedule column into a shared scanScheduleColumn constant — the three tabs were duplicating the same definition. Launched (started_at) stays unsorted because the API does not expose that field for ordering. Also hides the Duration column behind a TODO comment. The backend currently leaves attributes.duration empty for active scans, so the column rendered blank and added more noise than value. Restoring it is a one-line revert once the API populates the field.
Each tab in the scan jobs view exposes a different set of sortable columns: Active sorts by Alias/Schedule, Scheduled adds Next Run, Completed adds Completed. Carrying the sort URL param across tabs left the table ordered by a field whose chevron indicator no longer existed on screen, producing data ordered in a non-default way with nothing to explain why. Clear sort=... when setTab fires so each tab starts from its natural default ordering. Other URL params (filters, etc.) keep their value because they are orthogonal to the tab choice. Covered by a test that seeds sort=trigger, clicks a different tab and asserts the resulting URL has no sort param.
pfe-nazaries
previously approved these changes
May 22, 2026
| }, | ||
| }); | ||
|
|
||
| describe("ScanJobsRowActions", () => { |
Contributor
There was a problem hiding this comment.
Missing test for open/download finding branches
|
|
||
| import { ScanJobsRowActions } from "./scan-jobs-row-actions"; | ||
|
|
||
| const { pushMock, toastMock } = vi.hoisted(() => ({ |
Contributor
There was a problem hiding this comment.
These mocks are used below to mock real push and toast behaviour, but never asserted on text that they are being called as expected
| icon={<Eye />} | ||
| label="View Findings" | ||
| onSelect={openFindings} | ||
| disabled={!scanDate} |
Contributor
There was a problem hiding this comment.
Align the disabled condition with the early return if inside openFindings function
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.
Context
Adds the new Scan Jobs UI flow for PROWLER-1761. The page introduces tabbed scan job views while keeping backend-dependent functionality constrained to what is currently available in the OSS API.
Description
View Findingslink instead of fail/pass counters until backend returns those counters.Imported Scansis disabled outside Prowler Cloud and falls back toActive Scanswhen reached by URL.Import Findingsis disabled outside Prowler Cloud and shows the standardAvailable in Prowler Cloudbadge.Edit Scan Scheduleremains disabled and shows the standard Cloud tooltip outside Prowler Cloud.Cancel Scanfor now with a TODO until backend exposes a public scan cancellation endpoint.Last Scanvalue, which should represent the latest completed scan for the provider.Steps to review
/scansand verify the Scan Jobs page renders with the expected tabs.Import FindingsandLaunch Scanmatching the FindingsCreate Alertbutton size.Launch Scan, select a connected cloud account, optionally enter a scan note, and launch the scan.Imported Scansis disabled with a Cloud tooltip andImport Findingsis disabled with the Cloud badge.Cancel Scanis not shown until backend cancellation support exists.Validation run locally:
E2E not run locally because it requires real AWS E2E credentials.
Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.