RelativeRoleTagWidget
Component Detail
Description
A compact inline widget rendered on the relative record and linked case view that displays the current role tag and allows coordinators or peer mentors to change it. It renders a dropdown populated from the predefined role vocabulary and commits the selection immediately on change. The widget shows the active tag as a labeled badge when in read-only mode.
relative-role-tag-widget
Sources & reasoning
The enumeration of specific relative types (foreldre, søsken, nærmeste omsorgsperson) in line 121 implies that the system must distinguish between different family roles - storing them as typed tags rather than anonymous entries. Phase 1 MUST confirmed on line 161. Role tagging is the feature that makes the relative type explicit and filterable, completing the family-unit data model required by Barnekreftforeningen's workflow.
-
docs/source/likeperson.md · line 121-122Appen må støtte registrering av pårørende (foreldre, søsken, nærmeste omsorgsperson) som egne kontaktsubjekter knyttet til samme sak.
-
docs/source/likeperson.md · line 161Pårørende database | ✓ | - | - | - | ✓ | MUST (Barnekreft) | 1
Responsibilities
- Render the current role tag as a readable badge on the relative record and case view
- Provide a dropdown for selecting a role from the predefined tag list
- Emit a role-change event with the link ID and selected role on user selection
- Disable editing when the current user lacks coordinator or peer mentor permissions
- Show a loading state while the role update is being persisted
Interfaces
getRoleOptions(): RoleTag[]
setRole(linkId: string, role: RoleTag): void
onRoleChanged(callback: (linkId: string, role: RoleTag) => void): void