Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix issues related to checking into international trains #2407

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/Http/Controllers/FrontendTransportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public function TrainTrip(Request $request): Renderable|RedirectResponse {
// in long term to support multiple data providers we only support IDs here - no IBNRs.
$startStation = Station::findOrFail($validated['start']);
}

$departure = Carbon::parse($validated['departure']);

$trip = TrainCheckinController::getHafasTrip(
Expand All @@ -137,9 +138,9 @@ public function TrainTrip(Request $request): Renderable|RedirectResponse {

$encounteredStart = false;
$stopovers = $trip->stopovers
->filter(function(Stopover $stopover) use ($departure, $startStation, &$encounteredStart): bool {
->filter(function(Stopover $stopover) use ($startStation, &$encounteredStart): bool {
if (!$encounteredStart) { // this assumes stopovers being ordered correctly
$encounteredStart = $stopover->departure_planned == $departure && $stopover->station->is($startStation);
fabiancdng marked this conversation as resolved.
Show resolved Hide resolved
$encounteredStart = $stopover->station->is($startStation);
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion resources/vue/components/CheckinInterface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
business: this.business,
ibnr: true,
tripId: this.selectedTrain.tripId,
lineName: this.selectedTrain.line.name,
lineName: this.selectedTrain.line.name || this.selectedTrain.line.fahrtNr,
start: this.selectedTrain.stop.id,
destination: this.selectedDestination.evaIdentifier,
departure: DateTime.fromISO(this.selectedTrain.plannedWhen).setZone("UTC").toISO(),
Expand Down
4 changes: 2 additions & 2 deletions resources/vue/components/Stationboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {
<ProductIcon :product="selectedTrain.line.product"/>
</div>
<div class="col-auto align-items-center d-flex me-3">
<LineIndicator :product-name="selectedTrain.line.product" :number="selectedTrain.line.name"/>
<LineIndicator :product-name="selectedTrain.line.product" :number="selectedTrain.line.name !== null ? selectedTrain.line.name : selectedTrain.line.fahrtNr"/>
</div>
<template v-if="selectedDestination">
<div class="col-auto align-items-center d-flex me-3">
Expand Down Expand Up @@ -164,7 +164,7 @@ export default {
<ProductIcon :product="item.line.product"/>
</div>
<div class="col-2 align-items-center d-flex me-3 justify-content-center">
<LineIndicator :productName="item.line.product" :number="item.line.name"/>
<LineIndicator :productName="item.line.product" :number="item.line.name !== null ? item.line.name : item.line.fahrtNr"/>
</div>
<div class="col align-items-center d-flex second-stop">
<div>
Expand Down
Loading