ENG-2347: Add privacy assessment configuration model and Admin UI#7470
ENG-2347: Add privacy assessment configuration model and Admin UI#7470thabofletcher merged 37 commits intomainfrom
Conversation
Add a settings modal for privacy assessments with: - Two LLM model override fields (assessment and chat models) - Re-assessment scheduling with preset and custom cron options - Slack channel selection for questionnaire notifications - Test connection button for Slack channel verification Backend changes: - New PrivacyAssessmentConfig model and migration - Register model in db/base.py for Alembic Frontend changes: - AssessmentSettingsModal component with Ant Design components - API slice endpoints for config CRUD and Slack testing - Settings gear icon in PageHeader on privacy-assessments page - Chat channels endpoint for Slack channel dropdown Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update path from "Settings > Chat Providers" to "Settings > Notifications > Chat providers" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the gear icon button after the "Evaluate assessments" button Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add "Yearly (Jan 1st)" option with cron expression "0 9 1 1 *" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use Form.useWatch for slack_channel_id so the button's disabled state updates reactively when a channel is selected from the dropdown. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add onDropdownVisibleChange handler to refetch channels from Slack each time the dropdown is opened, ensuring the list stays current. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add refetch of config when modal opens to get latest data - Reset form fields when modal opens to clear stale state - Change default assessment model from claude-sonnet-4 to claude-opus-4 - Update fallback placeholder to match new default Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove form.resetFields() call that was clearing the form before config data could be loaded. Use formInitialized state to track whether the form has been populated for this modal session. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ensures form is properly destroyed when modal closes, preventing any stale state from persisting between opens. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Re-add refetchConfig() call when modal opens to ensure we get the latest data from the server instead of stale cached data. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
- Add cron expression validation to AssessmentSettingsModal using existing parseCronExpression utility from cronHelpers.ts - Add component tests for cron validation and frequency preset handling - Add model tests for get_assessment_model and get_chat_model methods to cover branching logic (None config, empty override, custom override) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove complex form validation tests that rely on antd's async validation behavior. Keep frequency preset handling tests and parseCronExpression validation tests which test the core logic. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Greptile SummaryAdds a new Key changes:
Issues found:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 0fe2e91 |
...alembic/migrations/versions/xx_2026_02_23_1400_074796d61d8a_add_privacy_assessment_config.py
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx
Outdated
Show resolved
Hide resolved
Update down_revision from d3f08ca31314 to c69ef1fecb20 to fix migration chain after c69ef1fecb20 (jira_ticket_task) was added. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lucanovera
left a comment
There was a problem hiding this comment.
The new settings modal works well and the code looks good. I will just make some styling updates to make the modal content fit without scrolling.
Resolved conflict in .fides/db_dataset.yml to include both: - privacy_assessment_config table from this branch - privacy_assessment_task_id field and privacy_assessment_task table from main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…es into ENG-2347-assessment-config-ui
Update downrev from c69ef1fecb20 to 12c3de065e27 (add_assessment_task) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…es into ENG-2347-assessment-config-ui
lucanovera
left a comment
There was a problem hiding this comment.
Nice work! The modal works great. Adding an endpoint to fetch the default modals was a nice touch. The frequency picker with common options + custom cron looks great.
I've taken the liberty of styling the modal to shorter, adjusted the warning, added error handling and refactored the initialization of the form.
Thank you so much for the extra help! |
Update downrev from 12c3de065e27 to d83a1f2b7e4c (migrate_system_id_fk_to_link_table - the actual head of main) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ticket ENG-2347
Description Of Changes
Add backend model and Admin UI for configuring privacy assessment settings. This allows administrators to:
Backend:
PrivacyAssessmentConfigSQLAlchemy model (single-row table per tenant)get_assessment_model()andget_chat_model()with fallback to defaultsFrontend:
AssessmentSettingsModalcomponent accessible via settings button on Privacy Assessments pageCode Changes
src/fides/api/models/privacy_assessment_config.py- New SQLAlchemy model with helper methods for getting effective modelssrc/fides/api/alembic/migrations/versions/xx_2026_02_23_1400_074796d61d8a_add_privacy_assessment_config.py- Migration to create tablesrc/fides/api/db/base.py- Register new modelclients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx- Settings modal componentclients/admin-ui/src/features/privacy-assessments/privacy-assessments.slice.ts- RTK Query endpoints for config APIclients/admin-ui/src/features/privacy-assessments/types.ts- TypeScript types for configclients/admin-ui/src/features/chat-provider/chatProvider.slice.ts- Add getChatChannels queryclients/admin-ui/src/pages/privacy-assessments/index.tsx- Add settings button to page headerSteps to Confirm
Run the migration:
Verify table created:
In Admin UI, navigate to Privacy Assessments page and click the settings (gear) icon
Verify the modal opens with:
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works