wip: rentals insurance field
This commit is contained in:
@@ -21,7 +21,7 @@ use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
* state functionality provided by AbstractFieldStateProvider.
|
||||
*
|
||||
* Current field state conditions:
|
||||
* - Body dimension fields become required when rental services are selected
|
||||
* - Body dimension fields are hidden unless rental services are selected
|
||||
* - Age-dependent service fields are hidden until birth date is provided
|
||||
* - Transportation pickup fields are hidden by default, shown only when transportation type is BUS
|
||||
* - Parking field is hidden by default, shown only when outbound transportation is PKW
|
||||
@@ -56,17 +56,9 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
{
|
||||
$rentalCondition = new RentalSelectionCondition();
|
||||
|
||||
// Make body dimension fields required when rental services are selected
|
||||
$this->fieldStateConditions['height'] = [
|
||||
'required' => $rentalCondition,
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['weight'] = [
|
||||
'required' => $rentalCondition,
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['shoeSize'] = [
|
||||
'required' => $rentalCondition,
|
||||
// Hide body dimensions section unless rental services are selected
|
||||
$this->fieldStateConditions['bodyDimensions'] = [
|
||||
'hidden' => CompositeCondition::not($rentalCondition),
|
||||
];
|
||||
|
||||
// Hide age-dependent fields when no date of birth is provided
|
||||
@@ -121,6 +113,11 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
),
|
||||
];
|
||||
|
||||
// Show rental insurance only when rental services are selected (hidden by default)
|
||||
$this->fieldStateConditions['rentalInsurance'] = [
|
||||
'hidden' => CompositeCondition::not($rentalCondition),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
// For demonstration purposes, here are some example patterns:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user