Uh oh!
There was an error while loading. Please reload this page.
feat(admin): add send-password-reset-email toggle to create user modal - #6330
feat(admin): add send-password-reset-email toggle to create user modal#6330TheodoreSpeaks wants to merge 1 commit into
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Submit/close/cancel stay disabled while either create or reset-email is pending. If the user is created but the email fails, the admin still gets the new user in the list and an error toast; success path shows a confirmation toast. Unit tests cover toggle off/on, pending UI, and the email-failure path. Reviewed by Cursor Bugbot for commit bd4609c. Bugbot is set up for automated code reviews on this repo. Configure here. |
TheodoreSpeaks
commented
Aug 6, 2026
Superseded by #6328, which shipped the same capability to staging first (as a 'Set a password' / 'Email a reset link' mode on the same modal). Closing in favor of that. |
Greptile SummaryThe PR adds an optional password-reset email step after an administrator creates a user, while preserving successful user creation when email delivery fails.
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking modal-structure consistency issue in the new toggle field. The user-creation and optional reset-email paths retain their intended success and failure behavior, but the new labeled switch bypasses the standardized ChipModalField wrapper required for controls inside ChipModalBody. Files Needing Attention: apps/sim/app/workspace/[workspaceId]/settings/components/admin/add-user-modal.tsx
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/settings/components/admin/add-user-modal.tsx | Adds the optional post-creation reset-email flow and pending-state handling; the new labeled switch does not use the repository-required ChipModalField structure. |
| apps/sim/app/workspace/[workspaceId]/settings/components/admin/add-user-modal.test.tsx | Extends modal tests to cover the toggle-off, toggle-on, request-pending, and email-failure paths. |
Sequence Diagram
sequenceDiagram
participant Admin
participant Modal as Create-user modal
participant Users as Add-user mutation
participant Reset as Reset-password mutation
Admin->>Modal: Submit user details
Modal->>Users: Create user
Users-->>Modal: Created user
alt Reset-email toggle enabled
Modal->>Reset: Send reset email
alt Email request succeeds
Reset-->>Modal: Success
Modal-->>Admin: Show success toast
else Email request fails
Reset-->>Modal: Error
Modal-->>Admin: Show partial-success error toast
end
end
Modal-->>Admin: Close modal and report created user
Reviews (1): Last reviewed commit: "feat(admin): add send-password-reset-ema..." | Re-trigger Greptile
| disabled={isSubmissionPending} | ||
| required | ||
| /> | ||
| <div className='flex items-center justify-between px-2'> | ||
| <Label htmlFor={resetEmailToggleId}>Send password reset email</Label> | ||
| <Switch | ||
| id={resetEmailToggleId} | ||
| checked={sendResetEmail} | ||
| disabled={isSubmissionPending} | ||
| onCheckedChange={(checked) => { | ||
| setSendResetEmail(checked) | ||
| addUser.reset() | ||
| }} |
There was a problem hiding this comment.
Use the standard modal field wrapper
The new labeled switch is rendered as a raw row inside ChipModalBody, bypassing the required ChipModalField type='custom' structure and its standardized field layout and accessibility behavior.
Context Used: Component patterns and structure for React compone... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
/api/auth/forget-passwordcontract as the login form's "Forgot password", so the user gets the identical email and reset pageType of Change
Testing
Tested via unit tests (8 cases, incl. toggle off/on and the email-failure path).
bun run lint,type-check,check:api-validation:strict,check:react-query, and the full ship audit suite pass.Checklist