feat: add EditUserModal for admin user profile management#347
feat: add EditUserModal for admin user profile management#347nap-liu wants to merge 1 commit intodataelement:mainfrom
Conversation
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>
wisdomqin
left a comment
There was a problem hiding this comment.
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 quotaPATCH /{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— updateUser.display_nameemail— updateIdentity.email(with uniqueness check)primary_mobile— updateIdentity.phone(with uniqueness check)new_password— hash and updateIdentity.password_hashis_active— updateUser.is_active(with guard: cannot disableplatform_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.
Summary
Test plan