Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 3 additions & 5 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM node:20-alpine3.19 AS base
FROM node:24-alpine3.22 AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Remove next line if corepack version was updated in node:20 image
# RUN corepack enable
RUN corepack disable && npm install -g pnpm@latest
RUN corepack enable
COPY . /app
WORKDIR /app

Expand All @@ -15,7 +13,7 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

# Production build
FROM nginx:1.23.1-alpine
FROM nginx:1.29.4-alpine
#RUN addgroup app && adduser -S -G app app
#USER app
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
Expand Down
13 changes: 5 additions & 8 deletions client/src/views/ResultsOverall.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script setup lang="ts">
import ApiService from "@/services/ApiService";
import { setWindowName } from "../helper/utils";
import { ref } from "vue";
import { useRoute } from "vue-router";
import useData from "../composables/useData";
import { ref } from "vue";
import { setWindowName } from "../helper/utils";

const route = useRoute();
const title = ref("Gesamtwertung");
const remark = ref("");

setWindowName(title.value);

const { initData, data: results, dataConstants, noDataFlag } = useData();
const remark = ref(dataConstants.value?.REMARKS);

// Prevent to send a request query with an empty year parameter
const params = route.params.year ? route.params : undefined;
Expand All @@ -36,11 +36,8 @@ await initData(ApiService.getResultsOverall, {
<FilterPanel />
</div>
</div>
<ResultsTableGeneric
:results="results"
:no-data-flag="noDataFlag"
:max-flights="dataConstants?.NUMBER_OF_SCORED_FLIGHTS ?? 0"
/>
<ResultsTableGeneric :results="results" :no-data-flag="noDataFlag"
:max-flights="dataConstants?.NUMBER_OF_SCORED_FLIGHTS ?? 0" />
</div>
<GenericError v-else />
</div>
Expand Down
6 changes: 2 additions & 4 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM node:20-alpine3.19
FROM node:24-alpine3.22

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Remove next line if corepack version was updated in node:20 image
# RUN corepack enable
RUN corepack disable && npm install -g pnpm@latest
RUN corepack enable

# Packages are necessary to run c-compiled apps (e.g. OLC) on alpine
# TODO: Replace compiled app through usage of Node’s N-API
Expand Down
58 changes: 29 additions & 29 deletions server/service/FlightService.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
import sequelize from "sequelize";
import db from "../db";
import { calculateFlightResult, OLCResult } from "../igc/IgcAnalyzer";
import { findLanding } from "../igc/LocationFinder";
import { calculateFlightStats } from "../igc/FlightStatsCalculator";
import { getCurrentActive } from "./SeasonService";
import { findClosestTakeoff } from "./FlyingSiteService";
import { hasAirspaceViolation } from "./AirspaceService";
import MailService from "./MailService";
import { isNoWorkday } from "../helper/HolidayCalculator";
import { sleep, findKeyByValue } from "../helper/Utils";
import { deleteIgcFile } from "../helper/igc-file-utils";
import { COUNTRY, STATE as USER_STATE } from "../constants/user-constants";
import { FLIGHT_STATE } from "../constants/flight-constants";
import logger from "../config/logger";
import config from "../config/env-config";
import logger from "../config/logger";
import { FLIGHT_STATE } from "../constants/flight-constants";
import { COUNTRY, STATE as USER_STATE } from "../constants/user-constants";
import db from "../db";
import {
combineFixesProperties,
createGeometry,
extractTimeAndHeights,
combineFixesProperties,
} from "../helper/FlightFixUtils";
import { checkSiteRecordsAndUpdate } from "./SiteRecordCache";
import { isNoWorkday } from "../helper/HolidayCalculator";
import { findKeyByValue, sleep } from "../helper/Utils";
import { deleteIgcFile } from "../helper/igc-file-utils";
import {
getElevationData,
addElevationToFixes,
getElevationData,
logElevationError,
} from "../igc/ElevationHelper";
import { calculateFlightStats } from "../igc/FlightStatsCalculator";
import { calculateFlightResult, OLCResult } from "../igc/IgcAnalyzer";
import { findLanding } from "../igc/LocationFinder";
import { hasAirspaceViolation } from "./AirspaceService";
import { findClosestTakeoff } from "./FlyingSiteService";
import MailService from "./MailService";
import { getCurrentActive } from "./SeasonService";
import { checkSiteRecordsAndUpdate } from "./SiteRecordCache";

import { checkIfFlightIsNewPersonalBest } from "../helper/PersonalBest";
import {
FlightAttributes,
FlightInstance,
FlightInstanceUserInclude,
} from "../db/models/Flight";
import { Glider } from "../types/Glider";
import { FlightFixCombined, FlightFixStat } from "../types/FlightFixes";
import { Fn } from "sequelize/types/utils";
import { FlightCommentInstance } from "../db/models/FlightComment";
import { FlightPhotoInstance } from "../db/models/FlightPhoto";
import { FaiResponse } from "../igc/IgcValidator";
import {
addDays,
addHours,
Expand All @@ -46,6 +34,18 @@ import {
subDays,
subHours,
} from "date-fns";
import { Fn } from "sequelize/types/utils";
import {
FlightAttributes,
FlightInstance,
FlightInstanceUserInclude,
} from "../db/models/Flight";
import { FlightCommentInstance } from "../db/models/FlightComment";
import { FlightPhotoInstance } from "../db/models/FlightPhoto";
import { checkIfFlightIsNewPersonalBest } from "../helper/PersonalBest";
import { FaiResponse } from "../igc/IgcValidator";
import { FlightFixCombined, FlightFixStat } from "../types/FlightFixes";
import { Glider } from "../types/Glider";

interface WhereOptions {
year?: number;
Expand Down
51 changes: 27 additions & 24 deletions server/service/ResultService.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
import db from "../db";

import sequelize from "sequelize";
import seasonService from "./SeasonService";
import teamService from "./TeamService";
import sequelize from "sequelize";

import { getCurrentYear } from "../helper/Utils";
import { FLIGHT_TYPE, FLIGHT_STATE } from "../constants/flight-constants";
import { GENDER } from "../constants/user-constants";
import {
NEWCOMER_MAX_RANKING_CLASS,
NUMBER_OF_SCORED_FLIGHTS,
TEAM_DISMISSES,
TEAM_SIZE,
NUMBER_OF_SCORED_FLIGHTS,
NEWCOMER_MAX_RANKING_CLASS,
} from "../config/result-determination-config";
import { XccupHttpError } from "../helper/ErrorHandler";
import { FLIGHT_STATE, FLIGHT_TYPE } from "../constants/flight-constants";
import { NOT_FOUND } from "../constants/http-status-constants";
import { GENDER } from "../constants/user-constants";
import { SeasonDetailAttributes } from "../db/models/SeasonDetail";
import { XccupHttpError } from "../helper/ErrorHandler";
import { getCurrentYear } from "../helper/Utils";

import type { RankingTypes } from "../db/models/SeasonDetail";
import type {
UserResults,
UserResultsWithTotals,
ClubResults,
UserResultFlight,
QueryResult,
SiteRecordsUncombined,
FlightSitesWithRecord,
FlightSiteRecord,
Team,
TeamWithMemberFlights,
} from "../types/ResultTypes";
import { addMonths, subMonths } from "date-fns";
import logger from "../config/logger";
import { FlightInstanceUserInclude } from "../db/models/Flight";
import type { RankingTypes } from "../db/models/SeasonDetail";
import {
calcTotalsOfMember,
calcTotalsOverMembers,
limitFlightsForUserAndCalcTotals,
removeMultipleEntriesForUsers,
sortDescendingByTotalPoints,
} from "../helper/ResultUtils";
import logger from "../config/logger";
import { addMonths, subMonths } from "date-fns";
import type {
ClubResults,
FlightSiteRecord,
FlightSitesWithRecord,
QueryResult,
SiteRecordsUncombined,
Team,
TeamWithMemberFlights,
UserResultFlight,
UserResults,
UserResultsWithTotals,
} from "../types/ResultTypes";

const { FlyingSite, User, Flight, Club, Team, Result } = db;

Expand Down Expand Up @@ -98,7 +98,10 @@ const service = {
}: Partial<OptionsGetOverall>) => {
const seasonDetail = await retrieveSeasonDetails(year);

const constantsForResult = { NUMBER_OF_SCORED_FLIGHTS };
const constantsForResult = {
NUMBER_OF_SCORED_FLIGHTS,
REMARKS: seasonDetail?.misc?.textMessages?.resultsOverall,
};

// Search for old overall results
const oldRes = await findOldResults(
Expand Down Expand Up @@ -183,7 +186,7 @@ const service = {

return addConstantInformationToResult(
resultsWithTotals,
{ NUMBER_OF_SCORED_FLIGHTS },
{ ...constantsForResult },
limit
);
},
Expand Down
3 changes: 2 additions & 1 deletion server/test/testdatasets/seasonDetails.json
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,8 @@
"resultsSeniors": "Die Wertung beginnt ab einem Alter von 60 mit einem Bonus von 2% pro weiterem Lebensjahr",
"resultsNewcomer": "Als Newcomer zählen alle Piloten, die in dieser Saison ihren allerersten Wertungsflug eingereicht haben. Es werden nur Flüge mit Geräten bis zur Sportklasse (EN A+EN B) berücksichtigt",
"resultsReynoldsClass": "Schirme mit einem zulässigen Startgewicht von maximal 85kg",
"resultsClub": "Für die Vereinswertung zählen jeweils nur die $MAX_NUMBER_OF_FLIGHTS_PER_CLUB besten Flüge eines jeden Vereins. Dabei gehen max. die $NUMBER_OF_SCORED_FLIGHTS besten Flüge eines einzelnen Piloten mit in die Wertung ein."
"resultsClub": "Für die Vereinswertung zählen jeweils nur die $MAX_NUMBER_OF_FLIGHTS_PER_CLUB besten Flüge eines jeden Vereins. Dabei gehen max. die $NUMBER_OF_SCORED_FLIGHTS besten Flüge eines einzelnen Piloten mit in die Wertung ein.",
"resultsOverall": "Wertung der besten drei eingereichten Flüge eines Piloten, wobei mindestens eine freie Strecke und ein Dreieck eingereicht werden muss. Bei Flügen mit Drachen zählen die besten drei eingereichten Flüge eines Piloten unabhängig der Wertungsart."
},
"rankingConstants": {
"club": {
Expand Down