From b2930f6a9eb3af2d9ca5c1388179491f15bfb969 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 19 Apr 2025 14:51:42 +0200 Subject: [PATCH 01/12] restruct: added driver view components --- src/components/DriverView/DriverNotFound.vue | 80 ++++++++ .../DriverView/DriverTopActions.vue | 85 +++++++++ src/components/DriverView/DriverTrainCard.vue | 73 +++++++ src/locales/en.json | 1 + src/locales/pl.json | 1 + src/styles/_global.scss | 2 + src/views/DriverView.vue | 180 +----------------- 7 files changed, 249 insertions(+), 173 deletions(-) create mode 100644 src/components/DriverView/DriverNotFound.vue create mode 100644 src/components/DriverView/DriverTopActions.vue create mode 100644 src/components/DriverView/DriverTrainCard.vue diff --git a/src/components/DriverView/DriverNotFound.vue b/src/components/DriverView/DriverNotFound.vue new file mode 100644 index 0000000..9e8f646 --- /dev/null +++ b/src/components/DriverView/DriverNotFound.vue @@ -0,0 +1,80 @@ + + + + + + \ No newline at end of file diff --git a/src/components/DriverView/DriverTopActions.vue b/src/components/DriverView/DriverTopActions.vue new file mode 100644 index 0000000..8814505 --- /dev/null +++ b/src/components/DriverView/DriverTopActions.vue @@ -0,0 +1,85 @@ + + + + + + \ No newline at end of file diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue new file mode 100644 index 0000000..b2ff25a --- /dev/null +++ b/src/components/DriverView/DriverTrainCard.vue @@ -0,0 +1,73 @@ + + + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 279a4fa..8915420 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -395,6 +395,7 @@ "driver-not-found-others": "Player {driver} is online as:", "driver-not-found-return": "GO BACK TO THE MAIN SITE", "stock-copy": "COPY THE STOCK", + "number-propositions": "PROPOSE NUMBERS", "stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard!", "stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/" }, diff --git a/src/locales/pl.json b/src/locales/pl.json index de80fb0..13034c0 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -382,6 +382,7 @@ "driver-not-found-others": "Gracz {driver} jest online jako:", "driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ", "stock-copy": "SKOPIUJ SKŁAD", + "number-propositions": "ZAPROPONUJ NUMERY", "stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka!", "stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/" }, diff --git a/src/styles/_global.scss b/src/styles/_global.scss index d4dadc7..58c9a47 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -8,6 +8,7 @@ --clr-bg: #4d4d4d; --clr-bg2: #1b1b1b; --clr-bg3: #1d1d1d; + --clr-view-bg: #1a1a1a; --clr-accent: #1085b3; --clr-accent2: #ff3d5d; @@ -22,6 +23,7 @@ --clr-donator: #f7a4ff; + --no-scroll-padding: 17px; --max-container-width: 1700px; diff --git a/src/views/DriverView.vue b/src/views/DriverView.vue index 94daf32..90f68a2 100644 --- a/src/views/DriverView.vue +++ b/src/views/DriverView.vue @@ -2,103 +2,27 @@
-
- - -
- - - {{ $t('trains.driver-srjp-link') }} - - - srjp icon - - - - - {{ $t('trains.driver-journal-link') }} - - - train icon - -
-
- -
- - - - - - -
+ +
-
-

⦻ {{ $t('trains.driver-not-found-header') }}

- -

- {{ $t('trains.driver-not-found-desc-1') }}
- {{ $t('trains.driver-not-found-desc-2') }} - {{ $t('trains.driver-not-found-journal') }} ! -

- -

- - - -

- -
- -
- -
- << {{ $t('trains.driver-not-found-return') }} -
-
+
From 34f2a6986385060819d78fdf268ac0d91075b61d Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 22 Apr 2025 15:56:02 +0200 Subject: [PATCH 02/12] feat: displaying number propositions for selected category in driver view --- .prettierrc | 2 +- src/components/DriverView/DriverTrainCard.vue | 326 ++++++++++++++++-- src/data/trainNumberRules.json | 65 ++++ src/locales/en.json | 10 +- src/locales/pl.json | 11 +- 5 files changed, 371 insertions(+), 43 deletions(-) create mode 100644 src/data/trainNumberRules.json diff --git a/.prettierrc b/.prettierrc index 6b858bb..98f86c2 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,5 @@ "tabWidth": 2, "singleQuote": true, "printWidth": 100, - "trailingComma": "none" + "trailingComma": "none", } diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue index b2ff25a..8699859 100644 --- a/src/components/DriverView/DriverTrainCard.vue +++ b/src/components/DriverView/DriverTrainCard.vue @@ -1,73 +1,323 @@ \ No newline at end of file + +.propositions-container { + margin-bottom: 1em; + padding: 0.5em; + background-color: #111; +} + +.categories-select { + display: inline-flex; + flex-wrap: wrap; + gap: 0.5em; + + position: relative; + + &::after { + content: ''; + position: absolute; + bottom: calc(-0.5em); + left: 0; + + width: 100%; + height: 2px; + background-color: #aaa; + } +} + +.propositions-numbers { + margin-top: 1em; +} + +.no-propositions { + margin-top: 1em; + color: #ccc; +} + +@include responsive.smallScreen { + .propositions-container { + text-align: center; + } + + .categories-select { + justify-content: center; + } +} + diff --git a/src/data/trainNumberRules.json b/src/data/trainNumberRules.json new file mode 100644 index 0000000..5da466e --- /dev/null +++ b/src/data/trainNumberRules.json @@ -0,0 +1,65 @@ +{ + "regionNumbers": { + "Warszawa (1)": 1, + "Lublin (2)": 2, + "Kraków (3)": 3, + "Sosnowiec (4)": 4, + "Gdańsk (5)": 5, + "Wrocław (6)": 6, + "Poznań (7)": 7, + "Szczecin (8)": 8, + "Rezerwa (9)": 9 + }, + "sameRegions": { + "Losowy": [ + 10, 11, 19, 91, 93, 97, 99, 20, 22, 29, 30, 33, 39, 40, 44, 49, 94, 50, 55, 59, 90, 95, 96, + 66, 60, 69, 77, 70, 79, 88, 80, 89, 92, 98 + ], + "Warszawa (1)": [10, 11, 19, 91, 93, 97, 99], + "Lublin (2)": [20, 22, 29], + "Kraków (3)": [30, 33, 39], + "Sosnowiec (4)": [40, 44, 49, 94], + "Gdańsk (5)": [50, 55, 59, 90, 95, 96], + "Wrocław (6)": [66, 60, 69], + "Poznań (7)": [77, 70, 79], + "Szczecin (8)": [88, 80], + "Rezerwa (9)": [89, 92, 98] + }, + "categoriesRules": { + "EI": [null, "00", "99"], + "EC": [null, "000", "049"], + "EN": [null, "000", "049"], + + "RO": [null, "200", "999"], + "RP": [null, "050", "169"], + "RM": [null, "200", "999"], + "RA": [null, "200", "999"], + + "MO": [null, "200", "999"], + "MP": [null, "050", "169"], + "MM": [null, "001", "049"], + "MH": [null, "170", "199"], + + "PW": ["6", "000", "899"], + "PX": ["6", "000", "899"], + + "TM": ["4", "000", "899"], + "TN": ["3", "000", "899"], + "TK": ["3", "000", "899"], + "TD": ["2", "000", "899"], + "TG": ["1", "000", "899"], + "TR": ["1", "000", "899"], + "TC": ["0", "000", "899"], + "TS": ["5", "000", "899"], + "TH": ["5", "000", "899"], + + "LT": ["5", "000", "899"], + "LP": ["6", "000", "899"], + "LS": ["9", "000", "899"], + "LZ": ["9", "000", "899"], + + "ZN": ["9", "000", "899"], + "ZU": ["9", "000", "899"] + } + } + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 8915420..c4bcd13 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -395,9 +395,15 @@ "driver-not-found-others": "Player {driver} is online as:", "driver-not-found-return": "GO BACK TO THE MAIN SITE", "stock-copy": "COPY THE STOCK", - "number-propositions": "PROPOSE NUMBERS", + "number-propositions": "PROPOSE NUMBER", "stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard!", - "stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/" + "stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/", + + "number-propositions-header": "Generate number examples for selected category:", + "number-propositions-third-number": "Third digit:", + "number-propositions-last-nums": "{count} last digits from the range of:", + "number-propositions-title": "Propositions:", + "number-propositions-empty": "No propositions available for the chosen category! :/" }, "train-stats": { "stats-button": "STATISTICS", diff --git a/src/locales/pl.json b/src/locales/pl.json index 13034c0..3cc127a 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -382,9 +382,16 @@ "driver-not-found-others": "Gracz {driver} jest online jako:", "driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ", "stock-copy": "SKOPIUJ SKŁAD", - "number-propositions": "ZAPROPONUJ NUMERY", + "number-propositions": "ZAPROPONUJ NUMER", "stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka!", - "stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/" + "stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/", + + "number-propositions-header": "Wygeneruj propozycje numerów dla kategorii pociągu:", + "number-propositions-third-number": "Trzecia cyfra:", + "number-propositions-last-nums": "{count} ostatnie cyfry z przedziału:", + "number-propositions-title": "Propozycje:", + "number-propositions-empty": "Brak propozycji dla wybranej kategorii! :/" + }, "train-stats": { "stats-button": "STATYSTYKI", From adf4d88cb2918e11823762d7225b9ce9794cbe28 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 22 Apr 2025 15:56:22 +0200 Subject: [PATCH 03/12] bump: v1.30.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c42e93..6380c3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.29.2", + "version": "1.30.0", "private": true, "type": "module", "scripts": { From f952a7c491440acac299d26f853530c1ec794241 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 25 Apr 2025 14:56:39 +0200 Subject: [PATCH 04/12] chore: translation fixes; formatting --- .prettierrc | 2 +- src/components/DriverView/DriverTrainCard.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.prettierrc b/.prettierrc index 98f86c2..6b858bb 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,5 @@ "tabWidth": 2, "singleQuote": true, "printWidth": 100, - "trailingComma": "none", + "trailingComma": "none" } diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue index 8699859..fad18cb 100644 --- a/src/components/DriverView/DriverTrainCard.vue +++ b/src/components/DriverView/DriverTrainCard.vue @@ -54,7 +54,7 @@
- Propozycje: {{ numberPropositions.join(', ') }} + {{ i18n.t('trains.number-propositions-title') }} {{ numberPropositions.join(', ') }}
From 5a09543a22ae2b58ca113537ce216095be15932d Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 25 Apr 2025 15:15:45 +0200 Subject: [PATCH 05/12] chore: updated stock speed limit calculation --- src/components/TrainsView/TrainInfo.vue | 20 ++++++++++++++------ src/data/speedLimits.ts | 10 ++++++++++ src/typings/common.ts | 2 ++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index e503229..e6b87fc 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -219,15 +219,23 @@ export default defineComponent({ stockSpeedLimit() { let isPassenger = true; - const vehicleMaxSpeed = this.train.stockList.reduce((acc, stockName) => { - const vehicleData = this.apiStore.vehiclesData?.find( - (v) => v.name == stockName.split(':')[0] - ); + const vehicleMaxSpeed = this.train.stockList.reduce((acc, stockName, i) => { + const [vehicleName, vehicleCargo] = stockName.split(':'); + + const vehicleData = this.apiStore.vehiclesData?.find((v) => v.name == vehicleName); if (!vehicleData) return acc; - if (vehicleData.type == 'wagon-freight') isPassenger = false; - const vehicleSpeed = vehicleData.group.speed; + let vehicleSpeed = vehicleData.group.speed; + + if (vehicleData.type == 'wagon-freight') { + isPassenger = false; + + if (vehicleCargo !== undefined && vehicleData.group.speedLoaded) { + vehicleSpeed = vehicleData.group.speedLoaded; + console.log('detected loaded', vehicleSpeed); + } + } return Math.min(vehicleSpeed, acc); }, Infinity); diff --git a/src/data/speedLimits.ts b/src/data/speedLimits.ts index 2546c4b..961499f 100644 --- a/src/data/speedLimits.ts +++ b/src/data/speedLimits.ts @@ -4,6 +4,9 @@ export const speedLimits: Record = { '650000': 125 }, cargo: { + '750000': 100, + '1000000': 90, + '1500000': 80, '2000000': 70 }, none: 110 @@ -13,6 +16,9 @@ export const speedLimits: Record = { '650000': 125 }, cargo: { + '750000': 100, + '1000000': 90, + '1500000': 80, '2000000': 70 }, none: 110 @@ -22,6 +28,9 @@ export const speedLimits: Record = { '650000': 125 }, cargo: { + '750000': 100, + '1000000': 90, + '1500000': 80, '2000000': 70 }, none: 110 @@ -65,6 +74,7 @@ export const speedLimits: Record = { }, cargo: { '1200000': 100, + '2000000': 80, '3100000': 70 }, none: 125 diff --git a/src/typings/common.ts b/src/typings/common.ts index 5af60af..a3784c2 100644 --- a/src/typings/common.ts +++ b/src/typings/common.ts @@ -229,6 +229,8 @@ export interface VehiclesGroup { id: number; name: string; speed: number; + speedLoaded?: number; + speedLoco?: number; length: number; weight: number; cargoTypes: VehicleCargo[] | null; From a602358241de6bd815807e14bb8bf3cc616fab98 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 25 Apr 2025 15:18:11 +0200 Subject: [PATCH 06/12] chore: obsolete logs --- src/components/TrainsView/TrainInfo.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index e6b87fc..6decd91 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -233,7 +233,6 @@ export default defineComponent({ if (vehicleCargo !== undefined && vehicleData.group.speedLoaded) { vehicleSpeed = vehicleData.group.speedLoaded; - console.log('detected loaded', vehicleSpeed); } } From fd28eb4609d3308f9cf843484ece223d0b9fcf3e Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 13:45:27 +0200 Subject: [PATCH 07/12] fix: other driver's trains broken listing --- src/components/DriverView/DriverNotFound.vue | 103 ++++++++++--------- src/views/DriverView.vue | 2 +- 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/src/components/DriverView/DriverNotFound.vue b/src/components/DriverView/DriverNotFound.vue index 9e8f646..57ffe8a 100644 --- a/src/components/DriverView/DriverNotFound.vue +++ b/src/components/DriverView/DriverNotFound.vue @@ -1,34 +1,36 @@ - \ No newline at end of file + diff --git a/src/views/DriverView.vue b/src/views/DriverView.vue index 90f68a2..5739d8f 100644 --- a/src/views/DriverView.vue +++ b/src/views/DriverView.vue @@ -8,7 +8,7 @@ - + From b278c20480533193d9eeeef478483f969c61f23f Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 14:23:14 +0200 Subject: [PATCH 08/12] feat: filtering journal timetables by train category --- src/components/JournalView/JournalOptions.vue | 74 +++++++++++++------ src/components/JournalView/typings.ts | 3 +- src/data/trainNumberRules.json | 30 ++++++++ src/locales/pl.json | 1 + src/styles/_dropdown.scss | 6 +- src/styles/_journal-section.scss | 2 +- src/views/JournalTimetables.vue | 7 +- 7 files changed, 94 insertions(+), 29 deletions(-) diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 87df1cd..3a77abb 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -33,31 +33,56 @@

{{ $t('options.search-title') }}

@@ -117,10 +142,12 @@ import { useMainStore } from '../../store/mainStore'; import { Journal } from './typings'; import { Status } from '../../typings/common'; import { useApiStore } from '../../store/apiStore'; +import { allCategories } from '../../data/trainNumberRules.json'; +import trainCategoryMixin from '../../mixins/trainCategoryMixin'; export default defineComponent({ emits: ['onSearchConfirm', 'onOptionsReset', 'onRefreshData'], - mixins: [keyMixin], + mixins: [keyMixin, trainCategoryMixin], props: { sorterOptionIds: { @@ -152,6 +179,7 @@ export default defineComponent({ data() { return { showOptions: false, + allCategories, driverSuggestions: [] as string[], dispatcherSuggestions: [] as string[], diff --git a/src/components/JournalView/typings.ts b/src/components/JournalView/typings.ts index 2534d40..9802ac0 100644 --- a/src/components/JournalView/typings.ts +++ b/src/components/JournalView/typings.ts @@ -12,7 +12,8 @@ export namespace Journal { | 'search-dispatcher' | 'search-issuedFrom' | 'search-terminatingAt' - | 'search-via'; + | 'search-via' + | 'select-categoryCode'; export type TimetableSearchType = { [key in TimetableSearchKey]: string; diff --git a/src/data/trainNumberRules.json b/src/data/trainNumberRules.json index 5da466e..3c692dc 100644 --- a/src/data/trainNumberRules.json +++ b/src/data/trainNumberRules.json @@ -1,4 +1,34 @@ { + "allCategories": [ + "ROE", "ROJ", "ROS", "ROM", + "RPE", "RPJ", "RPS", "RPM", + "RME", "RMJ", "RMS", "RMM", + "RAE", "RAJ", "RAS", "RAM", + "MPE", "MPJ", "MPS", "MPM", + "MME", "MMJ", "MMS", "MMM", + "MOE", "MOJ", "MOS", "MOM", + "MHE", "MHJ", "MHS", + "EIE", "EIS", + "ENE", "ENS", + "ECE", "ECS", + "PWE", "PWM", "PWJ", "PWS", + "PXE", "PXM", "PXJ", "PXS", + "TCE", "TCS", + "TDE", "TDS", + "TGE", "TGS", + "TKE", "TKS", + "TME", "TMS", + "TNE", "TNS", + "TRE", "TRS", + "TSE", "TSS", + "THE", "THS", + "LPE", + "LTE", "LTS", + "LSS", + "LZE", "LZS", + "ZNE", "ZNS", + "ZUE", "ZUS" + ], "regionNumbers": { "Warszawa (1)": 1, "Lublin (2)": 2, diff --git a/src/locales/pl.json b/src/locales/pl.json index 3cc127a..76b5a44 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -167,6 +167,7 @@ "search-dispatchers-date": "Data służby (od / do)", "search-date-from": "Data (UTC+2 / CEST)", "search-date-to": "Data (UTC+2 / CEST)", + "select-categoryCode": "Kategoria pociągu", "sort-routeDistance": "kilometraż", "sort-allStopsCount": "stacje", "sort-beginDate": "data", diff --git a/src/styles/_dropdown.scss b/src/styles/_dropdown.scss index 0c9f40e..9e75477 100644 --- a/src/styles/_dropdown.scss +++ b/src/styles/_dropdown.scss @@ -29,17 +29,19 @@ top: calc(100% + 0.5em); background-color: var(--clr-bg3); - // box-shadow: 0 5px 10px 2px #0f0f0f; box-shadow: 0 0 5px 1px var(--clr-primary); width: 100%; max-width: 550px; + max-height: 750px; + overflow: auto; + padding: 1em; z-index: 100; } -@include responsive.smallScreen{ +@include responsive.smallScreen { .dropdown_wrapper { font-size: 1.1em; max-width: 100%; diff --git a/src/styles/_journal-section.scss b/src/styles/_journal-section.scss index cfd998e..cffb516 100644 --- a/src/styles/_journal-section.scss +++ b/src/styles/_journal-section.scss @@ -12,7 +12,7 @@ .list_wrapper { overflow-y: auto; height: calc(100vh - 12.5em); - min-height: 650px; + min-height: 700px; margin-top: 0.5em; position: relative; diff --git a/src/views/JournalTimetables.vue b/src/views/JournalTimetables.vue index 0f3e0da..f3a82fc 100644 --- a/src/views/JournalTimetables.vue +++ b/src/views/JournalTimetables.vue @@ -122,6 +122,7 @@ interface TimetablesQueryParams { driverName?: string; trainNo?: string; timetableId?: string; + categoryCode?: string; authorName?: string; @@ -215,6 +216,7 @@ export default defineComponent({ 'search-issuedFrom': '', 'search-via': '', 'search-terminatingAt': '', + 'select-categoryCode': '', 'search-date-from': '' } as Journal.TimetableSearchType); @@ -230,6 +232,7 @@ export default defineComponent({ return { sorterActive, searchersValues, + filterList, initFilters, @@ -356,6 +359,7 @@ export default defineComponent({ const issuedFrom = this.searchersValues['search-issuedFrom'].trim() || undefined; const via = this.searchersValues['search-via'].trim() || undefined; const terminatingAt = this.searchersValues['search-terminatingAt'].trim() || undefined; + const categoryCode = this.searchersValues['select-categoryCode'].trim() || undefined; let dateTo: string | undefined = undefined; @@ -365,8 +369,6 @@ export default defineComponent({ dateTo = d.toISOString().split('T')[0]; } - // const timestampFrom = dateString ? Date.parse(new Date(dateString).toISOString()) : undefined; - // const timestampTo = timestampFrom ? timestampFrom + 86400000 : undefined; const queryParams: TimetablesQueryParams = {}; @@ -433,6 +435,7 @@ export default defineComponent({ queryParams['issuedFrom'] = issuedFrom; queryParams['terminatingAt'] = terminatingAt; queryParams['via'] = via; + queryParams['categoryCode'] = categoryCode; queryParams['issuedFrom'] = issuedFrom; queryParams['sortBy'] = From 1e75ff517f7c066d29d14a068c106a74e6c25468 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 14:24:25 +0200 Subject: [PATCH 09/12] hotfix: missing translations --- src/locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/locales/en.json b/src/locales/en.json index c4bcd13..4f6cdba 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -170,6 +170,7 @@ "search-dispatchers-date": "Service date (from / to)", "search-date-from": "Date (UTC+2 / CEST)", "search-date-to": "Date (UTC+2 / CEST)", + "select-categoryCode": "Train category", "sort-mass": "mass", "sort-speed": "speed", "sort-length": "length", From 0fdcd8275416a3b4713d79ebc48841ef42de108b Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 14:33:07 +0200 Subject: [PATCH 10/12] hotfix: available categories conditions --- src/components/DriverView/DriverTrainCard.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue index fad18cb..b8e0000 100644 --- a/src/components/DriverView/DriverTrainCard.vue +++ b/src/components/DriverView/DriverTrainCard.vue @@ -54,7 +54,8 @@
- {{ i18n.t('trains.number-propositions-title') }} {{ numberPropositions.join(', ') }} + {{ i18n.t('trains.number-propositions-title') }} + {{ numberPropositions.join(', ') }}
@@ -246,9 +247,13 @@ const availableCategories = computed(() => { else { if (wagonsNamesArr.every((v) => /^(627Z|412Z)/.test(v))) availableCategories.push('TC', 'TD', 'TS'); - else if (wagonsNamesArr.length < 3 || cargoNamesSet.size < 3) + else if (stockList.slice(1).every((v) => /PKPE/.test(v))) { + availableCategories.push('ZU', 'ZN'); + } else if (wagonsNamesArr.length < 3 || cargoNamesSet.size < 3) { availableCategories.push('TM', 'TG', 'TS'); - else availableCategories.push('TN', 'TK', 'TR', 'TS', 'ZU', 'ZN'); + } else { + availableCategories.push('TN', 'TK', 'TR', 'TS'); + } } return availableCategories.map((c) => `${c}${categoryTraction}`); From 128f3c32b43ffc52dccc60a64341fd025a51fd36 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 14:34:26 +0200 Subject: [PATCH 11/12] fix: minor mistakes --- src/components/DriverView/DriverTrainCard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue index b8e0000..f8cf47c 100644 --- a/src/components/DriverView/DriverTrainCard.vue +++ b/src/components/DriverView/DriverTrainCard.vue @@ -54,7 +54,7 @@
- {{ i18n.t('trains.number-propositions-title') }} + {{ i18n.t('trains.number-propositions-title') }}  {{ numberPropositions.join(', ') }}
From c30c2206ceebf604ed6fc07935dc8d72f2f7ea07 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 26 Apr 2025 15:06:08 +0200 Subject: [PATCH 12/12] chore: available proposition categories update --- src/components/DriverView/DriverTrainCard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue index f8cf47c..4bc75e0 100644 --- a/src/components/DriverView/DriverTrainCard.vue +++ b/src/components/DriverView/DriverTrainCard.vue @@ -250,9 +250,9 @@ const availableCategories = computed(() => { else if (stockList.slice(1).every((v) => /PKPE/.test(v))) { availableCategories.push('ZU', 'ZN'); } else if (wagonsNamesArr.length < 3 || cargoNamesSet.size < 3) { - availableCategories.push('TM', 'TG', 'TS'); + availableCategories.push('TM', 'TG', 'TS', 'TK'); } else { - availableCategories.push('TN', 'TK', 'TR', 'TS'); + availableCategories.push('TN', 'TR', 'TS', 'TK'); } }