feat: unify pickup selection

This commit is contained in:
Björn Fromme
2025-10-06 18:07:07 +02:00
parent b7b80296e9
commit b66d453881
19 changed files with 119 additions and 325 deletions
+6 -10
View File
@@ -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,
];