Skip to content

feat(ui): filter compliance by provider#11668

Draft
pfe-nazaries wants to merge 18 commits into
masterfrom
feature/compliance-provider-filter
Draft

feat(ui): filter compliance by provider#11668
pfe-nazaries wants to merge 18 commits into
masterfrom
feature/compliance-provider-filter

Conversation

@pfe-nazaries

Copy link
Copy Markdown
Contributor

Context

The Compliance overview and detail pages could previously only be scoped to a single scan. This PR lets users scope compliance by provider — provider type, account, or provider group — aggregating results across the latest completed scan of each matching provider, mirroring the provider-group filtering added to the other main views.

Important

Depends on #11659 (feature/add-provider-group-filter). This PR is stacked on that branch and targets it as its base, so the diff here is only the compliance changes. It should be merged after #11659 — GitHub retargets it to master automatically once #11659 lands.

Description

  • Add a compliance-provider-filters mode helper that detects provider-scope filters and enforces the backend scan_id ⊕ provider-filter XOR.
  • Forward provider filters through the compliance server actions and carry them into the compliance detail URL.
  • Add the provider / account / provider-group selectors to the compliance overview and aggregate the detail page by provider.
  • Reuse the shared FILTER_FIELD / FilterParam<Field> typing primitives from feat(ui): filter by provider group across main views #11659 for the compliance filter keys, replacing the bespoke literals and loosely-typed filter records.

Steps to review

  1. Check out the branch against a backend with multiple connected providers and completed scans.
  2. On Compliance, use the provider / account / provider-group selectors: the cards aggregate across matching providers and the single-scan selector clears (aggregated mode).
  3. Open a framework detail page: it stays in aggregated mode (no scanId) and carries the provider filters in the URL.
  4. Selecting a single scan clears any active provider filters, and vice versa (XOR).

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

UI (if applicable)

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video - Mobile (X < 640px)
  • Screenshots/Video - Tablet (640px > X < 1024px)
  • Screenshots/Video - Desktop (X > 1024px)
  • Ensure new entries are added to ui/CHANGELOG.md

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

🤖 Generated with Claude Code

Pablo F.G and others added 16 commits June 22, 2026 08:51
- Add getAllProviderGroups to fetch every group for filter dropdowns
- Add reusable ProviderGroupSelector with batch and instant modes
- Add provider group chip/label resolution and the provider_groups filter param

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the provider group selector to the Findings filters

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the provider group selector to the Resources filters

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the provider group selector to the Overview filters
- Scope risk plot, risk pipeline, and severity-over-time to the selected group

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the provider group selector to the Scan Jobs filter bar

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the provider group selector to the Providers page filters
- Mock getAllProviderGroups in the providers page data tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add FILTER_FIELD field-name source and a generic FilterParam<Field> template
- Replace the FilterType enum with the same const dictionary
- Add per-view filter param types co-located with each view's action
- Tighten findings/resources filter maps and the findings display fn to their params

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Detect and extract the provider-scope filter keys from search params
- Single source of truth for the scan vs provider-filter XOR

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- getCompliancesOverview and getComplianceRequirements forward provider
  filters and drop scan_id when present (backend XOR)
- getComplianceRequirements now accepts an optional scanId

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- buildComplianceDetailPath carries provider filters instead of scanId
  in aggregated mode, preserving the scan vs provider XOR on drill-down

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Mount provider type/account and provider group selectors in the
  compliance filter bar; selecting a scan or provider filter clears the
  other (XOR)
- Aggregate frameworks across the latest scan per matching provider;
  hide the ThreatScore badge while provider filters are active
- Hide the per-scan CIS PDF and carry provider filters into the
  card drill-down in aggregated mode

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Detail page resolves requirements/metadata across provider filters when
  present; per-scan affordances (PDF, scan header, ThreatScore) degrade
- Requirement findings scope by provider filters instead of a single scan
  in aggregated mode

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8eb362f9-a967-4394-8949-1cfa9da394cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/compliance-provider-filter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Pablo F.G added 2 commits June 23, 2026 11:53
Aggregated mode sent provider filters with no scan/date to /findings, which
the API rejects with 400, so requirement findings always rendered empty. Use
/findings/latest in aggregated mode (needs neither; scopes to the latest scan
per matching provider) and keep /findings for single-scan mode.

Also tidies the provider-filter helpers (review nits):
- Derive the filter keys/type from a FILTER_FIELD subset const
- Accept ReadonlyURLSearchParams so call sites drop the search-params wrap

Adds a regression test covering both aggregated and single-scan modes.
Base automatically changed from feature/add-provider-group-filter to master June 25, 2026 13:32
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.

1 participant