fix: streamlined single room selection handling
This commit is contained in:
@@ -262,9 +262,9 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
'required' => new ApplicantCondition(),
|
||||
];
|
||||
|
||||
// Hide assignedRoomId field when only one room type is selected (auto-assigned by RoomAssignmentService)
|
||||
// Render assignedRoomId field as static text when only one room type is selected (auto-assigned by RoomAssignmentService)
|
||||
$this->fieldStateConditions['assignedRoomId'] = [
|
||||
'hidden' => new SingleRoomTypeCondition(),
|
||||
'static_text' => new SingleRoomTypeCondition(),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
|
||||
@@ -16,6 +16,7 @@ use App\Form\Service\Condition\PersonalDataMutabilityCondition;
|
||||
use App\Form\Service\Condition\PickupsMutabilityCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
use App\Form\Service\Condition\SingleRoomTypeCondition;
|
||||
use App\Form\Service\Condition\SkiPassSelectionCondition;
|
||||
use App\Form\Service\Condition\TransportationServicesMutabilityCondition;
|
||||
|
||||
@@ -96,6 +97,12 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
|
||||
'static_text' => $personalDataHiddenCondition,
|
||||
];
|
||||
|
||||
// Render assignedRoomId field as static text when only one room type is selected (auto-assigned by RoomAssignmentService)
|
||||
// Same logic as create mode - render as static text when only one room type available
|
||||
$this->fieldStateConditions['assignedRoomId'] = [
|
||||
'static_text' => new SingleRoomTypeCondition(),
|
||||
];
|
||||
|
||||
// Conditional visibility for service fields (same as create flow)
|
||||
$rentalCondition = new RentalSelectionCondition();
|
||||
$skiPassCondition = new SkiPassSelectionCondition();
|
||||
|
||||
Reference in New Issue
Block a user