From 952f3c3d249635f2e8be8e029a8aea0c7261ff37 Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 26 Jun 2024 13:53:16 +0200 Subject: [PATCH] :sparkles: add plane for manual trips (#2704) --- app/Enum/HafasTravelType.php | 4 +++- app/Enum/TravelType.php | 6 ++++-- resources/views/includes/status.blade.php | 14 ++++++++------ .../components/TripCreation/TripCreationForm.vue | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/Enum/HafasTravelType.php b/app/Enum/HafasTravelType.php index b644e4a51..0c47901fe 100644 --- a/app/Enum/HafasTravelType.php +++ b/app/Enum/HafasTravelType.php @@ -9,7 +9,7 @@ * description="Category of transport. ", * type="string", * enum={"nationalExpress", "national", "regionalExp", "regional", "suburban", "bus", "ferry", "subway", - * "tram", "taxi"}, + * "tram", "taxi", "plane"}, * example="suburban" * ) */ @@ -25,6 +25,7 @@ enum HafasTravelType: string case SUBWAY = 'subway'; case TRAM = 'tram'; case TAXI = 'taxi'; + case PLANE = 'plane'; public function getEmoji(): string { return match ($this->value) { @@ -36,6 +37,7 @@ public function getEmoji(): string { 'subway' => 'πŸš‡', 'tram' => '🚊', 'taxi' => 'πŸš–', + 'plane' => '✈️', default => '', }; } diff --git a/app/Enum/TravelType.php b/app/Enum/TravelType.php index b66e7a642..517a090f3 100644 --- a/app/Enum/TravelType.php +++ b/app/Enum/TravelType.php @@ -4,11 +4,12 @@ namespace App\Enum; /** + * @todo Mit HafasTravelType abgleichen - warum wird dieses Enum hier fΓΌr HAFAS Requests genutzt und nicht das HafasTravelType? + * * @OA\Schema( * title="travelType", * type="string", - * enum={"express", "regional", "suburban", "bus", "ferry", "subway", "tram", "taxi", - * "tram", "taxi"}, + * enum={"express", "regional", "suburban", "bus", "ferry", "subway", "tram", "taxi", "plane"}, * example="suburban" * ) */ @@ -22,4 +23,5 @@ enum TravelType: string case SUBWAY = 'subway'; case TRAM = 'tram'; case TAXI = 'taxi'; + case PLANE = 'plane'; } diff --git a/resources/views/includes/status.blade.php b/resources/views/includes/status.blade.php index 54f6a9877..80f5a8975 100644 --- a/resources/views/includes/status.blade.php +++ b/resources/views/includes/status.blade.php @@ -1,7 +1,7 @@ @php use App\Enum\Business; - use App\Http\Controllers\Backend\Transport\StationController; - use App\Http\Controllers\Backend\User\ProfilePictureController; + use App\Http\Controllers\Backend\Helper\StatusHelper;use App\Http\Controllers\Backend\Transport\StationController; + use App\Http\Controllers\Backend\Transport\StatusController;use App\Http\Controllers\Backend\User\ProfilePictureController;use Illuminate\Support\Facades\Gate; @endphp

- @if (file_exists(public_path('img/' . $status->checkin->trip->category->value . '.svg'))) + @if(file_exists(public_path('img/' . $status->checkin->trip->category->value . '.svg'))) {{$status->checkin->trip->category->value}} + @elseif($status->checkin->trip->category->value == 'plane') + @elseif($status->checkin->trip->category->value == 'taxi') @else @@ -117,7 +119,7 @@ class="text-trwl clearfix"> @if(!empty($status->body))

- {!! \App\Http\Controllers\Backend\Transport\StatusController::getPrintableEscapedBody($status) !!} + {!! StatusController::getPrintableEscapedBody($status) !!}

@endif @@ -126,7 +128,7 @@ class="text-trwl clearfix"> {{ __('stationboard.next-stop') }} @php - $nextStation = \App\Http\Controllers\Backend\Transport\StatusController::getNextStationForStatus($status); + $nextStation = StatusController::getNextStationForStatus($status); @endphp @@ -200,7 +202,7 @@ class="like {{ auth()->user() && $status->likes->where('user_id', auth()->user() type="button" data-trwl-share-url="{{ route('status', ['id' => $status->id]) }}" @if(auth()->user() && $status->user_id == auth()->user()->id) - data-trwl-share-text="{{ \App\Http\Controllers\Backend\Helper\StatusHelper::getSocialText($status) }}" + data-trwl-share-text="{{StatusHelper::getSocialText($status) }}" @else data-trwl-share-text="{{ $status->description }}" @endif diff --git a/resources/vue/components/TripCreation/TripCreationForm.vue b/resources/vue/components/TripCreation/TripCreationForm.vue index 059189030..35c794a31 100644 --- a/resources/vue/components/TripCreation/TripCreationForm.vue +++ b/resources/vue/components/TripCreation/TripCreationForm.vue @@ -37,6 +37,7 @@ export default { {value: "subway", text: "subway"}, {value: "tram", text: "tram"}, {value: "taxi", text: "taxi"}, + {value: "plane", text: "plane"}, ], }; },