Compare commits

..
Author SHA1 Message Date
dredgy cf1a2f6cba Merge branch 'main' into make-flighttooltip-better-on-mobile 2026-08-20 16:49:41 +10:00
30 changed files with 174 additions and 972 deletions
@@ -17,10 +17,7 @@ class PopulateAirportTimezones extends Command
*/ */
public function handle() public function handle()
{ {
Airport::where(function ($query) { Airport::whereNull('timezone')->chunkById(100, function ($airports) {
$query->whereNull('timezone')
->orWhere('timezone', 'Undefined');
})->chunkById(100, function ($airports) {
foreach ($airports as $airport) { foreach ($airports as $airport) {
$zoneName = null; $zoneName = null;
$attempts = 0; $attempts = 0;
-14
View File
@@ -7,7 +7,6 @@ use App\Models\IgnoredMissingLivery;
use App\Models\User; use App\Models\User;
use App\Models\UserFlight; use App\Models\UserFlight;
use App\Services\AdminService; use App\Services\AdminService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Inertia\Inertia; use Inertia\Inertia;
@@ -67,17 +66,4 @@ class AdminController extends Controller
return back(); return back();
} }
public function ignoreMissingAirline(Request $request): JsonResponse
{
$validated = $request->validate([
'flight_id' => ['required', 'integer', 'exists:user_flights,id'],
]);
$flight = UserFlight::findOrFail($validated['flight_id']);
$flight->ignoreMissingAirline()->firstOrCreate([]);
return response()->json(['status' => 'ok']);
}
} }
+4 -8
View File
@@ -245,19 +245,15 @@ class FlightController extends Controller
$newFlight = auth()->user()->flights()->create($this->flightPayload($validated)); $newFlight = auth()->user()->flights()->create($this->flightPayload($validated));
UserAction::create([ UserAction::create([
'user_id' => $newFlight->user_id, 'user_id' => $newFlight->user_id,
'type' => $newFlight->departure_date->isFuture() ? 'flight_booked' : 'flight_logged', 'type' => $newFlight->departure_date->isFuture() ? 'flight_booked' : 'flight_logged',
'data' => [ 'data' => [
'flight' => $newFlight->snapshot($newFlight->id), 'flight' => $newFlight->snapshot($newFlight->id),
], ],
]); ]);
if ($request->boolean('add_more')) {
return redirect()->route('flights.add')
->with('success', 'Flight saved. Add another below.');
}
return redirect()->route('profile.flight', [Auth::user()->name, $newFlight->id]); return redirect()->route('profile.departure-board', [Auth::user()->name, $newFlight->id]);
} }
+9 -31
View File
@@ -58,50 +58,28 @@ class SearchController extends Controller
{ {
$q = request('q', ''); $q = request('q', '');
$len = strlen($q); $len = strlen($q);
$showClosed = request()->boolean('show_closed');
$showNoCode = request()->boolean('show_no_code');
if ($len < 3) return []; if ($len < 3) return [];
return Airport::with('region.country') return Airport::with('region.country')
->when(!$showClosed, fn($query) => $query->where('active', true))
->when(!$showNoCode, fn($query) => $query->where(function ($sub) {
$sub->whereNotNull('iata_code')
->orWhereNotNull('icao_code');
}))
->when($len === 3, fn($query) => $query->where('iata_code', 'ilike', $q)) ->when($len === 3, fn($query) => $query->where('iata_code', 'ilike', $q))
->when($len >= 4, fn($query) => $query->where(function ($sub) use ($q, $len) { ->when($len >= 4, fn($query) => $query->where(function ($sub) use ($q, $len) {
$sub->when($len === 4, fn($s) => $s->where('icao_code', 'ilike', $q)) $sub->when($len === 4, fn($s) => $s->where('icao_code', 'ilike', $q))
->orWhere('name', 'ilike', "%{$q}%") ->orWhere('name', 'ilike', "%{$q}%")
->orWhere('municipality', 'ilike', "%{$q}%"); ->orWhere('municipality', 'ilike', "%{$q}%");
})) })->orderByRaw("
->orderByRaw(" CASE
CASE WHEN icao_code = ? THEN 0
WHEN active THEN 0 WHEN iata_code = ? THEN 1
ELSE 1 ELSE 2
END END
") ", [$q, $q]))
->orderByRaw("
CASE
WHEN iata_code IS NOT NULL AND icao_code IS NOT NULL THEN 0
WHEN iata_code IS NOT NULL OR icao_code IS NOT NULL THEN 1
ELSE 2
END
")
->orderByRaw("
CASE
WHEN icao_code = ? THEN 0
WHEN iata_code = ? THEN 1
ELSE 2
END
", [$q, $q])
->limit(15) ->limit(15)
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id', 'active']) ->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn(Airport $airport) => [ ->map(fn($airport) => [
'value' => $airport->id, 'value' => $airport->id,
'title' => $airport->display_name, 'title' => $airport->display_name,
'country_code' => strtolower($airport->region->country->code), 'country_code' => strtolower($airport->region->country->code),
'active' => $airport->active,
]) ])
->values(); ->values();
} }
@@ -3,7 +3,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Achievement; use App\Models\Achievement;
use App\Models\AchievementCategory;
use App\Models\Aircraft; use App\Models\Aircraft;
use App\Models\Airport; use App\Models\Airport;
use App\Models\Alliance; use App\Models\Alliance;
@@ -106,14 +105,8 @@ class UserProfileController extends Controller
$achievements = Achievement::with(['category', 'difficulty']) $achievements = Achievement::with(['category', 'difficulty'])
->orderBy('id', 'asc') ->orderBy('id', 'asc')
->get() ->get()
->groupBy(fn(Achievement $a) => $a->category->internal_name) ->groupBy(fn(Achievement $a) => $a->category->name)
->sortBy(function ($group, $internalName) { ->map(fn($group) => $group->sortBy('sort_order')->values());
$index = array_search($internalName, AchievementCategory::ORDER);
return $index === false ? PHP_INT_MAX : $index;
})
->mapWithKeys(fn($group) => [
$group->first()->category->name => $group->sortBy('sort_order')->values(),
]);
$userAchievements = $user->achievements() $userAchievements = $user->achievements()
->with('achievement') ->with('achievement')
@@ -58,7 +58,6 @@ class HandleInertiaRequests extends Middleware
->whereNull('expires_at') ->whereNull('expires_at')
->orWhere('expires_at', '>', now()) ->orWhere('expires_at', '>', now())
->count(), ->count(),
'carto_api_key' => config('services.carto.key'),
]; ];
} }
} }
-10
View File
@@ -16,16 +16,6 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/ */
class AchievementCategory extends Model class AchievementCategory extends Model
{ {
const array ORDER = [
'number_of_flights',
'distance',
'general_flying',
'countries_and_continents',
'aircraft',
'airlines_and_alliances',
'fun_challenges',
];
protected $fillable = [ protected $fillable = [
'internal_name', 'internal_name',
'name', 'name',
-9
View File
@@ -20,14 +20,12 @@ class Airport extends Model
'icao_code', 'icao_code',
'iata_code', 'iata_code',
'local_code', 'local_code',
'active',
]; ];
protected $casts = [ protected $casts = [
'latitude_deg' => 'float', 'latitude_deg' => 'float',
'longitude_deg' => 'float', 'longitude_deg' => 'float',
'elevation_ft' => 'integer', 'elevation_ft' => 'integer',
'active' => 'boolean',
]; ];
protected $appends = [ protected $appends = [
@@ -39,8 +37,6 @@ class Airport extends Model
'LHR', 'LGW', 'STN', 'LTN', 'LCY', 'SEN', 'LHR', 'LGW', 'STN', 'LTN', 'LCY', 'SEN',
]; ];
protected function displayName() : Attribute{ protected function displayName() : Attribute{
return Attribute::make( return Attribute::make(
get: function () { get: function () {
@@ -57,11 +53,6 @@ class Airport extends Model
); );
} }
public function scopeActive($query)
{
return $query->where('active', true);
}
public function region(): BelongsTo public function region(): BelongsTo
{ {
return $this->belongsTo(Region::class); return $this->belongsTo(Region::class);
-11
View File
@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
@@ -272,16 +271,6 @@ class UserFlight extends Model
} }
public function ignoreMissingAirline(): HasOne
{
return $this->hasOne(UserFlightIgnoreMissingAirline::class);
}
public function isIgnoringMissingAirline(): bool
{
return $this->ignoreMissingAirline()->exists();
}
public function aircraft(): BelongsTo public function aircraft(): BelongsTo
{ {
return $this->belongsTo(Aircraft::class); return $this->belongsTo(Aircraft::class);
@@ -1,20 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserFlightIgnoreMissingAirline extends Model
{
protected $table = 'user_flights_ignore_missing_airlines';
protected $fillable = [
'user_flight_id',
];
public function userFlight(): BelongsTo
{
return $this->belongsTo(UserFlight::class);
}
}
@@ -98,8 +98,7 @@ class AchievementService
->where('achievement_id', $achievement->id) ->where('achievement_id', $achievement->id)
->first(); ->first();
$alreadyUnlocked = $existing !== null $alreadyUnlocked = $existing !== null;
&& (! $achievement->progressive || $existing->progress >= $achievement->threshold);
UserAchievement::updateOrCreate( UserAchievement::updateOrCreate(
['user_id' => $user->id, 'achievement_id' => $achievement->id], ['user_id' => $user->id, 'achievement_id' => $achievement->id],
+3 -5
View File
@@ -51,28 +51,26 @@ class AdminService
{ {
$flights = UserFlight::whereNotNull('flight_number') $flights = UserFlight::whereNotNull('flight_number')
->whereNull('airline_id') ->whereNull('airline_id')
->whereDoesntHave('ignoreMissingAirline') ->with('user:id,name') // adjust to your actual user relation/columns
->with('user:id,name')
->get(['id', 'flight_number', 'user_id']); ->get(['id', 'flight_number', 'user_id']);
return $flights return $flights
->map(function ($flight) { ->map(function ($flight) {
// Extract the 2-character IATA-style prefix (letters and/or digits)
preg_match('/^([A-Za-z0-9]{2})\d+/', trim($flight->flight_number), $matches); preg_match('/^([A-Za-z0-9]{2})\d+/', trim($flight->flight_number), $matches);
return [ return [
'id' => $flight->id,
'code' => $matches[1] ?? null, 'code' => $matches[1] ?? null,
'flight_number' => $flight->flight_number, 'flight_number' => $flight->flight_number,
'link' => "/u/{$flight->user->name}/flight/{$flight->id}", 'link' => "/u/{$flight->user->name}/flight/{$flight->id}",
]; ];
}) })
->filter(fn ($f) => $f['code'] !== null) ->filter(fn ($f) => $f['code'] !== null) // drop any that didn't match the pattern
->groupBy('code') ->groupBy('code')
->map(function ($group, $code) { ->map(function ($group, $code) {
return [ return [
'code' => $code, 'code' => $code,
'flights' => $group->map(fn ($f) => [ 'flights' => $group->map(fn ($f) => [
'id' => $f['id'],
'flight_number' => $f['flight_number'], 'flight_number' => $f['flight_number'],
'link' => $f['link'], 'link' => $f['link'],
])->values()->all(), ])->values()->all(),
+2 -2
View File
@@ -72,7 +72,7 @@ class SettingsRegistry
'type' => 'select', 'type' => 'select',
'label' => 'Default Page', 'label' => 'Default Page',
'category' => 'FlightsGoneBy Settings', 'category' => 'FlightsGoneBy Settings',
'default' => 'profile', 'default' => 'feed_first',
'options' => [ 'options' => [
['value' => 'feed_first', 'label' => 'My Feed if Following People, My Profile if Not'], ['value' => 'feed_first', 'label' => 'My Feed if Following People, My Profile if Not'],
['value' => 'profile', 'label' => 'My Profile'], ['value' => 'profile', 'label' => 'My Profile'],
@@ -155,7 +155,7 @@ class SettingsRegistry
['value' => 'seat_type_id', 'label' => 'Seat Type'], ['value' => 'seat_type_id', 'label' => 'Seat Type'],
['value' => 'seat_number', 'label' => 'Seat Number'], ['value' => 'seat_number', 'label' => 'Seat Number'],
['value' => 'flight_reason_id', 'label' => 'Reason'], ['value' => 'flight_reason_id', 'label' => 'Reason'],
['value' => 'note', 'label' => 'Note'],
['value' => 'aircraft.display_name_short', 'label' => 'Aircraft Full Name'], ['value' => 'aircraft.display_name_short', 'label' => 'Aircraft Full Name'],
['value' => 'class_seat_combined', 'label' => 'Class/Seat Type/Seat Number Combined'], ['value' => 'class_seat_combined', 'label' => 'Class/Seat Type/Seat Number Combined'],
], ],
+1 -1
View File
@@ -67,7 +67,7 @@ return Application::configure(basePath: dirname(__DIR__))
'message' => 'You don\'t have permission to access this page.', 'message' => 'You don\'t have permission to access this page.',
], ],
404 => [ 404 => [
'title' => 'Your Flight Has Been Cancelled', 'title' => 'You Flight Has Been Cancelled',
'message' => 'The page you are looking for doesn\'t exist or has been moved.', 'message' => 'The page you are looking for doesn\'t exist or has been moved.',
], ],
419 => [ 419 => [
-4
View File
@@ -18,10 +18,6 @@ return [
'key' => env('POSTMARK_API_KEY'), 'key' => env('POSTMARK_API_KEY'),
], ],
'carto' => [
'key' => env('CARTO_API_KEY'),
],
'resend' => [ 'resend' => [
'key' => env('RESEND_API_KEY'), 'key' => env('RESEND_API_KEY'),
], ],
@@ -1,26 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('user_flights_ignore_missing_airlines', function (Blueprint $table) {
$table->id();
$table->foreignId('user_flight_id')
->constrained('user_flights')
->cascadeOnDelete();
$table->timestamps();
$table->unique('user_flight_id');
});
}
public function down(): void
{
Schema::dropIfExists('user_flights_ignore_missing_airlines');
}
};
@@ -1,57 +0,0 @@
<?php
use App\Models\Achievement;
use App\Models\AchievementCategory;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
public function up(): void
{
$newCategory = AchievementCategory::create([
'internal_name' => 'number_of_flights',
'name' => 'Number of Flights',
'description' => 'Achievements for reaching flight count milestones.',
]);
$achievementsToUpdate = [
'general_flying.first_flight',
'general_flying.10_flights',
'general_flying.500_flights',
'general_flying.50_flights',
'general_flying.100_flights',
'general_flying.1000_flights',
];
foreach ($achievementsToUpdate as $internalName) {
$achievement = Achievement::where('internal_name', $internalName)->first();
if (!$achievement) {
continue; // or throw, depending how strict you want this
}
$achievement->update([
'achievement_category_id' => $newCategory->id,
'internal_name' => str_replace('general_flying.', 'number_of_flights.', $internalName),
]);
}
}
public function down(): void
{
$oldCategory = AchievementCategory::where('internal_name', 'general_flying')->first();
if ($oldCategory) {
Achievement::where('internal_name', 'like', 'number_of_flights.%')
->get()
->each(function (Achievement $achievement) use ($oldCategory) {
$achievement->update([
'achievement_category_id' => $oldCategory->id,
'internal_name' => str_replace('number_of_flights.', 'general_flying.', $achievement->internal_name),
]);
});
}
AchievementCategory::where('internal_name', 'number_of_flights')->delete();
}
};
@@ -1,133 +0,0 @@
<?php
use App\Models\Airport;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('airports', function (Blueprint $table) {
$table->boolean('active')->default(true);
});
Airport::whereIataCode('TXL')->update(['active' => false]);
$this->importCsv();
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('airports', function (Blueprint $table) {
$table->dropColumn('active');
});
}
private function importCsv(): void
{
$path = storage_path('app/private/seed_data/airports.csv');
if (! file_exists($path)) {
throw new \RuntimeException("Airports CSV not found at: {$path}");
}
$handle = fopen($path, 'rb');
if ($handle === false) {
throw new \RuntimeException("Failed to open airports CSV at: {$path}");
}
// Skip header row
fgetcsv($handle);
$regionMap = DB::table('regions')->pluck('id', 'code')->all();
$batch = [];
$batchSize = 500;
$now = now()->toDateTimeString();
while (($row = fgetcsv($handle)) !== false) {
if (count($row) < 19) {
continue;
}
// id, ident, type, name, latitude_deg, longitude_deg, elevation_ft,
// continent, iso_country, iso_region, municipality, scheduled_service,
// icao_code, iata_code, gps_code, local_code, home_link, wikipedia_link, keywords
[
,
,
$type,
$name,
$latitudeDeg,
$longitudeDeg,
$elevationFt,
,
,
$isoRegion,
$municipality,
,
$icaoCode,
$iataCode,
,
$localCode,
] = $row;
$icaoCode = trim(str_replace(["\r", "\n"], '', $icaoCode));
$iataCode = trim(str_replace(["\r", "\n"], '', $iataCode));
// Only importing airports with no IATA/ICAO code — coded airports are already in the DB
if ($icaoCode !== '' || $iataCode !== '') {
continue;
}
$type = trim($type);
$name = trim($name);
$localCode = trim($localCode);
$isoRegion = trim($isoRegion);
if (! isset($regionMap[$isoRegion])) {
continue;
}
$elevationFt = trim($elevationFt);
$batch[] = [
'type' => $type,
'name' => $name,
'latitude_deg' => (float) trim($latitudeDeg),
'longitude_deg' => (float) trim($longitudeDeg),
'elevation_ft' => $elevationFt !== '' ? (int) $elevationFt : null,
'region_id' => $regionMap[$isoRegion],
'municipality' => trim($municipality) !== '' ? trim($municipality) : null,
'icao_code' => null,
'iata_code' => null,
'local_code' => $localCode !== '' ? $localCode : null,
'timezone' => 'Undefined',
'active' => $type !== 'closed',
'created_at' => $now,
'updated_at' => $now,
];
echo "Added: {$name}\n";
if (count($batch) >= $batchSize) {
DB::table('airports')->insert($batch);
$batch = [];
}
}
fclose($handle);
if (! empty($batch)) {
DB::table('airports')->insert($batch);
}
}
};
@@ -1,63 +1,25 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from "vue"
import axios from "axios"
import { MissingAirline } from "@/Types/types" import { MissingAirline } from "@/Types/types"
const props = defineProps<{ defineProps<{
airline: MissingAirline airline: MissingAirline
}>() }>()
// Track ids we've dismissed locally (optimistic UI) and ones currently in-flight
const dismissedIds = ref<Set<number>>(new Set())
const pendingIds = ref<Set<number>>(new Set())
const visibleFlights = computed(() =>
props.airline.flights.filter(flight => !dismissedIds.value.has(flight.id))
)
async function dismissFlight(flightId: number) {
if (pendingIds.value.has(flightId)) return
pendingIds.value.add(flightId)
// Optimistically remove the pill
dismissedIds.value.add(flightId)
try {
await axios.post('/admin/ignore-missing-airline', {
flight_id: flightId,
})
} catch (error) {
// Revert on failure so the flight isn't silently lost from view
dismissedIds.value.delete(flightId)
console.error('Failed to ignore missing airline for flight', flightId, error)
} finally {
pendingIds.value.delete(flightId)
}
}
</script> </script>
<template> <template>
<div class="missing-airline-card"> <div class="missing-airline-card">
<div class="card-header"> <div class="card-header">
<span class="airline-code">{{ airline.code }}</span> <span class="airline-code">{{ airline.code }}</span>
<span class="flight-count">{{ visibleFlights.length }} flight{{ visibleFlights.length === 1 ? '' : 's' }}</span> <span class="flight-count">{{ airline.flights.length }} flight{{ airline.flights.length === 1 ? '' : 's' }}</span>
</div> </div>
<div class="flight-list"> <ul class="flight-list">
<v-chip <li v-for="flight in airline.flights" :key="flight.link" class="flight-item">
v-for="flight in visibleFlights" <a :href="flight.link" class="flight-link" target="_blank" rel="noopener">
:key="flight.link"
class="flight-chip"
size="small"
closable
:disabled="pendingIds.has(flight.id)"
@click:close="dismissFlight(flight.id)"
>
<a :href="flight.link" class="flight-link" target="_blank" rel="noopener" @click.stop>
{{ flight.flight_number }} {{ flight.flight_number }}
</a> </a>
</v-chip> </li>
</div> </ul>
</div> </div>
</template> </template>
@@ -100,23 +62,30 @@ async function dismissFlight(flightId: number) {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.5rem; gap: 0.5rem;
list-style: none;
padding: 0;
margin: 0;
} }
.flight-chip { .flight-item {
font-family: 'Share Tech Mono', monospace; display: flex;
font-size: 0.72rem;
letter-spacing: 0.06em;
background: rgba(255, 255, 255, 0.04) !important;
border: 1px solid rgba(255, 255, 255, 0.06);
} }
.flight-link { .flight-link {
font-family: 'Share Tech Mono', monospace;
font-size: 0.72rem;
letter-spacing: 0.06em;
color: #9fb3c8; color: #9fb3c8;
text-decoration: none; text-decoration: none;
transition: color 0.15s ease; background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 4px;
padding: 0.25rem 0.5rem;
transition: color 0.15s ease, border-color 0.15s ease;
} }
.flight-link:hover { .flight-link:hover {
color: #ffc107; color: #ffc107;
border-color: rgba(255, 193, 7, 0.4);
} }
</style> </style>
@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick, watch } from 'vue' import { ref, nextTick } from 'vue'
import axios from 'axios' import axios from 'axios'
const props = defineProps<{ const props = defineProps<{
@@ -12,14 +12,8 @@ const model = defineModel<{ value: number, title: string, country_code: string }
const airportOptions = ref(props.prefilledOptions ?? []) const airportOptions = ref(props.prefilledOptions ?? [])
const autocompleteRef = ref<any>(null) const autocompleteRef = ref<any>(null)
const showClosed = ref(false)
const showNoCode = ref(false)
const lastQuery = ref('')
const menuOpen = ref(false)
const onFocus = () => { const onFocus = () => {
menuOpen.value = true
nextTick(() => { nextTick(() => {
const input = autocompleteRef.value?.$el?.querySelector('input') const input = autocompleteRef.value?.$el?.querySelector('input')
input?.select() input?.select()
@@ -27,8 +21,6 @@ const onFocus = () => {
} }
const searchAirports = async (query: string) => { const searchAirports = async (query: string) => {
lastQuery.value = query
if (!query || query.length < 2) { if (!query || query.length < 2) {
airportOptions.value = props.prefilledOptions ?? [] airportOptions.value = props.prefilledOptions ?? []
return return
@@ -36,27 +28,15 @@ const searchAirports = async (query: string) => {
if (query === model.value?.title) return if (query === model.value?.title) return
const { data } = await axios.get('/search/airports', { const { data } = await axios.get('/search/airports', { params: { q: query } })
params: {
q: query,
show_closed: showClosed.value ? 1 : undefined,
show_no_code: showNoCode.value ? 1 : undefined,
},
})
airportOptions.value = data airportOptions.value = data
} }
// Re-run the last search when either checkbox is toggled, so results update immediately
watch([showClosed, showNoCode], () => {
if (lastQuery.value) searchAirports(lastQuery.value)
})
</script> </script>
<template> <template>
<v-autocomplete <v-autocomplete
ref="autocompleteRef" ref="autocompleteRef"
v-model="model" v-model="model"
v-model:menu="menuOpen"
:label="label ?? 'Airport'" :label="label ?? 'Airport'"
:items="airportOptions" :items="airportOptions"
:error-messages="errorMessages" :error-messages="errorMessages"
@@ -68,7 +48,6 @@ watch([showClosed, showNoCode], () => {
clearable clearable
hide-no-data hide-no-data
return-object return-object
autocomplete="off"
:custom-filter="() => true" :custom-filter="() => true"
> >
<template #prepend-inner> <template #prepend-inner>
@@ -76,27 +55,6 @@ watch([showClosed, showNoCode], () => {
<span v-if="model" :class="`fi fi-${model.country_code}`"></span> <span v-if="model" :class="`fi fi-${model.country_code}`"></span>
</span> </span>
</template> </template>
<template #prepend-item>
<div class="px-4 py-1 d-flex align-center" style="gap: 16px;" @mousedown.prevent>
<v-checkbox
v-model="showClosed"
label="Show Closed Airports"
density="compact"
hide-details
style="flex: none; transform: scale(0.65); transform-origin: left center;"
/>
<v-checkbox
v-model="showNoCode"
label="Show Airports with No Code"
density="compact"
hide-details
style="flex: none; transform: scale(0.65); transform-origin: left center;"
/>
</div>
<v-divider class="mt-1" />
</template>
<template #item="{ item, props: itemProps }"> <template #item="{ item, props: itemProps }">
<v-list-item v-bind="itemProps"> <v-list-item v-bind="itemProps">
<template #prepend> <template #prepend>
@@ -104,6 +62,7 @@ watch([showClosed, showNoCode], () => {
<span :class="`fi fi-${item.country_code}`"></span> <span :class="`fi fi-${item.country_code}`"></span>
</span> </span>
</template> </template>
</v-list-item> </v-list-item>
</template> </template>
</v-autocomplete> </v-autocomplete>
@@ -17,7 +17,7 @@ const props = defineProps<{
const page = usePage<SharedProps>().props const page = usePage<SharedProps>().props
const ITEMS_PER_PAGE = 25 const ITEMS_PER_PAGE = 25
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined', 'note'] const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined']
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns) const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
const showColumn = (column: string) => columnsToShow.value.includes(column) const showColumn = (column: string) => columnsToShow.value.includes(column)
@@ -44,7 +44,6 @@ const allHeaders = [
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true }, { title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
{ title: 'SEAT NO.', key: 'seat_number', sortable: true }, { title: 'SEAT NO.', key: 'seat_number', sortable: true },
{ title: 'REASON', key: 'flight_reason_id', sortable: true }, { title: 'REASON', key: 'flight_reason_id', sortable: true },
{ title: 'NOTE', key: 'note', sortable: true },
{ title: '', key: 'actions', sortable: false }, { title: '', key: 'actions', sortable: false },
] ]
@@ -41,7 +41,7 @@ const reasonBadgeVariant = (reason: string) => {
} }
const showColumn = (column: string) => props.columnsToShow.includes(column) const showColumn = (column: string) => props.columnsToShow.includes(column)
console.log(props.columnsToShow)
</script> </script>
<template> <template>
@@ -170,10 +170,6 @@ console.log(props.columnsToShow)
</span> </span>
</td> </td>
<td v-if="showColumn('note')" class="v-data-table__td note-cell">
<span v-if="flight.note" class="note-text">{{ flight.note }}</span>
</td>
<td class="v-data-table__td actions-cell"> <td class="v-data-table__td actions-cell">
<UserFlightContextMenu :profile-user="user" :can-edit="canEdit" :flight="flight" /> <UserFlightContextMenu :profile-user="user" :can-edit="canEdit" :flight="flight" />
</td> </td>
@@ -188,17 +184,6 @@ console.log(props.columnsToShow)
padding-right: 0 !important; padding-right: 0 !important;
} }
.note-cell {
min-width: 200px;
max-width: 320px;
}
.note-text {
display: block;
overflow: hidden;
font-size: 0.85rem;
}
.city-name{ .city-name{
color: #556; color: #556;
text-transform: uppercase; text-transform: uppercase;
@@ -226,14 +211,23 @@ console.log(props.columnsToShow)
align-items: center; align-items: center;
vertical-align: middle; vertical-align: middle;
gap: 0.5rem; gap: 0.5rem;
width: fit-content; overflow-x: auto;
max-width: 160px;
/* Hide scrollbar but keep functionality */
scrollbar-width: none;
&::-webkit-scrollbar { display: none; }
} }
.iata { .iata {
font-weight: 600; font-weight: 600;
} }
.class-cell {
display: flex;
align-items: center;
vertical-align: middle;
gap: 0.5rem;
}
.actions-cell { .actions-cell {
width: 40px; width: 40px;
@@ -283,5 +277,15 @@ console.log(props.columnsToShow)
padding: 0 !important; padding: 0 !important;
} }
.class-badges-cell {
max-width: 140px;
overflow: hidden;
}
.class-cell > *:not(:first-child) {
display: none;
}
} }
</style> </style>
@@ -50,7 +50,6 @@ import {useUpdateSetting} from "@/Composables/useUpdateSetting";
import {usePage} from "@inertiajs/vue3"; import {usePage} from "@inertiajs/vue3";
type LngLat = [number, number] type LngLat = [number, number]
interface RouteFlightBucket { interface RouteFlightBucket {
@@ -291,7 +290,6 @@ export default defineComponent({
const { updateSetting } = useUpdateSetting() const { updateSetting } = useUpdateSetting()
const page = usePage<SharedProps>().props const page = usePage<SharedProps>().props
const carto_key = page.carto_api_key
let map: maplibregl.Map | null = null let map: maplibregl.Map | null = null
let popup: maplibregl.Popup | null = null let popup: maplibregl.Popup | null = null
@@ -372,37 +370,13 @@ export default defineComponent({
link.click() link.click()
} }
function loopPoints(origin: LngLat, radiusDeg = 0.2, steps = 48): LngLat[] {
const [lng, lat] = origin
// Widen the longitude radius to compensate for mercator distortion at this latitude
const lngRadius = radiusDeg / Math.max(Math.cos(lat * Math.PI / 180), 0.15)
// Center the loop above the origin so the airport point sits at the bottom of the loop
const centerLat = lat + radiusDeg
const points: LngLat[] = []
for (let i = 0; i <= steps; i++) {
const theta = (i / steps) * Math.PI * 2
points.push([
lng + Math.sin(theta) * lngRadius,
centerLat - radiusDeg * Math.cos(theta),
])
}
return points // first and last point === origin, at the bottom of the loop
}
const getArc = (flight: Flight): LngLat[] => { const getArc = (flight: Flight): LngLat[] => {
const key = routeKey(flight.departure_airport, flight.arrival_airport) const key = routeKey(flight.departure_airport, flight.arrival_airport)
if (!arcCache.has(key)) { if (!arcCache.has(key)) {
const isSameAirport = flight.departure_airport.id === flight.arrival_airport.id arcCache.set(key, greatCirclePoints(
[flight.departure_airport.longitude_deg, flight.departure_airport.latitude_deg],
arcCache.set(key, isSameAirport [flight.arrival_airport.longitude_deg, flight.arrival_airport.latitude_deg],
? loopPoints([flight.departure_airport.longitude_deg, flight.departure_airport.latitude_deg]) ))
: greatCirclePoints(
[flight.departure_airport.longitude_deg, flight.departure_airport.latitude_deg],
[flight.arrival_airport.longitude_deg, flight.arrival_airport.latitude_deg],
))
} }
return arcCache.get(key)! return arcCache.get(key)!
} }
@@ -692,10 +666,8 @@ export default defineComponent({
? { top: 20, bottom: 20, left: 55, right: 55 } ? { top: 20, bottom: 20, left: 55, right: 55 }
: { top: 60, bottom: 60, left: 60, right: 60 } : { top: 60, bottom: 60, left: 60, right: 60 }
// Use full arc/loop geometry, not just endpoints, so loops aren't clipped const lngs = props.flights.flatMap(f => [f.departure_airport.longitude_deg, f.arrival_airport.longitude_deg])
const allPoints = props.flights.flatMap(getArc) const lats = props.flights.flatMap(f => [f.departure_airport.latitude_deg, f.arrival_airport.latitude_deg])
const lngs = allPoints.map(p => p[0])
const lats = allPoints.map(p => p[1])
const minLat = Math.min(...lats) const minLat = Math.min(...lats)
const maxLat = Math.max(...lats) const maxLat = Math.max(...lats)
@@ -717,6 +689,7 @@ export default defineComponent({
} }
map!.fitBounds([[minLng, minLat], [maxLng, maxLat]], { padding, duration: 0 }) map!.fitBounds([[minLng, minLat], [maxLng, maxLat]], { padding, duration: 0 })
} }
// ── Map init ────────────────────────────────────────────────────────── // ── Map init ──────────────────────────────────────────────────────────
const initMap = (): void => { const initMap = (): void => {
@@ -738,10 +711,10 @@ export default defineComponent({
maxzoom: 19, maxzoom: 19,
attribution: cartoAttribution.value, attribution: cartoAttribution.value,
tiles: [ tiles: [
`https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png?key=${carto_key}`, 'https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png',
`https://b.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png?key=${carto_key}`, 'https://b.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png',
`https://c.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png?key=${carto_key}`, 'https://c.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png',
`https://d.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png?key=${carto_key}`, 'https://d.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png',
], ],
}, },
}, },
@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, onMounted, onUnmounted } from 'vue' import { ref, watch, onMounted } from 'vue'
import axios from "axios"; import axios from "axios";
import { Notification } from "@/Types/types"; import { Notification } from "@/Types/types";
import { Link } from "@inertiajs/vue3"; import { Link } from "@inertiajs/vue3";
@@ -18,7 +18,6 @@ onMounted(() => {
const open = ref(false) const open = ref(false)
const notifications = ref<Notification[]>([]) const notifications = ref<Notification[]>([])
const loading = ref(false) const loading = ref(false)
const wrapperRef = ref<HTMLElement | null>(null)
const markAllRead = async (notifications: Notification[]) => { const markAllRead = async (notifications: Notification[]) => {
const unread = notifications.filter(n => !n.read_at) const unread = notifications.filter(n => !n.read_at)
@@ -28,20 +27,6 @@ const markAllRead = async (notifications: Notification[]) => {
unread.forEach(n => n.read_at = new Date().toISOString()) unread.forEach(n => n.read_at = new Date().toISOString())
} }
const handleClickOutside = (event: MouseEvent) => {
if (open.value && wrapperRef.value && !wrapperRef.value.contains(event.target as Node)) {
open.value = false
}
}
onMounted(() => {
document.addEventListener('click', handleClickOutside)
})
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside)
})
watch(open, async (isOpen) => { watch(open, async (isOpen) => {
if (!isOpen) return if (!isOpen) return
@@ -58,7 +43,7 @@ watch(open, async (isOpen) => {
</script> </script>
<template> <template>
<div class="notif-wrapper" ref="wrapperRef"> <div class="notif-wrapper">
<v-btn icon variant="text" @click="open = !open" aria-label="Notifications"> <v-btn icon variant="text" @click="open = !open" aria-label="Notifications">
<v-badge :content="store.unreadCount" :model-value="store.unreadCount > 0" color="primary"> <v-badge :content="store.unreadCount" :model-value="store.unreadCount > 0" color="primary">
<v-icon>mdi-bell-outline</v-icon> <v-icon>mdi-bell-outline</v-icon>
@@ -121,16 +106,6 @@ watch(open, async (isOpen) => {
overflow: hidden; overflow: hidden;
} }
@media (max-width: 480px) {
.notif-menu {
position: fixed;
top: 4.5rem; /* adjust to sit just below your navbar height */
left: 50%;
transform: translateX(-50%);
width: min(320px, calc(100vw - 1.5rem));
}
}
.notif-header { .notif-header {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -4,7 +4,6 @@ import FlightMap from "@/Components/FlightsGoneBy/FlightMap.vue";
import Panel from "@/Components/FlightsGoneBy/Panels/Panel.vue"; import Panel from "@/Components/FlightsGoneBy/Panels/Panel.vue";
import DetailRows from "@/Components/FlightsGoneBy/Panels/DetailRows.vue"; import DetailRows from "@/Components/FlightsGoneBy/Panels/DetailRows.vue";
import DetailRow from "@/Components/FlightsGoneBy/Panels/DetailRow.vue"; import DetailRow from "@/Components/FlightsGoneBy/Panels/DetailRow.vue";
import PanelLabel from "@/Components/FlightsGoneBy/Panels/PanelLabel.vue";
defineProps<{ defineProps<{
flight: Flight flight: Flight
@@ -20,10 +19,6 @@ defineProps<{
<DetailRow label="Distance" :value="flight.distance + 'km'" /> <DetailRow label="Distance" :value="flight.distance + 'km'" />
<DetailRow label="Duration" :value="flight.duration_display" /> <DetailRow label="Duration" :value="flight.duration_display" />
</DetailRows> </DetailRows>
<DetailRows>
<PanelLabel v-if="flight.note?.length">Notes</PanelLabel>
{{flight.note}}
</DetailRows>
</Panel> </Panel>
</template> </template>
@@ -1,53 +0,0 @@
<script setup lang="ts">
import GlassTooltip from '@/Components/FlightsGoneBy/GlassTooltip.vue'
import type { Anchor } from 'vuetify'
withDefaults(defineProps<{
label?: string
location?: Anchor
}>(), {
label: 'Missing something?',
})
defineSlots<{
default(): any
}>()
</script>
<template>
<GlassTooltip :location="location ?? 'top'" :open-delay="150">
<template #activator="{ props: activatorProps }">
<button
v-bind="activatorProps"
type="button"
class="missing-entity-link"
>
{{ label }}
</button>
</template>
<template #default>
<slot />
</template>
</GlassTooltip>
</template>
<style scoped>
.missing-entity-link {
display: inline-block;
margin-top: 4px;
padding: 0;
background: none;
border: none;
font-size: 12px;
color: rgba(255, 255, 255, 0.55);
text-decoration: underline;
text-underline-offset: 2px;
cursor: pointer;
transition: color 0.15s ease;
}
.missing-entity-link:hover {
color: rgba(255, 255, 255, 0.85);
}
</style>
+90 -381
View File
@@ -6,9 +6,8 @@ import AirlineSearchBox from '@/Components/FlightsGoneBy/AirlineSearchBox.vue'
import AircraftSearchBox from '@/Components/FlightsGoneBy/AircraftSearchBox.vue' import AircraftSearchBox from '@/Components/FlightsGoneBy/AircraftSearchBox.vue'
import AirportSearchBox from '@/Components/FlightsGoneBy/AirportSearchBox.vue' import AirportSearchBox from '@/Components/FlightsGoneBy/AirportSearchBox.vue'
import type {SeatType, FlightReason, FlightClass, CrewType, SharedProps} from '@/Types/types' import type {SeatType, FlightReason, FlightClass, CrewType, SharedProps} from '@/Types/types'
import { ref, watch, computed, onMounted, nextTick } from 'vue' import { ref, watch, computed } from 'vue'
import { VTimePicker, VDatePicker } from 'vuetify/components' import { VTimePicker, VDatePicker } from 'vuetify/components'
import MissingEntityLink from "@/Components/FlightsGoneBy/Tooltips/MissingEntityLink.vue";
defineOptions({ layout: MainLayout }) defineOptions({ layout: MainLayout })
const page = usePage<SharedProps>().props const page = usePage<SharedProps>().props
@@ -50,13 +49,25 @@ const pad = (n: number) => String(n).padStart(2, '0')
const flightNumber = ref(props.flight?.flight_number ?? '') const flightNumber = ref(props.flight?.flight_number ?? '')
const lookupLoading = ref(false) const lookupLoading = ref(false)
const lookupError = ref<string | null>(null) const lookupError = ref<string | null>(null)
const lookupComplete = ref(true)
interface LookupResult {
airline_options: { value: number; title: string, logo_url: string }[]
from_options: { value: number; title: string; country_code: string }[]
to_options: { value: number; title: string; country_code: string }[]
aircraft_options: { value: number; title: string }[]
scheduled_departure_time: string | null
scheduled_arrival_time: string | null
}
const lookupResult = ref<LookupResult | null>(null)
const lookupKey = ref(0) const lookupKey = ref(0)
async function lookupFlight() { async function lookupFlight() {
if (!flightNumber.value.trim()) return if (!flightNumber.value.trim()) return
lookupLoading.value = true lookupLoading.value = true
lookupError.value = null lookupError.value = null
lookupResult.value = null
try { try {
const response = await fetch(`${route('flights.lookup')}?number=${encodeURIComponent(flightNumber.value.trim())}`, { const response = await fetch(`${route('flights.lookup')}?number=${encodeURIComponent(flightNumber.value.trim())}`, {
@@ -67,6 +78,8 @@ async function lookupFlight() {
lookupError.value = data.message ?? 'Lookup failed.' lookupError.value = data.message ?? 'Lookup failed.'
return return
} }
lookupResult.value = data
lookupComplete.value = true
if (data.airline_options?.length) { if (data.airline_options?.length) {
airlineOptionsData.value = data.airline_options airlineOptionsData.value = data.airline_options
if (!form.airline) form.airline = data.airline_options[0] if (!form.airline) form.airline = data.airline_options[0]
@@ -98,12 +111,6 @@ async function lookupFlight() {
} }
suppressArrivalAutoFill = false suppressArrivalAutoFill = false
// NOTE: if the lookup API is ever extended to return a day
// difference for the arrival (e.g. `data.arrival_day_offset`),
// wire it in here: `arrivalOffset.value = data.arrival_day_offset`
// (clamped/mapped to 'custom' if outside -1..2). Left out for now
// since the API doesn't provide it yet.
lookupKey.value++ lookupKey.value++
} catch (e) { } catch (e) {
lookupError.value = String(e) lookupError.value = String(e)
@@ -115,6 +122,7 @@ async function lookupFlight() {
// ── Display form (drives the template) ─────────────────────────────────────── // ── Display form (drives the template) ───────────────────────────────────────
const form = useForm({ const form = useForm({
flight_number: props.flight?.flight_number ?? '',
departure_date: props.flight?.departure_date ?? '', departure_date: props.flight?.departure_date ?? '',
arrival_date: props.flight?.arrival_date ?? '', arrival_date: props.flight?.arrival_date ?? '',
from: props.flight?.from_options[0] ?? null as { value: number; title: string; country_code: string } | null, from: props.flight?.from_options[0] ?? null as { value: number; title: string; country_code: string } | null,
@@ -155,9 +163,9 @@ const submitForm = useForm({
crew_type_id: null as number | null, crew_type_id: null as number | null,
note: '' as string | null, note: '' as string | null,
auto_update: false, auto_update: false,
add_more: false,
}) })
const departureIsFuture = computed(() => { const departureIsFuture = computed(() => {
if (!form.departure_date) return false if (!form.departure_date) return false
return new Date(form.departure_date) > new Date() return new Date(form.departure_date) > new Date()
@@ -169,7 +177,7 @@ watch(departureIsFuture, (isFuture) => {
}, { immediate: true }) }, { immediate: true })
function submit(addMore = false) { function submit() {
submitForm.flight_number = flightNumber.value submitForm.flight_number = flightNumber.value
submitForm.departure_date = form.departure_date submitForm.departure_date = form.departure_date
submitForm.arrival_date = form.arrival_date submitForm.arrival_date = form.arrival_date
@@ -185,7 +193,6 @@ function submit(addMore = false) {
submitForm.crew_type_id = form.crew_type?.id ?? null submitForm.crew_type_id = form.crew_type?.id ?? null
submitForm.note = form.note submitForm.note = form.note
submitForm.auto_update = form.auto_update submitForm.auto_update = form.auto_update
submitForm.add_more = addMore
if (isEdit) { if (isEdit) {
submitForm.put(route('flights.update', { flight: props.flight!.id })) submitForm.put(route('flights.update', { flight: props.flight!.id }))
@@ -223,15 +230,9 @@ function combineDateTime(date: Date | null, time: string | null): string {
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${(hh ?? '00').padStart(2, '0')}:${(mm ?? '00').padStart(2, '0')}` return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${(hh ?? '00').padStart(2, '0')}:${(mm ?? '00').padStart(2, '0')}`
} }
// Whole-day difference between two Date objects (time-of-day ignored). function clearDepartureDate() { departureDatePart.value = null }
function diffInDays(from: Date | null, to: Date | null): number | null {
if (!from || !to) return null
const a = new Date(from.getFullYear(), from.getMonth(), from.getDate())
const b = new Date(to.getFullYear(), to.getMonth(), to.getDate())
return Math.round((b.getTime() - a.getTime()) / 86_400_000)
}
function clearDepartureTime() { departureTimePart.value = null } function clearDepartureTime() { departureTimePart.value = null }
function clearArrivalDate() { arrivalDatePart.value = null }
function clearArrivalTime() { arrivalTimePart.value = null } function clearArrivalTime() { arrivalTimePart.value = null }
// Normalizes whatever shape the API sends a scheduled time in ("14:30", // Normalizes whatever shape the API sends a scheduled time in ("14:30",
@@ -277,88 +278,19 @@ watch([arrivalDatePart, arrivalTimePart], () => {
form.arrival_date = combineDateTime(arrivalDatePart.value, arrivalTimePart.value) form.arrival_date = combineDateTime(arrivalDatePart.value, arrivalTimePart.value)
}) })
// ── Arrival day offset ─────────────────────────────────────────────────────── // Auto-fill arrival (+1hr) the first time a departure TIME is chosen (and a
// Rather than making the user pick an independent arrival date, arrival date // departure date is already set) and arrival is still empty. Picking the
// is normally *derived* from departure date + a small relative offset // departure date alone no longer triggers this — only setting the time does.
// (-1 / Same day / +1 / +2). "Custom" drops back to a real date picker for
// the rare case that falls outside that range. This avoids needing airport
// time zones to work out the arrival date, which a duration-based input
// would require.
type ArrivalOffset = -1 | 0 | 1 | 2
const arrivalOffsetOptions: { value: ArrivalOffset; label: string }[] = [
{ value: -1, label: '1 Day' },
{ value: 0, label: 'Same Day' },
{ value: 1, label: '+1 Day' },
{ value: 2, label: '+2 Days' },
]
const initialDiff = diffInDays(depInit.date, arrInit.date)
const initialDiffIsQuickOption = initialDiff !== null && ([-1, 0, 1, 2] as number[]).includes(initialDiff)
// 'offset' (the default): arrival date is derived from departure date + the
// selected quick offset. 'custom': the user has dropped into a real date
// picker, e.g. because the actual gap is more than +2 days.
const arrivalDateMode = ref<'offset' | 'custom'>(
initialDiff !== null && !initialDiffIsQuickOption ? 'custom' : 'offset'
)
const arrivalOffset = ref<ArrivalOffset>(
initialDiffIsQuickOption ? (initialDiff as ArrivalOffset) : 0
)
function applyArrivalOffset() {
if (suppressArrivalAutoFill) return
if (arrivalDateMode.value === 'custom') return
if (!departureDatePart.value) {
arrivalDatePart.value = null
return
}
const d = new Date(departureDatePart.value)
d.setDate(d.getDate() + arrivalOffset.value)
arrivalDatePart.value = d
}
// Re-derive arrival date whenever departure date moves, or the offset is
// changed by hand.
watch(departureDatePart, applyArrivalOffset)
watch(arrivalOffset, applyArrivalOffset)
function useCustomArrivalDate() {
arrivalDateMode.value = 'custom'
}
function useQuickArrivalOffset() {
arrivalDateMode.value = 'offset'
applyArrivalOffset()
}
function formatFullDate(d: Date | null): string {
if (!d) return ''
return d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' })
}
// Auto-fill arrival TIME (+1hr) the first time a departure time is chosen
// (and a departure date is already set) and arrival time is still empty.
// If adding the hour rolls over midnight, bump the offset selector to match
// (e.g. departs 23:30 -> offset flips to "+1") so the resolved arrival date
// stays correct without the user having to notice and fix it themselves.
watch(departureTimePart, (newTime) => { watch(departureTimePart, (newTime) => {
if (suppressArrivalAutoFill) return if (suppressArrivalAutoFill) return
if (arrivalDateMode.value === 'custom') return if (!newTime || !departureDatePart.value || arrivalDatePart.value) return
if (!newTime || !departureDatePart.value || arrivalTimePart.value) return
const dep = new Date(departureDatePart.value) const dep = new Date(departureDatePart.value)
const [h, m] = newTime.split(':').map(Number) const [h, m] = newTime.split(':').map(Number)
dep.setHours(h, m) dep.setHours(h, m)
const arr = new Date(dep.getTime() + 60 * 60 * 1000) const arr = new Date(dep.getTime() + 60 * 60 * 1000)
const rawDiff = diffInDays(departureDatePart.value, arr) ?? 0
const clampedDiff = Math.min(Math.max(rawDiff, -1), 2) as -1 | 0 | 1 | 2
suppressArrivalAutoFill = true suppressArrivalAutoFill = true
arrivalOffset.value = clampedDiff
arrivalDatePart.value = new Date(arr.getFullYear(), arr.getMonth(), arr.getDate()) arrivalDatePart.value = new Date(arr.getFullYear(), arr.getMonth(), arr.getDate())
arrivalTimePart.value = `${pad(arr.getHours())}:${pad(arr.getMinutes())}` arrivalTimePart.value = `${pad(arr.getHours())}:${pad(arr.getMinutes())}`
suppressArrivalAutoFill = false suppressArrivalAutoFill = false
@@ -381,31 +313,11 @@ const arrivalMaxDate = computed(() => arrivalMax.value ? new Date(arrivalMax.val
// ── Native date inputs ─────────────────────────────────────────────────────── // ── Native date inputs ───────────────────────────────────────────────────────
// departureDatePart / arrivalDatePart stay the source of truth as Date // departureDatePart / arrivalDatePart stay the source of truth as Date
// objects. The <input type="date"> elements below are deliberately left // objects. These computed get/set pairs are what the native <input type=date>
// UNCONTROLLED from Vue's perspective — no v-model, no :model-value, no // elements bind to — the browser handles locale display, typing, and
// reactive :value binding of any kind. That's on purpose: any reactive // validation itself, so no custom format-aware parsing is needed here.
// binding through Vuetify's v-text-field — even one that only commits on // The Vuetify v-date-picker is still available via a separate calendar icon
// blur/change, not every keystroke — still runs through v-text-field's own // for users who prefer to pick from a calendar rather than type.
// internal echo of the field, which re-renders the wrapped <input> on every
// keystroke regardless of what we bind from outside. For type="date"
// specifically, that internal re-render resets the browser's own
// per-segment editing state mid-type (day/month/year), which is what was
// scrambling what you typed. Using a genuinely uncontrolled native <input>
// (not wrapped in v-text-field at all) sidesteps that entirely.
//
// We grab a direct DOM ref to each native input and manage its .value
// imperatively instead:
// - once on mount, to show the initial value
// - whenever departureDatePart/arrivalDatePart changes from elsewhere
// (the calendar picker, a flight lookup, auto-fill) — but only if the
// field isn't currently focused, so we never fight with active typing
// - the native `change` event (fires once a full date has been entered
// and committed, or cleared) is what flows the typed value back into
// departureDatePart/arrivalDatePart
// This keeps the real native, locale-aware date input and picker UI intact.
//
// The arrival native date input only exists in the DOM while arrivalOffset
// is 'custom' (see template); its value is (re)synced whenever it mounts.
function toIsoDateString(d: Date | null): string { function toIsoDateString(d: Date | null): string {
if (!d) return '' if (!d) return ''
@@ -419,42 +331,16 @@ function fromIsoDateString(value: string): Date | null {
return new Date(y, m - 1, d) return new Date(y, m - 1, d)
} }
const departureDateEl = ref<HTMLInputElement | null>(null) const departureDateValue = computed({
const arrivalDateEl = ref<HTMLInputElement | null>(null) get: () => toIsoDateString(departureDatePart.value),
set: (value: string) => { departureDatePart.value = fromIsoDateString(value) },
onMounted(() => {
if (departureDateEl.value) departureDateEl.value.value = toIsoDateString(departureDatePart.value)
if (arrivalDateEl.value) arrivalDateEl.value.value = toIsoDateString(arrivalDatePart.value)
}) })
watch(departureDatePart, (d) => { const arrivalDateValue = computed({
const el = departureDateEl.value get: () => toIsoDateString(arrivalDatePart.value),
if (el && document.activeElement !== el) el.value = toIsoDateString(d) set: (value: string) => { arrivalDatePart.value = fromIsoDateString(value) },
}) })
watch(arrivalDatePart, (d) => {
const el = arrivalDateEl.value
if (el && document.activeElement !== el) el.value = toIsoDateString(d)
})
// The arrival native input only exists while arrivalDateMode === 'custom',
// so re-sync its value whenever it (re)mounts into the DOM.
watch(arrivalDateMode, async (mode) => {
if (mode !== 'custom') return
await nextTick()
if (arrivalDateEl.value) arrivalDateEl.value.value = toIsoDateString(arrivalDatePart.value)
})
function commitDepartureDateInput(e: Event) {
const value = (e.target as HTMLInputElement).value
departureDatePart.value = value ? fromIsoDateString(value) : null
}
function commitArrivalDateInput(e: Event) {
const value = (e.target as HTMLInputElement).value
arrivalDatePart.value = value ? fromIsoDateString(value) : null
}
// ── Editable, format-aware time text fields ──────────────────────────────── // ── Editable, format-aware time text fields ────────────────────────────────
// departureTimePart / arrivalTimePart stay the source of truth as internal // departureTimePart / arrivalTimePart stay the source of truth as internal
// "HH:mm" (24hr) strings. These input refs are what the text-fields actually // "HH:mm" (24hr) strings. These input refs are what the text-fields actually
@@ -586,33 +472,30 @@ function commitArrivalTimeInput() {
<!-- Departure date + time --> <!-- Departure date + time -->
<v-row> <v-row>
<v-col cols="12" sm="6"> <v-col cols="12" sm="6">
<div class="native-date-field"> <v-text-field
<v-icon icon="mdi-calendar" size="20" class="native-date-field__icon" /> v-model="departureDateValue"
<label class="native-date-field__label">Departure Date</label> type="date"
<input label="Departure Date"
ref="departureDateEl" prepend-inner-icon="mdi-calendar"
type="date" :disabled="!lookupComplete"
class="native-date-field__input" :error-messages="submitForm.errors.departure_date"
@change="commitDepartureDateInput" >
> <template #append-inner>
<v-menu v-model="depDateMenu" :close-on-content-click="false"> <v-menu v-model="depDateMenu" :close-on-content-click="false">
<template #activator="{ props: menuProps }"> <template #activator="{ props: menuProps }">
<v-icon <v-icon
v-bind="menuProps" v-bind="menuProps"
icon="mdi-calendar-month" icon="mdi-calendar-month"
size="20" style="cursor: pointer"
style="cursor: pointer" />
</template>
<v-date-picker
v-model="departureDatePart"
@update:model-value="depDateMenu = false"
/> />
</template> </v-menu>
<v-date-picker </template>
v-model="departureDatePart" </v-text-field>
@update:model-value="depDateMenu = false"
/>
</v-menu>
</div>
<div v-if="submitForm.errors.departure_date" class="native-date-field__error text-error">
{{ submitForm.errors.departure_date }}
</div>
</v-col> </v-col>
<v-col cols="12" sm="6"> <v-col cols="12" sm="6">
<v-menu v-model="depTimeMenu" :close-on-content-click="false"> <v-menu v-model="depTimeMenu" :close-on-content-click="false">
@@ -624,6 +507,7 @@ function commitArrivalTimeInput() {
clearable clearable
prepend-inner-icon="mdi-clock-outline" prepend-inner-icon="mdi-clock-outline"
:placeholder="timeFormat === '24hr' ? 'e.g. 1430' : 'e.g. 2:30 PM'" :placeholder="timeFormat === '24hr' ? 'e.g. 1430' : 'e.g. 2:30 PM'"
:disabled="!lookupComplete"
@click:clear="clearDepartureTime" @click:clear="clearDepartureTime"
@blur="commitDepartureTimeInput" @blur="commitDepartureTimeInput"
@keydown.enter="commitDepartureTimeInput" @keydown.enter="commitDepartureTimeInput"
@@ -644,59 +528,23 @@ function commitArrivalTimeInput() {
</v-col> </v-col>
</v-row> </v-row>
<!-- Arrival --> <!-- Arrival date + time -->
<v-row> <v-row>
<v-col cols="12" sm="6"> <v-col cols="12" sm="6">
<label class="arrival-offset__label">Arrival Date</label> <v-text-field
v-model="arrivalDateValue"
<template v-if="arrivalDateMode === 'offset'"> type="date"
<v-btn-toggle label="Arrival Date"
v-model="arrivalOffset" prepend-inner-icon="mdi-calendar"
mandatory :disabled="!lookupComplete"
variant="outlined" :error-messages="submitForm.errors.arrival_date"
color="primary" >
divided <template #append-inner>
class="arrival-offset__toggle"
>
<v-btn
v-for="opt in arrivalOffsetOptions"
:key="opt.value"
:value="opt.value"
class="arrival-offset__btn"
>
{{ opt.label }}
</v-btn>
</v-btn-toggle>
<div class="arrival-offset__footer">
<span v-if="arrivalDatePart" class="arrival-offset__hint">
Arrives {{ formatFullDate(arrivalDatePart) }}
</span>
<button
type="button"
class="arrival-offset__link"
@click="useCustomArrivalDate"
>
Custom date
</button>
</div>
</template>
<template v-else>
<div class="native-date-field">
<v-icon icon="mdi-calendar" size="20" class="native-date-field__icon" />
<input
ref="arrivalDateEl"
type="date"
class="native-date-field__input"
@change="commitArrivalDateInput"
>
<v-menu v-model="arrDateMenu" :close-on-content-click="false"> <v-menu v-model="arrDateMenu" :close-on-content-click="false">
<template #activator="{ props: menuProps }"> <template #activator="{ props: menuProps }">
<v-icon <v-icon
v-bind="menuProps" v-bind="menuProps"
icon="mdi-calendar-month" icon="mdi-calendar-month"
size="20"
style="cursor: pointer" style="cursor: pointer"
/> />
</template> </template>
@@ -707,19 +555,8 @@ function commitArrivalTimeInput() {
@update:model-value="arrDateMenu = false" @update:model-value="arrDateMenu = false"
/> />
</v-menu> </v-menu>
</div> </template>
<button </v-text-field>
type="button"
class="arrival-offset__link mt-1"
@click="useQuickArrivalOffset"
>
Use quick select instead
</button>
</template>
<div v-if="submitForm.errors.arrival_date" class="native-date-field__error text-error">
{{ submitForm.errors.arrival_date }}
</div>
</v-col> </v-col>
<v-col cols="12" sm="6"> <v-col cols="12" sm="6">
<v-menu v-model="arrTimeMenu" :close-on-content-click="false"> <v-menu v-model="arrTimeMenu" :close-on-content-click="false">
@@ -731,6 +568,7 @@ function commitArrivalTimeInput() {
clearable clearable
prepend-inner-icon="mdi-clock-outline" prepend-inner-icon="mdi-clock-outline"
:placeholder="timeFormat === '24hr' ? 'e.g. 1430' : 'e.g. 2:30 PM'" :placeholder="timeFormat === '24hr' ? 'e.g. 1430' : 'e.g. 2:30 PM'"
:disabled="!lookupComplete"
@click:clear="clearArrivalTime" @click:clear="clearArrivalTime"
@blur="commitArrivalTimeInput" @blur="commitArrivalTimeInput"
@keydown.enter="commitArrivalTimeInput" @keydown.enter="commitArrivalTimeInput"
@@ -759,11 +597,8 @@ function commitArrivalTimeInput() {
label="From" label="From"
:prefilled-options="fromOptionsData" :prefilled-options="fromOptionsData"
:error-messages="submitForm.errors.from_id" :error-messages="submitForm.errors.from_id"
:disabled="!lookupComplete"
/> />
<MissingEntityLink label="Missing airport?">
<p>If you can't find an airport we will be happy to add it, but you'll have to contact support with details of the airport.</p>
<p>Unfortunately you won't be able to proceed with adding this flight until the airport has been added.</p>
</MissingEntityLink>
</v-col> </v-col>
</v-row> </v-row>
@@ -775,6 +610,7 @@ function commitArrivalTimeInput() {
label="To" label="To"
:prefilled-options="toOptionsData" :prefilled-options="toOptionsData"
:error-messages="submitForm.errors.to_id" :error-messages="submitForm.errors.to_id"
:disabled="!lookupComplete"
/> />
</v-col> </v-col>
</v-row> </v-row>
@@ -787,11 +623,8 @@ function commitArrivalTimeInput() {
v-model="form.airline" v-model="form.airline"
:prefilled-options="airlineOptionsData" :prefilled-options="airlineOptionsData"
:error-messages="submitForm.errors.airline_id" :error-messages="submitForm.errors.airline_id"
:disabled="!lookupComplete"
/> />
<MissingEntityLink label="Missing airline? No problem">
<p>If you can't find the airline you flew with, just leave it blank but make sure to add a valid flight number. We will be notified of flights with missing airlines and add the airline shortly.</p>
<p>If you don't know your flight number or a missing airline hasn't been added within 48 hours, please contact support.</p>
</MissingEntityLink>
</v-col> </v-col>
</v-row> </v-row>
@@ -803,6 +636,7 @@ function commitArrivalTimeInput() {
v-model="form.aircraft" v-model="form.aircraft"
:prefilled-options="aircraftOptionsData" :prefilled-options="aircraftOptionsData"
:error-messages="submitForm.errors.aircraft_id" :error-messages="submitForm.errors.aircraft_id"
:disabled="!lookupComplete"
/> />
</v-col> </v-col>
</v-row> </v-row>
@@ -814,6 +648,7 @@ function commitArrivalTimeInput() {
v-model="form.aircraft_registration" v-model="form.aircraft_registration"
label="Aircraft Registration" label="Aircraft Registration"
placeholder="e.g. VH-OQA" placeholder="e.g. VH-OQA"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.aircraft_registration" :error-messages="submitForm.errors.aircraft_registration"
/> />
</v-col> </v-col>
@@ -825,6 +660,7 @@ function commitArrivalTimeInput() {
item-title="name" item-title="name"
item-value="id" item-value="id"
:return-object="true" :return-object="true"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.flight_class_id" :error-messages="submitForm.errors.flight_class_id"
/> />
</v-col> </v-col>
@@ -837,6 +673,7 @@ function commitArrivalTimeInput() {
v-model="form.seat_number" v-model="form.seat_number"
label="Seat Number" label="Seat Number"
placeholder="e.g. 12A" placeholder="e.g. 12A"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.seat_number" :error-messages="submitForm.errors.seat_number"
/> />
</v-col> </v-col>
@@ -848,6 +685,7 @@ function commitArrivalTimeInput() {
item-title="name" item-title="name"
item-value="id" item-value="id"
:return-object="true" :return-object="true"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.seat_type_id" :error-messages="submitForm.errors.seat_type_id"
/> />
</v-col> </v-col>
@@ -863,6 +701,7 @@ function commitArrivalTimeInput() {
item-title="name" item-title="name"
item-value="id" item-value="id"
:return-object="true" :return-object="true"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.flight_reason_id" :error-messages="submitForm.errors.flight_reason_id"
/> />
</v-col> </v-col>
@@ -874,6 +713,7 @@ function commitArrivalTimeInput() {
item-title="name" item-title="name"
item-value="id" item-value="id"
:return-object="true" :return-object="true"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.crew_type_id" :error-messages="submitForm.errors.crew_type_id"
/> />
</v-col> </v-col>
@@ -886,6 +726,7 @@ function commitArrivalTimeInput() {
v-model="form.note" v-model="form.note"
label="Note" label="Note"
placeholder="Any additional notes…" placeholder="Any additional notes…"
:disabled="!lookupComplete"
:error-messages="submitForm.errors.note" :error-messages="submitForm.errors.note"
rows="3" rows="3"
auto-grow auto-grow
@@ -899,6 +740,7 @@ function commitArrivalTimeInput() {
<v-checkbox <v-checkbox
v-model="form.auto_update" v-model="form.auto_update"
label="Automatically update flight details within 24 hours of flight departure" label="Automatically update flight details within 24 hours of flight departure"
:disabled="!lookupComplete"
hide-details hide-details
density="compact" density="compact"
/> />
@@ -907,27 +749,15 @@ function commitArrivalTimeInput() {
<!-- Submit --> <!-- Submit -->
<v-row> <v-row>
<v-col v-if="!isEdit" cols="12" md="6"> <v-col cols="12">
<v-btn <v-btn
block block
size="large" size="large"
variant="outlined" :loading="submitForm.processing"
:loading="submitForm.processing && submitForm.add_more" :disabled="!lookupComplete || submitForm.processing"
:disabled="submitForm.processing" @click="submit"
@click="submit(true)"
> >
Save Flight and Add Another {{ isEdit ? 'Save Changes' : 'Add Flight' }}
</v-btn>
</v-col>
<v-col cols="12" :md="isEdit ? 12 : 6">
<v-btn
block
size="large"
:loading="submitForm.processing && !submitForm.add_more"
:disabled="submitForm.processing"
@click="submit(false)"
>
{{ isEdit ? 'Save Changes' : 'Save Flight' }}
</v-btn> </v-btn>
</v-col> </v-col>
</v-row> </v-row>
@@ -938,129 +768,8 @@ function commitArrivalTimeInput() {
</template> </template>
<style scoped> <style scoped>
/* Hand-rolled field chrome for the native <input type="date"> fields. :deep(input[type="date"]::-webkit-calendar-picker-indicator) {
These deliberately bypass v-text-field (see the "Native date inputs"
comment in the script block for why), so we approximate the surrounding
Vuetify outlined-field look here instead of getting it for free. */
.native-date-field {
position: relative;
display: flex;
align-items: center;
gap: 10px;
min-height: 56px;
padding: 8px 12px;
border: 1px none rgba(255, 255, 255, 0.24);
border-bottom-style: solid;
background: transparent;
transition: border-color 0.15s ease;
}
.native-date-field:focus-within {
border-color: rgb(var(--surface));
border-width: 2px;
padding: 7px 11px;
}
.native-date-field__icon {
opacity: 0.7;
flex-shrink: 0;
}
.native-date-field__label {
position: absolute;
top: -8px;
left: 38px;
padding: 0 4px;
font-size: 12px;
line-height: 1;
color: rgba(255, 255, 255, 0.6);
pointer-events: none;
}
.native-date-field__input {
flex: 1;
min-width: 0;
background: transparent;
border: none;
outline: none;
color: inherit;
font-size: 16px;
color-scheme: dark;
}
.native-date-field__input::-webkit-calendar-picker-indicator {
display: none; display: none;
-webkit-appearance: none; -webkit-appearance: none;
} }
/* Firefox doesn't support ::-webkit-calendar-picker-indicator; this trims
its built-in indicator/spinner button area instead. */
.native-date-field__input::-moz-calendar-picker-indicator {
display: none;
}
.native-date-field__error {
margin-top: 4px;
padding-left: 12px;
font-size: 12px;
}
/* Arrival day-offset control */
.arrival-offset__label {
display: block;
font-size: 12px;
line-height: 1;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 6px;
padding-left: 2px;
}
.arrival-offset__toggle {
display: grid;
grid-template-columns: repeat(4, 1fr);
width: 100%;
height: 48px;
border-radius: 4px;
}
.arrival-offset__btn {
min-width: 0;
flex: none;
width: 100%;
height: 100%;
font-size: 11px;
letter-spacing: 0;
text-transform: none;
padding: 0 4px;
}
.arrival-offset__footer {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
margin-top: 6px;
padding: 0 2px;
}
.arrival-offset__hint {
font-size: 13px;
color: rgba(255, 255, 255, 0.7);
}
.arrival-offset__link {
flex-shrink: 0;
font-size: 12px;
color: rgba(255, 255, 255, 0.75);
background: none;
border: none;
padding: 0;
cursor: pointer;
text-decoration: underline;
text-underline-offset: 2px;
}
.arrival-offset__link:hover {
color: rgb(255, 255, 255);
}
</style> </style>
+1 -1
View File
@@ -19,7 +19,7 @@ defineProps<{
Reconcile Missing Liveries Reconcile Missing Liveries
<v-chip size="x-small" color="error" class="ml-1">{{ missingLiveryCount }}</v-chip> <v-chip size="x-small" color="error" class="ml-1">{{ missingLiveryCount }}</v-chip>
</Link> </Link>
<Link v-if="missingAirlineCount" :href="route('admin.reconcile-missing-airlines')" class="sidebar-link"> <Link :href="route('admin.reconcile-missing-airlines')" class="sidebar-link">
<v-icon icon="mdi-airplane-takeoff" size="18" /> <v-icon icon="mdi-airplane-takeoff" size="18" />
Reconcile Missing Airlines Reconcile Missing Airlines
<v-chip size="x-small" color="error" class="ml-1">{{ missingAirlineCount }}</v-chip> <v-chip size="x-small" color="error" class="ml-1">{{ missingAirlineCount }}</v-chip>
-2
View File
@@ -110,7 +110,6 @@ export type SharedProps = import('@inertiajs/core').PageProps & {
logo_api_url: string logo_api_url: string
achievement_notifications: Notification[] achievement_notifications: Notification[]
unread_notification_count: number unread_notification_count: number
carto_api_key: string
} }
export interface AchievementDifficulty { export interface AchievementDifficulty {
id: number id: number
@@ -335,7 +334,6 @@ export interface MissingAirline{
flights: { flights: {
flight_number: string; flight_number: string;
link: string; link: string;
id: number;
}[] }[]
} }
-2
View File
@@ -42,8 +42,6 @@ use Inertia\Inertia;
Route::post('/ignore-missing-livery', [AdminController::class, 'ignoreMissingLivery'])->name('ignore-missing-livery'); Route::post('/ignore-missing-livery', [AdminController::class, 'ignoreMissingLivery'])->name('ignore-missing-livery');
Route::get('/missing-airlines', [AdminController::class, 'reconcileMissingAirlines'])->name('reconcile-missing-airlines')->middleware('permission:reconcile_missing_liveries'); Route::get('/missing-airlines', [AdminController::class, 'reconcileMissingAirlines'])->name('reconcile-missing-airlines')->middleware('permission:reconcile_missing_liveries');
Route::post('/ignore-missing-airline', [AdminController::class, 'ignoreMissingAirline'])->name('admin.ignore-missing-airline');
}); });