ENG-2797: Add request type selector to policy creation form#7545
ENG-2797: Add request type selector to policy creation form#7545gilluminate merged 5 commits intomainfrom
Conversation
Adds an action type (Access / Erasure / Consent) selector to the Create Policy modal. On submit, the selected type is sent as action_type in the PATCH /dsr/policy request, which auto-generates a default rule and seeds default data-category targets on the backend. The field is hidden when editing an existing policy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR adds a required "Request type" selector (Access / Erasure / Consent) to the Create Policy modal, which sends
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 42c7c06 |
jpople
left a comment
There was a problem hiding this comment.
Tested locally-- ran into a bug where values in the form aren't reset if you close and reopen the modal. Also wondering if it wouldn't be better to still show but just disable the input while editing, like we do with the key?
|
Good catches! Fixed both:
|
- Reset form fields on modal close to fix stale values bug - Show request type selector as disabled (not hidden) when editing - Add aria-label to request type select for accessibility - Remove unnecessary null union from action_type type - Use ActionType.ACCESS enum instead of magic string in test - Make key field not required when editing (consistent with request type) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Ticket ENG-2797
Description Of Changes
Adds a required Request type selector (Access / Erasure / Consent) to the Create Policy modal. The selected type is sent as
action_typein thePATCH /dsr/policyrequest, which triggers the existing backend logic to auto-generate a default rule and seed the default data-category targets. For erasure policies, HMAC masking is applied automatically.The field is not shown when editing an existing policy, since action type is immutable after creation.
Code Changes
clients/admin-ui/src/features/policies/policy.slice.ts- Addedaction_typetoPolicyCreateUpdateinterfaceclients/admin-ui/src/features/policies/PolicyFormModal.tsx- Added Request typeSelectfield (create-only, required), updated submit handler to includeaction_typeclients/admin-ui/cypress/e2e/policies/policy-crud.cy.ts- Added tests for type selector visibility, validation, and payload; updated existing submit test to select a typeSteps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works