Compare commits

..
3 Commits
Author SHA1 Message Date
dredgy cb8070eabc Fixed registration sorting 2026-09-06 11:26:21 +10:00
dredgy 36b90a981f Rename number of flight achievements 2026-09-01 12:16:20 +10:00
dredgy 1e60ba5bbf Fixed distance achievements 2026-08-27 22:00:19 +10:00
4 changed files with 13 additions and 16 deletions
@@ -19,7 +19,7 @@ class GeneralFlyingChecker extends BaseChecker
// --- Boolean achievements --- // --- Boolean achievements ---
$this->awardIf($allLoggedFlightsCount >= 1, 'general_flying.first_flight'); $this->awardIf($allLoggedFlightsCount >= 1, 'number_of_flights.first_flight');
$this->awardIf( $this->awardIf(
$flights->contains(fn ($f) => $f->isDomestic()), $flights->contains(fn ($f) => $f->isDomestic()),
@@ -69,10 +69,10 @@ class GeneralFlyingChecker extends BaseChecker
'general_flying.domestic_two_countries' 'general_flying.domestic_two_countries'
); );
$this->awardProgress($count,'general_flying.10_flights'); $this->awardProgress($count,'number_of_flights.10_flights');
$this->awardProgress($count,'general_flying.50_flights'); $this->awardProgress($count,'number_of_flights.50_flights');
$this->awardProgress($count,'general_flying.100_flights'); $this->awardProgress($count,'number_of_flights.100_flights');
$this->awardProgress($count,'general_flying.500_flights'); $this->awardProgress($count,'number_of_flights.500_flights');
$this->awardProgress($count,'general_flying.1000_flights'); $this->awardProgress($count,'number_of_flights.1000_flights');
} }
} }
@@ -9,11 +9,7 @@ import ButtonLink from "@/Components/FlightsGoneBy/ButtonLink.vue";
import Distance from "@/Components/Distance.vue"; import Distance from "@/Components/Distance.vue";
import FormattedNumber from "@/Components/FormattedNumber.vue"; import FormattedNumber from "@/Components/FormattedNumber.vue";
const distanceAchievements = [ const distanceAchievementCategoryId = 6
'general_flying.circumference_of_the_earth',
'general_flying.to_the_moon',
'general_flying.gigametre'
];
const props = defineProps<{ const props = defineProps<{
achievement: Achievement achievement: Achievement
@@ -92,7 +88,7 @@ const unlocked = computed(() => {
<template v-if="achievement.progressive && progress"> <template v-if="achievement.progressive && progress">
<div class="progress-label"> <div class="progress-label">
<span v-if="distanceAchievements.includes(achievement.internal_name)"> <span v-if="achievement.achievement_category_id == distanceAchievementCategoryId">
<Distance :unit="distanceUnit" :showUnits="false" :value="Math.min(progress.current, progress.threshold)" /> / <Distance :unit="distanceUnit" :showUnits="false" :value="Math.min(progress.current, progress.threshold)" /> /
<Distance :unit="distanceUnit" :value="progress.threshold" /> <Distance :unit="distanceUnit" :value="progress.threshold" />
</span> </span>
@@ -19,7 +19,9 @@ 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', 'note']
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) ||
(column === 'aircraft_registration' && columnsToShow.value.includes('registration'))
const allHeaders = [ const allHeaders = [
{ title: '', key: 'airline', sortable: true, resizable: false}, { title: '', key: 'airline', sortable: true, resizable: false},
@@ -38,7 +40,7 @@ const allHeaders = [
{ title: 'MODEL', key: 'aircraft.model_full_name', sortable: true }, { title: 'MODEL', key: 'aircraft.model_full_name', sortable: true },
{ title: 'AIRCRAFT', key: 'aircraft.display_name_short', sortable: true }, { title: 'AIRCRAFT', key: 'aircraft.display_name_short', sortable: true },
{ title: 'AIRCRAFT', key: 'aircraft', sortable: true }, { title: 'AIRCRAFT', key: 'aircraft', sortable: true },
{ title: 'REG', key: 'registration', sortable: true }, { title: 'REG', key: 'aircraft_registration', sortable: true },
{ title: 'CLASS', key: 'flight_class', sortable: true }, { title: 'CLASS', key: 'flight_class', sortable: true },
{ title: 'CLASS', key: 'class_seat_combined', sortable: true }, { title: 'CLASS', key: 'class_seat_combined', sortable: true },
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true }, { title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
@@ -70,7 +72,7 @@ const customKeySort = {
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''), aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''),
duration: (a: any, b: any) => (a ?? 0) - (b ?? 0), duration: (a: any, b: any) => (a ?? 0) - (b ?? 0),
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''), departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? '') arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
} }
const sortBy = ref<DataTableSortItem[]>([]) const sortBy = ref<DataTableSortItem[]>([])
@@ -41,7 +41,6 @@ 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>