Skip to content

feat: add faculty profile editing functionality and UI components - #50

Open
ishad05 wants to merge 2 commits into
developfrom
feat/faculty-profile-edit
Open

feat: add faculty profile editing functionality and UI components#50
ishad05 wants to merge 2 commits into
developfrom
feat/faculty-profile-edit

Conversation

@ishad05

@ishad05 ishad05 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Allow faculty to edit their profile photo and name

Closes #44.

What this does

  • Faculty can now change their profile photo and name from /faculty/settings
  • Click the avatar to upload a new photo, hover and click the ✕ to remove it
  • Click the pencil next to the name to edit first and last name inline, save with the check button
  • Sidebar avatar and name update right away, no page reload needed
  • Students are not touched, this is faculty only as the issue asked
Screenshot 2026-07-20 at 10 12 33 AM Screenshot 2026-07-20 at 10 13 09 AM

Pattern

  • Followed Frappe CRM's ProfileSettings.vue for the interaction (avatar as the upload button, pencil to edit name)
  • Two changes from CRM on purpose:
    • CRM writes the User doctype from the client. CS17 Profile is System Manager only and some faculty don't have that role, so I added a whitelisted update_my_profile endpoint guarded by faculty membership instead
    • CRM uploads the avatar as a private file. I upload public, because this site's existing profile pictures are already public, and private avatars would 403 the day a student needs to see one

Changes

  • api.py: new update_my_profile(first_name, last_name, profile_picture) endpoint
  • www/dashboard.py and get_user_profile: also return first_name / last_name so the edit form can seed values
  • useCurrentProfile: now a small store so a save updates the sidebar live
  • New FacultyProfileCard.tsx, wired into FacultySettingsPage
  • File uploads use the existing useFrappeFileUpload, Frappe's attach hook links the file to the profile

Tests

  • faculty-profile.spec.ts: API level, name save and derived full name, set and clear photo, blank last name rejected
  • faculty-profile-ui.spec.ts: real UI, rename persists across reload, photo upload and removal
  • Full suite is 154 green, yarn build and tsc --noEmit clean

Base automatically changed from fix/theme-persistence to develop July 20, 2026 08:17
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.

1 participant