ContactEditForm
Component Detail
User Interface
medium complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Provides a role-scoped form for editing contact fields, exposing limited fields to peer mentors and full access to coordinators. Applies edits optimistically to the local database and triggers sync via ContactUpdateService. Displays a corrective error message and rolls back fields on sync failure.
contact-edit-form
Sources & reasoning
Architecture section (line 292) explicitly names contact detail and edit as MVP screens. The accessibility mandate (line 36) defines vertical scroll and back-button navigation as hard constraints for this screen. MVP scope narrative (line 320) confirms Phase 1 for contact management. All evidence places this feature at MVP; Phase 1 = MVP by ordinal mapping.
-
docs/source/likeperson.md · line 292Contact detail, edit, and peer mentor profile screens
-
docs/source/likeperson.md · line 36Tilbakeknapp fremfor sidelengs-sveip. Vertikal scroll er normen.
-
docs/source/likeperson.md · line 320Kontaktliste og likepersonsoversikt
Responsibilities
- Render editable fields filtered by the current user's role (peer mentor vs coordinator)
- Submit changes optimistically and reflect updated values immediately in the UI
- Receive and display corrective error messages when sync rollback occurs
- Validate field inputs before committing to the local database
- Coordinate with ContactUpdateService to persist and sync changes
Interfaces
submitEdit(contactId: string, fields: Partial<ContactProfile>): Promise<void>
rollbackFields(original: ContactProfile): void
getEditableFields(role: UserRole): FieldDefinition[]