Fix assessment detail questionnaire progress and source labels#7571
Fix assessment detail questionnaire progress and source labels#7571lucanovera merged 4 commits intomainfrom
Conversation
- Use questionnaire API response for progress counts instead of recomputing from question_groups (which excluded answered questions) - Add team_input to AnswerSource enum so Slack answers show labels - Remove broken getSlackQuestions utility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRemoved Slack-specific helper and memoization; introduced a TEAM_INPUT answer source (constants/types); switched QuestionnaireStatusBar to use assessment.questionnaire counts; removed a public utils re-export; changed update-answer API route; added ordering to AssessmentTemplate.questions. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR fixes two display bugs in the privacy assessment detail questionnaire view: the progress bar was always showing 0/N because Key changes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 7d94a57 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/fides/api/models/privacy_assessment.py (1)
163-163: Add a deterministic tie-breaker to the relationship ordering.On Line 163, ordering by only
group_orderandquestion_ordercan still produce nondeterministic row order when values tie. Add a final stable key (e.g.,id) to keep ordering consistent across queries.Suggested change
- order_by="AssessmentQuestion.group_order, AssessmentQuestion.question_order", + order_by="AssessmentQuestion.group_order, AssessmentQuestion.question_order, AssessmentQuestion.id",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/fides/api/models/privacy_assessment.py` at line 163, The relationship/query ordering for AssessmentQuestion currently uses only "AssessmentQuestion.group_order, AssessmentQuestion.question_order", which can yield nondeterministic order when those fields tie; update the ordering to append a stable tie-breaker such as "AssessmentQuestion.id" (with the same sort direction, e.g., ascending) so the relationship in privacy_assessment.py (the AssessmentQuestion ordering clause) becomes deterministic across queries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/fides/api/models/privacy_assessment.py`:
- Line 163: The relationship/query ordering for AssessmentQuestion currently
uses only "AssessmentQuestion.group_order, AssessmentQuestion.question_order",
which can yield nondeterministic order when those fields tie; update the
ordering to append a stable tie-breaker such as "AssessmentQuestion.id" (with
the same sort direction, e.g., ascending) so the relationship in
privacy_assessment.py (the AssessmentQuestion ordering clause) becomes
deterministic across queries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bb24cf6e-c365-4811-9f85-4deb93ce5df6
📒 Files selected for processing (3)
clients/admin-ui/src/features/privacy-assessments/constants.tsclients/admin-ui/src/features/privacy-assessments/privacy-assessments.slice.tssrc/fides/api/models/privacy_assessment.py
Co-authored-by: Adrian Galvan <galvana@uci.edu> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Lucano Vera <lucanovera@live.com.ar>
Summary
getSlackQuestionsutilityteam_inputvariant to frontendAnswerSourceenum so Slack-answered questions display the "Team input" label correctlyutils.tsfile that contained the broken filtering logicTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor
Bug Fixes