-
Notifications
You must be signed in to change notification settings - Fork 85
ENG-942 #6504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENG-942 #6504
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
10670a8
to
0916c26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR improves the consent reporting functionality in the Fides admin UI by addressing performance and user experience issues. The primary changes implement open-ended pagination to solve performance problems with large consent datasets and fix timezone handling for accurate date filtering.
Key Technical Changes:
- Pagination Refactor: Replaces server-side pagination with a custom
usePagination
hook that syncs pagination state to URL parameters for better user experience - Performance Optimization: Removes expensive total count calculations by setting
includeTotal: false
in API calls, using item count comparison to determine pagination state instead - Timezone Fix: Modifies date handling in
startOfDayIso
andendOfDayIso
functions to process dates in local timezone before UTC conversion, ensuring accurate date range filtering - UI Enhancement: Implements custom pagination controls with previous/next buttons that disable appropriately based on data availability
The changes integrate well with the existing Fides codebase architecture, utilizing the established Redux Toolkit Query patterns for API calls and maintaining consistency with other admin UI components. The pagination approach is particularly clever - by checking if the returned item count is less than the page size, it can determine when to disable the "Next" button without requiring expensive database count operations.
Important Files Changed
File Change Summary
Filename | Score | Overview |
---|---|---|
CHANGELOG.md |
5/5 | Documents three consent reporting improvements with proper categorization and PR references |
clients/admin-ui/src/features/consent-reporting/consent-reporting.slice.ts |
4/5 | Fixes timezone handling and adds optional includeTotal parameter for performance optimization |
clients/admin-ui/src/pages/consent/reporting/index.tsx |
4/5 | Major refactor implementing open-ended pagination with custom UI controls and URL state sync |
clients/admin-ui/src/features/common/hooks/usePagination.ts |
4/5 | Adds nextPage and previousPage functions to support the new pagination pattern |
Confidence score: 4/5
- This PR addresses legitimate performance and UX issues with well-architected solutions that integrate cleanly with existing code patterns
- Score reflects solid implementation choices and thorough changes, though the timezone fix could benefit from additional testing verification
- Pay close attention to the timezone handling changes in the consent reporting slice to ensure date ranges work correctly across different user timezones
Sequence Diagram
sequenceDiagram
participant User
participant ConsentReportingPage
participant usePagination
participant consentReportingApi
participant Backend
User->>ConsentReportingPage: "Load consent reporting page"
ConsentReportingPage->>usePagination: "Initialize pagination"
usePagination->>usePagination: "Set pageIndex=1, pageSize=25 (default)"
ConsentReportingPage->>consentReportingApi: "useGetAllHistoricalPrivacyPreferencesQuery({page, size, includeTotal: false})"
consentReportingApi->>Backend: "GET /historical-privacy-preferences"
Backend-->>consentReportingApi: "Return paginated results"
consentReportingApi-->>ConsentReportingPage: "Display privacy preferences data"
User->>ConsentReportingPage: "Select date range"
ConsentReportingPage->>ConsentReportingPage: "Convert dates to local start/end of day UTC ISO strings"
ConsentReportingPage->>consentReportingApi: "Re-query with date filters"
consentReportingApi->>Backend: "GET /historical-privacy-preferences?request_timestamp_gt=startOfDay&request_timestamp_lt=endOfDay"
Backend-->>ConsentReportingPage: "Return filtered results"
User->>ConsentReportingPage: "Click next page"
ConsentReportingPage->>usePagination: "nextPage()"
usePagination->>usePagination: "Update URL with page=pageIndex+1"
ConsentReportingPage->>consentReportingApi: "Query with new page index"
consentReportingApi->>Backend: "GET /historical-privacy-preferences?page=2"
Backend-->>ConsentReportingPage: "Return next page of results"
User->>ConsentReportingPage: "Change page size"
ConsentReportingPage->>usePagination: "updatePageSize(newSize)"
usePagination->>usePagination: "Reset to page 1, update URL with new size"
ConsentReportingPage->>consentReportingApi: "Query with new page size"
consentReportingApi->>Backend: "GET /historical-privacy-preferences?page=1&size=newSize"
Backend-->>ConsentReportingPage: "Return results with new page size"
4 files reviewed, 1 comment
0916c26
to
faa1c9e
Compare
e24871a
to
bc4ddf0
Compare
bc4ddf0
to
b173e93
Compare
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 59s |
Commit |
|
Committer | Tom Van Dort |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
0
|
|
0
|
|
0
|
|
4
|
View all changes introduced in this branch ↗︎ |
Tests for review
cypress/e2e/smoke_test.cy.ts • 1 failed test
Test | Artifacts | |
---|---|---|
Smoke test > can submit an access request from the Privacy Center |
Screenshots
Video
|
Closes ENG-942
Description Of Changes
Solves some problems that exist with the consent reporting page.
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works