From b68e9da71524ec20fd8e6f7a6b1b719b9a54152e Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 1 Jun 2025 17:25:14 +0200 Subject: [PATCH] chore: new cargo warning --- src/components/tabs/stock-list/StockWarnings.vue | 2 +- src/locales/en.json | 5 +++-- src/locales/pl.json | 5 +++-- src/utils/vehicleUtils.ts | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/tabs/stock-list/StockWarnings.vue b/src/components/tabs/stock-list/StockWarnings.vue index d00be8c..185a897 100644 --- a/src/components/tabs/stock-list/StockWarnings.vue +++ b/src/components/tabs/stock-list/StockWarnings.vue @@ -12,7 +12,7 @@
- {{ $t('cargo-warnings.title') }} + (!) {{ $t('cargo-warnings.title') }} {{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }}
diff --git a/src/locales/en.json b/src/locales/en.json index 93ce4b2..2306b54 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -327,11 +327,12 @@ "418Vb_ZUE": "loose cargo (sand, stone)" }, "cargo-warnings": { - "title": "Cargo warnings:", + "title": "Rolling stock containing extra cargo warnings:", "warning_wt_20_pn": "PN: exceeded gauge (Innofreight - C45)", "warning_un1965_twr": "TWR: LPG (UN 1965)", "warning_un1965_tn": "TN: LPG - empty tank (UN 1965)", "warning_un1202_twr": "TWR: diesel fuel (UN 1202)", - "warning_un1202_tn": "TN: diesel fuel - empty tank (UN 1202)" + "warning_un1202_tn": "TN: diesel fuel - empty tank (UN 1202)", + "warning_military_pn": "PN: military transport" } } \ No newline at end of file diff --git a/src/locales/pl.json b/src/locales/pl.json index 8f65fa5..fbed476 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -326,11 +326,12 @@ "418Vb_ZUE": "drobnica, ładunki sypkie (piasek, kamień)" }, "cargo-warnings": { - "title": "Uwagi przewozowe:", + "title": "Skład z dodatkowymi uwagami przewozowymi:", "warning_wt_20_pn": "PN: przekroczona skrajnia (Innofreight - C45)", "warning_un1965_twr": "TWR: gazy węglowodorowe skroplone (UN 1965)", "warning_un1965_tn": "TN: gazy węglowodorowe skroplone - puste cysterny (UN 1965)", "warning_un1202_twr": "TWR: olej napędowy (UN 1202)", - "warning_un1202_tn": "TN: olej napędowy - puste cysterny (UN 1202)" + "warning_un1202_tn": "TN: olej napędowy - puste cysterny (UN 1202)", + "warning_military_pn": "PN: transport wojskowy" } } \ No newline at end of file diff --git a/src/utils/vehicleUtils.ts b/src/utils/vehicleUtils.ts index c0defeb..a4f1905 100644 --- a/src/utils/vehicleUtils.ts +++ b/src/utils/vehicleUtils.ts @@ -108,6 +108,7 @@ export function getCargoWarnings(stockList: IStock[]) { stockList.forEach((stockVehicle) => { if (stockVehicle.vehicleRef.group == 'wagon-freight') { if (stockVehicle.cargo && stockVehicle.cargo.id.startsWith('wt_20')) warnings.add('warning_wt_20_pn'); + else if (stockVehicle.cargo && /^(tank|vehicles|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn'); else if (stockVehicle.vehicleRef.type.startsWith('WB117')) warnings.add(stockVehicle.cargo ? 'warning_un1965_twr' : 'warning_un1965_tn'); else if (stockVehicle.vehicleRef.type.startsWith('445Rb')) warnings.add(stockVehicle.cargo ? 'warning_un1202_twr' : 'warning_un1202_tn'); }