Edit Contact Information with Validation
From the contact detail screen, the coordinator taps an edit button to navigate to the edit contact screen. All editable fields are presented in a form layout with inline validation. The contact form validator checks field formats in real-time (phone number format, email format, required fields). The contact edit service handles the update transaction, ensuring data integrity. Upon successful save, the user is returned to the detail screen with a confirmation toast. If validation fails, specific field-level error messages are shown in plain language. The edit screen also enforces that sensitive encrypted fields are edited through a separate confirmation flow.
User Story
Acceptance Criteria
- Given I am on the contact detail screen, When I tap the edit button, Then the edit contact screen opens with all current field values pre-populated
- Given I am on the edit contact screen, When I clear a required field and tap outside it, Then a plain-language error message appears beneath that field
- Given I am editing a phone number field, When I enter an invalid Norwegian phone number format, Then the field shows an inline validation error before I attempt to save
- Given I have made valid changes on the edit screen, When I tap the Save button, Then the contact edit service persists the changes and I am navigated back to the detail screen with a success confirmation
- Given I am on the edit contact screen, When I attempt to edit an encrypted sensitive field, Then a confirmation dialog appears requiring me to acknowledge I am viewing and modifying sensitive personal data
- Given I am editing a contact, When I tap the back button without saving, Then a discard changes confirmation dialog is shown before navigation proceeds
Business Value
Keeping contact data accurate is critical for correct assignment matching, Bufdir reporting, and legal compliance. Currently coordinators must contact administrators to update basic contact information, creating delays and errors. Enabling direct editing reduces administrative overhead, improves data quality, and ensures coordinators can respond immediately when a peer mentor's contact details change — for example when updating a return date after a period of illness.
Components
- Edit Contact Screen ui
- Contact Edit Service service
- Field Encryption Utilities infrastructure
- Contact Form Validator infrastructure
- Encrypted Field Display Widget ui
- Contact Detail Screen ui
- Contact Detail Repository data
- Sensitive Field Warning Dialog ui