Skip to content

Commit dbefdbb

Browse files
authored
Merge pull request #938 from XCCup/chore/clean-up-2026_01
Chore/clean up 2026 01
2 parents d44d949 + 19d0bd4 commit dbefdbb

File tree

6 files changed

+68
-71
lines changed

6 files changed

+68
-71
lines changed

client/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
FROM node:20-alpine3.19 AS base
1+
FROM node:24-alpine3.22 AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
4-
# Remove next line if corepack version was updated in node:20 image
5-
# RUN corepack enable
6-
RUN corepack disable && npm install -g pnpm@latest
4+
RUN corepack enable
75
COPY . /app
86
WORKDIR /app
97

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

1715
# Production build
18-
FROM nginx:1.23.1-alpine
16+
FROM nginx:1.29.4-alpine
1917
#RUN addgroup app && adduser -S -G app app
2018
#USER app
2119
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf

client/src/views/ResultsOverall.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script setup lang="ts">
22
import ApiService from "@/services/ApiService";
3-
import { setWindowName } from "../helper/utils";
3+
import { ref } from "vue";
44
import { useRoute } from "vue-router";
55
import useData from "../composables/useData";
6-
import { ref } from "vue";
6+
import { setWindowName } from "../helper/utils";
77
88
const route = useRoute();
99
const title = ref("Gesamtwertung");
10-
const remark = ref("");
1110
1211
setWindowName(title.value);
1312
1413
const { initData, data: results, dataConstants, noDataFlag } = useData();
14+
const remark = ref(dataConstants.value?.REMARKS);
1515
1616
// Prevent to send a request query with an empty year parameter
1717
const params = route.params.year ? route.params : undefined;
@@ -36,11 +36,8 @@ await initData(ApiService.getResultsOverall, {
3636
<FilterPanel />
3737
</div>
3838
</div>
39-
<ResultsTableGeneric
40-
:results="results"
41-
:no-data-flag="noDataFlag"
42-
:max-flights="dataConstants?.NUMBER_OF_SCORED_FLIGHTS ?? 0"
43-
/>
39+
<ResultsTableGeneric :results="results" :no-data-flag="noDataFlag"
40+
:max-flights="dataConstants?.NUMBER_OF_SCORED_FLIGHTS ?? 0" />
4441
</div>
4542
<GenericError v-else />
4643
</div>

server/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM node:20-alpine3.19
1+
FROM node:24-alpine3.22
22

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

97
# Packages are necessary to run c-compiled apps (e.g. OLC) on alpine
108
# TODO: Replace compiled app through usage of Node’s N-API

server/service/FlightService.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
11
import sequelize from "sequelize";
2-
import db from "../db";
3-
import { calculateFlightResult, OLCResult } from "../igc/IgcAnalyzer";
4-
import { findLanding } from "../igc/LocationFinder";
5-
import { calculateFlightStats } from "../igc/FlightStatsCalculator";
6-
import { getCurrentActive } from "./SeasonService";
7-
import { findClosestTakeoff } from "./FlyingSiteService";
8-
import { hasAirspaceViolation } from "./AirspaceService";
9-
import MailService from "./MailService";
10-
import { isNoWorkday } from "../helper/HolidayCalculator";
11-
import { sleep, findKeyByValue } from "../helper/Utils";
12-
import { deleteIgcFile } from "../helper/igc-file-utils";
13-
import { COUNTRY, STATE as USER_STATE } from "../constants/user-constants";
14-
import { FLIGHT_STATE } from "../constants/flight-constants";
15-
import logger from "../config/logger";
162
import config from "../config/env-config";
3+
import logger from "../config/logger";
4+
import { FLIGHT_STATE } from "../constants/flight-constants";
5+
import { COUNTRY, STATE as USER_STATE } from "../constants/user-constants";
6+
import db from "../db";
177
import {
8+
combineFixesProperties,
189
createGeometry,
1910
extractTimeAndHeights,
20-
combineFixesProperties,
2111
} from "../helper/FlightFixUtils";
22-
import { checkSiteRecordsAndUpdate } from "./SiteRecordCache";
12+
import { isNoWorkday } from "../helper/HolidayCalculator";
13+
import { findKeyByValue, sleep } from "../helper/Utils";
14+
import { deleteIgcFile } from "../helper/igc-file-utils";
2315
import {
24-
getElevationData,
2516
addElevationToFixes,
17+
getElevationData,
2618
logElevationError,
2719
} from "../igc/ElevationHelper";
20+
import { calculateFlightStats } from "../igc/FlightStatsCalculator";
21+
import { calculateFlightResult, OLCResult } from "../igc/IgcAnalyzer";
22+
import { findLanding } from "../igc/LocationFinder";
23+
import { hasAirspaceViolation } from "./AirspaceService";
24+
import { findClosestTakeoff } from "./FlyingSiteService";
25+
import MailService from "./MailService";
26+
import { getCurrentActive } from "./SeasonService";
27+
import { checkSiteRecordsAndUpdate } from "./SiteRecordCache";
2828

29-
import { checkIfFlightIsNewPersonalBest } from "../helper/PersonalBest";
30-
import {
31-
FlightAttributes,
32-
FlightInstance,
33-
FlightInstanceUserInclude,
34-
} from "../db/models/Flight";
35-
import { Glider } from "../types/Glider";
36-
import { FlightFixCombined, FlightFixStat } from "../types/FlightFixes";
37-
import { Fn } from "sequelize/types/utils";
38-
import { FlightCommentInstance } from "../db/models/FlightComment";
39-
import { FlightPhotoInstance } from "../db/models/FlightPhoto";
40-
import { FaiResponse } from "../igc/IgcValidator";
4129
import {
4230
addDays,
4331
addHours,
@@ -46,6 +34,18 @@ import {
4634
subDays,
4735
subHours,
4836
} from "date-fns";
37+
import { Fn } from "sequelize/types/utils";
38+
import {
39+
FlightAttributes,
40+
FlightInstance,
41+
FlightInstanceUserInclude,
42+
} from "../db/models/Flight";
43+
import { FlightCommentInstance } from "../db/models/FlightComment";
44+
import { FlightPhotoInstance } from "../db/models/FlightPhoto";
45+
import { checkIfFlightIsNewPersonalBest } from "../helper/PersonalBest";
46+
import { FaiResponse } from "../igc/IgcValidator";
47+
import { FlightFixCombined, FlightFixStat } from "../types/FlightFixes";
48+
import { Glider } from "../types/Glider";
4949

5050
interface WhereOptions {
5151
year?: number;

server/service/ResultService.ts

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
import db from "../db";
22

3+
import sequelize from "sequelize";
34
import seasonService from "./SeasonService";
45
import teamService from "./TeamService";
5-
import sequelize from "sequelize";
66

7-
import { getCurrentYear } from "../helper/Utils";
8-
import { FLIGHT_TYPE, FLIGHT_STATE } from "../constants/flight-constants";
9-
import { GENDER } from "../constants/user-constants";
107
import {
8+
NEWCOMER_MAX_RANKING_CLASS,
9+
NUMBER_OF_SCORED_FLIGHTS,
1110
TEAM_DISMISSES,
1211
TEAM_SIZE,
13-
NUMBER_OF_SCORED_FLIGHTS,
14-
NEWCOMER_MAX_RANKING_CLASS,
1512
} from "../config/result-determination-config";
16-
import { XccupHttpError } from "../helper/ErrorHandler";
13+
import { FLIGHT_STATE, FLIGHT_TYPE } from "../constants/flight-constants";
1714
import { NOT_FOUND } from "../constants/http-status-constants";
15+
import { GENDER } from "../constants/user-constants";
1816
import { SeasonDetailAttributes } from "../db/models/SeasonDetail";
17+
import { XccupHttpError } from "../helper/ErrorHandler";
18+
import { getCurrentYear } from "../helper/Utils";
1919

20-
import type { RankingTypes } from "../db/models/SeasonDetail";
21-
import type {
22-
UserResults,
23-
UserResultsWithTotals,
24-
ClubResults,
25-
UserResultFlight,
26-
QueryResult,
27-
SiteRecordsUncombined,
28-
FlightSitesWithRecord,
29-
FlightSiteRecord,
30-
Team,
31-
TeamWithMemberFlights,
32-
} from "../types/ResultTypes";
20+
import { addMonths, subMonths } from "date-fns";
21+
import logger from "../config/logger";
3322
import { FlightInstanceUserInclude } from "../db/models/Flight";
23+
import type { RankingTypes } from "../db/models/SeasonDetail";
3424
import {
3525
calcTotalsOfMember,
3626
calcTotalsOverMembers,
3727
limitFlightsForUserAndCalcTotals,
3828
removeMultipleEntriesForUsers,
3929
sortDescendingByTotalPoints,
4030
} from "../helper/ResultUtils";
41-
import logger from "../config/logger";
42-
import { addMonths, subMonths } from "date-fns";
31+
import type {
32+
ClubResults,
33+
FlightSiteRecord,
34+
FlightSitesWithRecord,
35+
QueryResult,
36+
SiteRecordsUncombined,
37+
Team,
38+
TeamWithMemberFlights,
39+
UserResultFlight,
40+
UserResults,
41+
UserResultsWithTotals,
42+
} from "../types/ResultTypes";
4343

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

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

101-
const constantsForResult = { NUMBER_OF_SCORED_FLIGHTS };
101+
const constantsForResult = {
102+
NUMBER_OF_SCORED_FLIGHTS,
103+
REMARKS: seasonDetail?.misc?.textMessages?.resultsOverall,
104+
};
102105

103106
// Search for old overall results
104107
const oldRes = await findOldResults(
@@ -183,7 +186,7 @@ const service = {
183186

184187
return addConstantInformationToResult(
185188
resultsWithTotals,
186-
{ NUMBER_OF_SCORED_FLIGHTS },
189+
{ ...constantsForResult },
187190
limit
188191
);
189192
},

server/test/testdatasets/seasonDetails.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,8 @@
13011301
"resultsSeniors": "Die Wertung beginnt ab einem Alter von 60 mit einem Bonus von 2% pro weiterem Lebensjahr",
13021302
"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",
13031303
"resultsReynoldsClass": "Schirme mit einem zulässigen Startgewicht von maximal 85kg",
1304-
"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."
1304+
"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.",
1305+
"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."
13051306
},
13061307
"rankingConstants": {
13071308
"club": {

0 commit comments

Comments
 (0)