Skip to content

[Add] self-service "Edit my profile" in the Session menu; fixes #722#776

Merged
samatstariongroup merged 1 commit into
developmentfrom
GH722-edit-own-person
May 4, 2026
Merged

[Add] self-service "Edit my profile" in the Session menu; fixes #722#776
samatstariongroup merged 1 commit into
developmentfrom
GH722-edit-own-person

Conversation

@samatstariongroup
Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the COMET-WEB code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

Adds an Edit my profile entry to the Session dropdown that opens a tabbed popup populated from Session.ActivePerson:

  • Basic — GivenName, Surname, OrganizationalUnit
  • E-Mail / Telephone Number — list of existing entries with add/remove and default selection
  • Password — opt-in checkbox; password + confirmation, save disabled until they match

Save goes through the existing ISessionService.CreateOrUpdateThingsWithNotification pipeline, so success/error toasts and the SDK write path are reused. Admin-only fields (PersonRole, Organization, IsActive, IsDeprecated) are deliberately not surfaced.

Implementation notes

  • New PersonEditForm + PersonEditViewModel (and contact row VMs) live in COMET.Web.Common so the Session menu can reach them without inverting the project dependency into the admin UserManagementForm.
  • ISessionMenuViewModel gains IsOnEditPersonMode, PersonEditViewModel, OpenEditPersonPopup(), with auto-close on save.
  • The button + popup are added to both SessionMenu.razor (top-bar) and SessionSideBar.razor (sidebar — the variant the running app uses; inherits SessionMenu's code but not its markup).
  • .session__buttons restyled into two stacked groups separated by a border-top so the profile action is visually grouped apart from Refresh / Log out.

Risks

  • Self-locking on password change — a user changing their own password may need to re-auth on next request; surfaced via NotificationDescription.OnError. Auto-relogin is a follow-up.
  • Removing existing emails/phones — relies on the COMET server treating absence-on-update as a delete, same as the admin form.

Test plan

  • dotnet build COMETwebapp.sln --no-restore
  • dotnet test --filter "FullyQualifiedName!~IntegrationTests" — 652 / 652 passing baseline
  • Manual smoke against cdp4services-public.cdp4.org: open Edit my profile → edit name → Save → reopen and verify; add a second e-mail set as default → reopen and verify; change password (mismatch disables Save) → Save → success toast; Cancel performs no write.

@samatstariongroup samatstariongroup force-pushed the GH722-edit-own-person branch from 83c4205 to cc89d01 Compare May 3, 2026 08:43
@samatstariongroup samatstariongroup merged commit 0a5cb0f into development May 4, 2026
10 of 11 checks passed
@samatstariongroup samatstariongroup deleted the GH722-edit-own-person branch May 4, 2026 09:46
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.

3 participants