Updated logo API

This commit is contained in:
2026-04-23 21:32:25 +10:00
parent 110ed5b984
commit 678096b463
22 changed files with 638 additions and 146 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ const props = defineProps<{
flight_class: FlightClass | null
flight_reason: FlightReason | null
crew_type: CrewType | null
airline_options: { value: number; title: string }[]
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 }[]
@@ -106,7 +106,7 @@ const form = useForm({
arrival_date: props.flight?.arrival_date ?? '',
from: props.flight?.from_options[0] ?? null as { value: number; title: string; country_code: string } | null,
to: props.flight?.to_options[0] ?? null as { value: number; title: string; country_code: string } | null,
airline: props.flight?.airline_options[0] ?? null as { value: number; title: string } | null,
airline: props.flight?.airline_options[0] ?? null as { value: number; title: string; logo_url: string } | null,
aircraft: props.flight?.aircraft_options[0] ?? null as { value: number; title: string } | null,
aircraft_registration: props.flight?.aircraft_registration ?? '',
seat_number: props.flight?.seat_number ?? '',
@@ -170,7 +170,7 @@ function submit() {
// ── Prefilled options ─────────────────────────────────────────────────────────
const airlineOptionsData = ref<{ value: number; title: string }[]>(props.flight?.airline_options ?? [])
const airlineOptionsData = ref<{ value: number; title: string; logo_url: string}[]>(props.flight?.airline_options ?? [])
const fromOptionsData = ref<{ value: number; title: string; country_code: string }[]>(props.flight?.from_options ?? [])
const toOptionsData = ref<{ value: number; title: string; country_code: string }[]>(props.flight?.to_options ?? [])
const aircraftOptionsData = ref<{ value: number; title: string }[]>(props.flight?.aircraft_options ?? [])
-30
View File
@@ -1,30 +0,0 @@
<script setup lang="ts">
import MainLayout from "@/Layouts/MainLayout.vue";
import { Head } from '@inertiajs/vue3';
import {Flight, User} from "@/Types/types";
import ProfileViewSwitcher from "@/Components/FlightsGoneBy/ProfileViewSwitcher.vue";
import ProfileLayout from "@/Components/FlightsGoneBy/ProfileLayout.vue";
import FlightMapAndCharts from "@/Components/FlightsGoneBy/FlightMapAndCharts.vue";
defineOptions({
layout: MainLayout
})
defineProps<{
user: User
flights: Flight[]
canEdit: boolean
}>()
</script>
<template>
<Head :title="`${user.name}'s Flights`" />
<ProfileLayout :flights="flights" :user="user">
<ProfileViewSwitcher active-view="map" :user="user" />
<FlightMapAndCharts :flights="flights" :canEdit="canEdit" />
</ProfileLayout>
</template>
<style scoped>
</style>
+9 -6
View File
@@ -17,11 +17,12 @@ const props = defineProps<{
user: User
flights: Flight[]
canEdit: boolean
selectedFlightId: number | null
selectedFlightId?: number | null
initialView?: ProfileView
isFollowing: boolean
}>()
const localSelectedFlightId = ref(props.selectedFlightId)
const localSelectedFlightId = ref(props.selectedFlightId ?? null)
// ── Filter state ──────────────────────────────────────────────────────────────
const selectedYears = ref<number[]>([])
@@ -69,9 +70,7 @@ function matchesFilters(f: Flight): boolean {
}
const filteredFlights = computed(() => {
console.time('filteredFlights')
const result = props.flights.filter(matchesFilters)
console.timeEnd('filteredFlights')
return result
})
@@ -100,19 +99,23 @@ const routeNames = {
} as const
function switchView(view: ProfileView) {
const flightId = view === 'board' ? localSelectedFlightId.value : null
localSelectedFlightId.value = null
activeView.value = view
window.history.replaceState(
window.history.state,
'',
route(routeNames[view], { username: props.user.name })
route(routeNames[view], {
user: props.user.name,
...(flightId ? { flight: flightId } : {})
})
)
}
</script>
<template>
<Head :title="`${user.name}'s Flights`" />
<ProfileLayout :flights="flights" :user="user">
<ProfileLayout :is-following="isFollowing" :flights="flights" :user="user">
<ProfileViewSwitcher :active-view="activeView" @update:active-view="switchView" />
<DepartureBoard v-if="activeView === 'board'" :flight-id="localSelectedFlightId" :flight-stats="stats" :canEdit="canEdit" />
<BoardingPasses v-if="activeView === 'passes'" :flight-stats="stats" :canEdit="canEdit" />