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\FirstParticipantCondition;
|
||||
use App\Form\Service\Condition\PersonalDataMutabilityCondition;
|
||||
use App\Form\Service\Condition\PickupsMutabilityCondition;
|
||||
use App\Form\Service\Condition\RentalInsuranceAvailableCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
@@ -159,9 +160,13 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
|
||||
'readonly' => $additionalServicesMutabilityCondition,
|
||||
];
|
||||
|
||||
// Rental insurance - shown only when rentals selected, readonly if services not mutable
|
||||
// Rental insurance - shown only when rentals selected AND LVS services exist, readonly if services not mutable
|
||||
$rentalInsuranceAvailableCondition = new RentalInsuranceAvailableCondition();
|
||||
$this->fieldStateConditions['rentalInsurance'] = [
|
||||
'hidden' => CompositeCondition::not($rentalCondition),
|
||||
'hidden' => CompositeCondition::or(
|
||||
CompositeCondition::not($rentalCondition),
|
||||
CompositeCondition::not($rentalInsuranceAvailableCondition)
|
||||
),
|
||||
'readonly' => $additionalServicesMutabilityCondition,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user