Skip to content

Conversation

@lucanovera
Copy link
Contributor

@lucanovera lucanovera commented Oct 24, 2025

Ticket ENG-1426

Description Of Changes

This PR replaces the privacy request filter functions and filter modal with all new components and hook that use updated libraries and code patterns. The filter state is no longer kept in a Redux, instead it is kept in sync with the url params using the nuqs library. The filter modal now uses ant components and form.

Code Changes

  • Added usePrivacyRequestsFilters.ts hook to replace old redux state handling
  • Added PrivacyRequestFiltersModal as the new filter modal

Steps to Confirm

  1. Login to admin-ui (Recommended to use the preview link with nightly build credentials)
  2. Go to /settings/about and enable the "Privacy request v2" feature flag
  3. Go to the Privacy Request > Request Manager (new) option
  4. Click the Filters button and try out different filters
  5. Check that after clicking Done on the filter modal:
    a) Results are updated to reflect the filter
    b) The url gets updated to include as queryParams all the filters you've applied
    c) If you reload the page with filters applied, the page should show the same results and the filter modal should show all the filters applied
  6. Clear filters button inside the modal should work too
  7. Check that when having filters applied, the Filters buttons shows the count of how many filters you've applied

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed (UX review will happen in different ticket)
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@lucanovera lucanovera requested a review from a team as a code owner October 24, 2025 16:11
@lucanovera lucanovera requested review from jpople and removed request for a team October 24, 2025 16:11
@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Oct 31, 2025 1:40pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Oct 31, 2025 1:40pm

greptile-apps[bot]

This comment was marked as outdated.

@lucanovera
Copy link
Contributor Author

@greptileai review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR successfully refactors the privacy request filter system from Redux-based state management to URL-based state using the nuqs library. The new implementation keeps filter state synchronized with URL query parameters, making filters shareable and persistent across page reloads.

Key changes:

  • Created usePrivacyRequestsFilters hook to manage filter state with URL synchronization
  • Built new PrivacyRequestFiltersModal using Ant Design components
  • Removed Redux dependency from PrivacyRequestsDashboard
  • Added useCallback wrapper to resetPagination in usePagination hook for dependency array stability

Issue found:

  • Form in modal won't sync when modalFilters changes externally (requires useEffect to update form values)

Confidence Score: 4/5

  • This PR is mostly safe to merge with one logical issue that should be fixed
  • The refactoring is well-structured and removes technical debt by eliminating Redux state. The hook implementation is clean and the URL synchronization pattern is consistent with the codebase. However, there's a form sync issue in the modal that could cause stale data to display if filters change externally while the modal is open. This is fixable with a simple useEffect.
  • Pay close attention to clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestFiltersModal.tsx - the form needs to sync when modalFilters change

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/privacy-requests/dashboard/hooks/usePrivacyRequestsFilters.ts 4/5 New hook to manage privacy request filters with URL sync via nuqs, replacing Redux state
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestFiltersModal.tsx 3/5 New filter modal using Ant Design components; form won't sync when modalFilters change externally
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestsDashboard.tsx 5/5 Refactored to use new filter hook and modal, removing Redux dependency

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

"search",
parseAsString.withDefault("").withOptions({ throttleMs: 100 }),
);
const filters = useSelector(selectPrivacyRequestFilters);
Copy link
Contributor

Choose a reason for hiding this comment

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

Love to see these Redux usages going away.

Copy link
Contributor

@jpople jpople left a comment

Choose a reason for hiding this comment

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

Tested locally, working as expected, code looks good to me. Nice refactor!

Merged via the queue into main with commit 53b118a Oct 31, 2025
46 checks passed
@lucanovera lucanovera deleted the ENG-1426-Refactor-request-manager-filters branch October 31, 2025 14:00
adamsachs pushed a commit that referenced this pull request Nov 3, 2025
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.

3 participants