Skip to content

Conversation

@alejandrobailo
Copy link
Contributor

@alejandrobailo alejandrobailo commented Dec 30, 2025

Context

Unify provider filter parameter naming between frontend and API. The findings endpoint now accepts both provider and provider_id parameters, allowing the frontend to use provider_id__in consistently across all pages without translation.

Description

  • Add provider_id and provider_id__in filter aliases to CommonFindingFilters in the API, enabling both parameter names to work on findings endpoints
  • Update all frontend components to use provider_id__in consistently when navigating to findings page (risk-plot, sankey-chart, severity-over-time, status-chart, watchlist, attack-surface, threat-map)
  • Remove mapProviderFiltersForFindings helper functions from lib/provider-helpers.ts - no longer needed since API accepts both parameters
  • Simplify AccountsSelector and ProviderTypeSelector by removing dual filter key handling

Steps to review

  1. API backward compatibility: Verify api/src/backend/api/filters.py:95-102 - both provider and provider_id params point to the same field (scan__provider__id)
  2. Frontend consistency: Confirm all navigation to findings uses provider_id__in:
    - risk-plot-client.tsx:48
    - finding-severity-over-time.tsx:69
    - sankey-chart.tsx (removed mapProviderFiltersForFindings calls)
  3. Removed helper functions: Verify lib/provider-helpers.ts no longer exports mapProviderFiltersForFindings or mapProviderFiltersForFindingsObject
  4. Test navigation: Click through from overview charts (Risk Plot, Sankey, Status Chart, Watchlist) to findings page - verify provider filters are preserved and results are correctly filtered
  5. Type safety: Run pnpm run typecheck to ensure no type errors from removed imports

Checklist

UI

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video of the functionality flow (if applicable) - Mobile (X < 640px)
  • Screenshots/Video of the functionality flow (if applicable) - Table (640px > X < 1024px)
  • Screenshots/Video of the functionality flow (if applicable) - Desktop (X > 1024px)
  • Ensure new entries are added to CHANGELOG.md, if applicable.

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

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

@alejandrobailo alejandrobailo self-assigned this Dec 30, 2025
@alejandrobailo alejandrobailo requested review from a team as code owners December 30, 2025 13:48
@alejandrobailo alejandrobailo changed the title feat: add new findings table cell components fix: account filter param diff Dec 30, 2025
Copy link
Contributor

@AdriiiPRodri AdriiiPRodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this happens in more endpoints, so we will need to add the ProviderIdAdaptaerMixin in others filters no?

@alejandrobailo
Copy link
Contributor Author

I think this happens in more endpoints, so we will need to add the ProviderIdAdaptaerMixin in others filters no?

You're right, thanks!

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.

3 participants