fix: ensure rental insurance is selectable when insurance is available
addresses #869bp9ev5
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Form\Service\Condition\FieldValueCondition;
|
||||
use App\Form\Service\Condition\FinalBookingOnlyCondition;
|
||||
use App\Form\Service\Condition\FirstParticipantCondition;
|
||||
use App\Form\Service\Condition\MultipleParticipantsCondition;
|
||||
use App\Form\Service\Condition\RentalInsuranceAvailableCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
@@ -264,9 +265,13 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
),
|
||||
];
|
||||
|
||||
// Show rental insurance only when rental services are selected (hidden by default)
|
||||
// Show rental insurance only when rental services are selected AND LVS services exist (hidden by default)
|
||||
$rentalInsuranceAvailableCondition = new RentalInsuranceAvailableCondition();
|
||||
$this->fieldStateConditions['rentalInsurance'] = [
|
||||
'hidden' => CompositeCondition::not($rentalCondition),
|
||||
'hidden' => CompositeCondition::or(
|
||||
CompositeCondition::not($rentalCondition),
|
||||
CompositeCondition::not($rentalInsuranceAvailableCondition)
|
||||
),
|
||||
];
|
||||
|
||||
// Show license plate only when parking is selected (hidden by default)
|
||||
|
||||
Reference in New Issue
Block a user