feat: conditionally render room assignment field in participant edit form

This commit is contained in:
Björn Fromme
2025-11-25 17:30:23 +01:00
parent 9b2ad3845d
commit f5f5d43ab5
4 changed files with 70 additions and 21 deletions
@@ -263,8 +263,11 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
'required' => new ApplicantCondition(),
];
// Render assignedRoomId field as static text when only one room type is selected (auto-assigned by RoomAssignmentService)
// Room assignment field:
// - Hidden until date of birth is provided (age determines room eligibility, e.g., Baby rooms)
// - Rendered as static text when only one room type is selected (auto-assigned by RoomAssignmentService)
$this->fieldStateConditions['assignedRoomId'] = [
'hidden' => CompositeCondition::not($dateOfBirthProvidedCondition),
'static_text' => new SingleRoomTypeCondition(),
];