CS-206 [Improvement] - Ability to be able to add Custom departments to be assigned for Policies, Evidence and People#3004
Conversation
custom-departments.mov |
|
@cubic-dev-ai Ultrareview |
@chasprowebdev Ultrareview monthly budget exhausted (12/12 used). Budget resets at the start of next month. |
|
@cubic-dev-ai please review it. |
@chasprowebdev I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 30 files
Confidence score: 3/5
- There is some merge risk because
apps/app/src/components/DepartmentSelect.tsxuses a reserved sentinel value (__add_custom__) that can collide with a real department name, which can block users from selecting that valid option. apps/api/src/risks/dto/get-risks-query.dto.tscurrently accepts whitespace-onlydepartmentquery values; those values remain truthy and can apply an unintended exact filter, leading to confusing empty results.- Given one medium-severity, high-confidence user-facing behavior issue and one lower-severity validation gap, this looks fixable but worth addressing before relying on this flow in production.
- Pay close attention to
apps/app/src/components/DepartmentSelect.tsxandapps/api/src/risks/dto/get-risks-query.dto.ts- sentinel collisions and whitespace query handling can both produce incorrect filtering behavior.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
@chasprowebdev I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai please review it |
@chasprowebdev I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 33 files
Confidence score: 3/5
- There is a concrete regression risk in
apps/app/src/actions/schema.ts: the policy update schema no longer enforces department content constraints, so empty/whitespace-only or oversized values could pass validation. - Given the issue’s medium severity (6/10) and high confidence (9/10), this introduces user-facing data quality risk and warrants caution before merging.
- Pay close attention to
apps/app/src/actions/schema.ts- restore/verify department field validation rules to prevent invalid policy updates.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai please review it. |
@chasprowebdev I have started the AI code review. It will take a few minutes to complete. |
|
approved |
|
🎉 This PR is included in version 3.70.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an automated pull request to merge chas/add-custom-departments into dev.
It was created by the [Auto Pull Request] action.
Summary by cubic
Enable custom department names across admin policies, policies, risks, tasks, and people by replacing enums with validated strings end to end. Adds a reusable DepartmentSelect with “Add custom…” and enforces a 64‑char limit. Addresses CS-206.
New Features
DepartmentSelectwith “Add custom…” flow, collision-safe sentinel, and 64‑char input cap; used on People, Policy, Task, and Risk pages. Updated Zod validation for Policies, Risks, and Tasks to require trimmed strings and enforce the 64‑char limit.Migration
packages/dbto convert department columns in Policy, Member, Risk, Task to TEXT and Policy.visibleToDepartments to TEXT[]. Preserve "none" defaults for Member and Task.Written for commit 3de0f6a. Summary will update on new commits.