Skip to content

feat: residents PR 2#1104

Open
CK-7vn wants to merge 4 commits intoresidents-1from
CK-7vn/total-refactor-residents-2
Open

feat: residents PR 2#1104
CK-7vn wants to merge 4 commits intoresidents-1from
CK-7vn/total-refactor-residents-2

Conversation

@CK-7vn
Copy link
Member

@CK-7vn CK-7vn commented Mar 4, 2026

Pre-Submission PR Checklist

  • No debug/console/fmt.Println statements
  • Unnecessary development comments removed
  • All acceptance criteria verified
  • Functions according to ticket specifications
  • Tested manually where applicable
  • Branch rebased with latest main
  • No business logic exists within the database layer

Description of the change

Pull-Requests for Residents 2
Adds per-row action buttons (Edit, Reset Password, dropdown menu) and six dialog components for managing individual residents: Edit Profile, Reset Password (confirm + result with copy), Deactivate Account, Delete Resident, and Transfer Resident (DA only).
Deactivated residents show "No actions available" with all action buttons hidden.

New file: frontend-v2/src/components/residents/ResidentModals.tsx
Modified: frontend-v2/src/pages/admin/StudentManagement.tsx, frontend-v2/src/types/user.ts, backend/src/database/users.go

Requirements

Edit Resident

  • 359: Edit button opens edit dialog
  • 360: Save updates resident information
  • 361: Successful edit shows toast notification
  • 389: All fields are editable
  • 392: Cancel discards changes
  • 393: Dialog pre-populates with resident data
  • 669: Edit Profile button hidden for deactivated

Reset Password

  • 369: Reset password button opens confirmation
  • 372: Success toast displays after reset
  • 375: Reset generates temporary password
  • 395: Copied state shows checkmark temporarily
  • 400: Confirmation dialog explains temporary password
  • 401: Copy button copies password to clipboard
  • 670: Reset Password button hidden for deactivated

Deactivate Account

  • 410: Deactivate option in action menu
  • 411: Deactivate dialog opens with warning
  • 412: Deactivate lists consequences
  • 413: Deactivate requires typing Resident ID
  • 414: Submit disabled until ID matches
  • 419: Deactivated badge appears after action
  • 421: Success toast after deactivation

Delete Resident

  • 390: Successful deletion shows toast
  • 391: Submit button uses destructive styling
  • 394: Submit disabled until ID matches exactly
  • 415: Delete option in action menu
  • 416: Delete dialog opens with warning
  • 417: Delete warns action cannot be undone
  • 418: Delete requires typing Resident ID
  • 420: Success toast after deletion

Transfer Resident (DA only)

  • 135: Transfer disabled for deactivated residents
  • 136: Transfer Resident option appears for DA
  • 137: Transfer requires typing Resident ID to confirm
  • 184: Submit disabled until ID matches
  • 422: Transfer dialog opens
  • 423: Shows current facility
  • 424: Facility dropdown excludes current
  • 425: Unenrollment warning displayed
  • 426: Program conflicts listed
  • 427: What happens next section
  • 428: ID confirmation input
  • 429: Transfer calls API
  • 430: Success toast after transfer
  • 431: Resident list refreshes after transfer

Action Menu

  • 671: Action dropdown menu hidden for deactivated

Screenshot(s)

This PR

image image image image image image

Redesign

image image image image image

Additional context

  • Backend: Added Preload("Facility") to GetCurrentUsers so facility data is available in list responses
  • Frontend: Added facility_id to TypeScript User type to match Go backend response; TransferDialog falls back to facilities list lookup if nested facility object is missing
  • Username field is intentionally disabled (read-only) in the Edit dialog

@CK-7vn CK-7vn requested a review from a team as a code owner March 4, 2026 21:27
@CK-7vn CK-7vn requested review from calisio and removed request for a team March 4, 2026 21:27
@CK-7vn CK-7vn force-pushed the residents-1 branch 5 times, most recently from 2c42845 to d561dd1 Compare March 7, 2026 06:14
@CK-7vn CK-7vn force-pushed the CK-7vn/total-refactor-residents-2 branch from a866e2e to 5ae7678 Compare March 7, 2026 06:24
@CK-7vn CK-7vn force-pushed the CK-7vn/total-refactor-residents-2 branch from 5ae7678 to 82071be Compare March 9, 2026 18:42
@carddev81 carddev81 requested review from carddev81 and removed request for calisio March 9, 2026 18:54
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings:

Fac/Dept Admin

  1. Missing tooltips on action icons.
  2. Need more gap between buttons and Resident ID text field on Edit Resident Profile
  3. Figma allows edit of username
  4. Incorrect color of toast when password reset and not in correct location
  5. Incorrect color of toast when editing a user and not in correct location (fix all action toasts)
  6. Incorrect bullets type on Deactivate account modal---this is displaying hyphens
  7. Incorrect icon for Transfer resident.
  8. Transfer Resident Modal Programs 'not available' list showing program name and class name, per Figma only show the program name.

@CK-7vn
Copy link
Member Author

CK-7vn commented Mar 10, 2026

  1. Done.
  2. done
  3. We don't actually allow editing of usernames in the backend. I noted in the initial PR comment that I chose not to include it on purpose. I don't think this functionality adds value personally and I don't think admins will be very happy getting a million requests to change usernames so I don't foresee it actually being used.
  4. done
  5. done
  6. done
  7. done
  8. done

@carddev81 carddev81 self-requested a review March 11, 2026 13:55
@carddev81
Copy link
Contributor

  1. Done.
  2. done
  3. We don't actually allow editing of usernames in the backend. I noted in the initial PR comment that I chose not to include it on purpose. I don't think this functionality adds value personally and I don't think admins will be very happy getting a million requests to change usernames so I don't foresee it actually being used.
  4. done
  5. done
  6. done
  7. done
  8. done

@calisio I believe you coded the figma to allow editing a username on purpose where the username can be updated now? I thought maybe you brought this up in a meeting? Can you confirm whether or not this is wanted before we proceed with this PR.

Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Tooltips exist now, but they don't match figma
  2. Need more gap between buttons and Resident ID text field on Edit Resident Profile (previous issue)

current:

Image

target:

Image
  1. Toasts are located at the bottom but toast messages don't match figma

@CK-7vn CK-7vn force-pushed the CK-7vn/total-refactor-residents-2 branch from 2c9122c to 3efb73f Compare March 11, 2026 17:51
@CK-7vn CK-7vn force-pushed the CK-7vn/total-refactor-residents-2 branch from 3efb73f to 43bd8d0 Compare March 11, 2026 20:18
@carddev81 carddev81 self-requested a review March 11, 2026 20:28
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks/Tests good

@CK-7vn CK-7vn force-pushed the CK-7vn/total-refactor-residents-2 branch from 43bd8d0 to 2507bf5 Compare March 12, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants