feat: unify pickup selection
This commit is contained in:
@@ -121,17 +121,13 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
|
||||
'readonly' => $transportationServicesMutabilityCondition,
|
||||
];
|
||||
|
||||
// Pickup fields - shown only when transportation is BUS, readonly if pickups not mutable
|
||||
$this->fieldStateConditions['pickupOutbound'] = [
|
||||
// Pickup field (unified) - shown only when either transportation direction is BUS, readonly if pickups not mutable
|
||||
$this->fieldStateConditions['pickup'] = [
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
),
|
||||
'readonly' => $pickupsMutabilityCondition,
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['pickupInbound'] = [
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
CompositeCondition::or(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
ServiceSubTypeCondition::equals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
)
|
||||
),
|
||||
'readonly' => $pickupsMutabilityCondition,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user