Skip to content

feat: add EditUserModal for admin user profile management#347

Open
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/admin-user-frontend
Open

feat: add EditUserModal for admin user profile management#347
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/admin-user-frontend

Conversation

@nap-liu
Copy link
Copy Markdown

@nap-liu nap-liu commented Apr 8, 2026

Summary

  • Frontend companion for the admin user profile editing API (PATCH /users/{id}/profile)
  • EditUserModal: edit display_name, email, phone, reset password, toggle is_active
  • Integrated into UserManagement page with Edit button per user row

Test plan

  • Frontend build: tsc + vite build passed with 0 errors

Add a modal component that allows admins to edit user display_name,
email, phone/mobile, reset password, and toggle is_active status.
The modal calls PATCH /api/users/{id}/profile. Each user row now has
an "Edit Info" button alongside the existing quota editor. Added
corresponding i18n keys for both en.json and zh.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@wisdomqin wisdomqin left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @nap-liu! The frontend component looks clean and well-structured. However, this PR cannot be merged in its current state because the backend API it depends on does not exist.

Missing backend endpoint

The handleSave function calls:

PATCH /users/{id}/profile

But this endpoint is not implemented in backend/app/api/users.py. The file currently only has:

  • PATCH /{user_id}/quota — update quota
  • PATCH /{user_id}/role — update role

There is no /{user_id}/profile route. Merging this as-is would result in a 404 error every time an admin tries to save user edits.

What is needed to complete this

The backend endpoint needs to handle at minimum:

  • display_name — update User.display_name
  • email — update Identity.email (with uniqueness check)
  • primary_mobile — update Identity.phone (with uniqueness check)
  • new_password — hash and update Identity.password_hash
  • is_active — update User.is_active (with guard: cannot disable platform_admin)

This also needs to be restricted to platform_admin / org_admin roles.

Suggestion

Could you add the backend implementation in the same PR? Alternatively, we can implement the backend side and merge both together. Let us know which you prefer and we are happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants