From 76c6169be9bd415c1e7a5f167cb36eb286d860ad Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 12 Jun 2023 20:10:47 +0200 Subject: [PATCH 1/4] feature: generator pomijania W5 --- src/components/OrderS.vue | 37 ++++++++++++++++++++++++++++++++++--- src/store/store.ts | 10 +++++++++- src/styles/global.scss | 10 ++++++++++ src/types/orderTypes.ts | 10 ++++++++++ 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/src/components/OrderS.vue b/src/components/OrderS.vue index 41cdd73..8f488b9 100644 --- a/src/components/OrderS.vue +++ b/src/components/OrderS.vue @@ -207,9 +207,33 @@ - Inne: -
- + + +
Inne:
+
+ zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr + , maksymalnie do + km szlaku. Powrót odbędzie się na + + + do godziny . +
+ + @@ -293,6 +317,13 @@ export default defineComponent({ () => { const row = order.rows[3]; + if (row.w5.enabled) + return `Inne: zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr ${ + row.w5.trackNo || '_' + }, maksymalnie do ${row.w5.maxKm || '_'} km szlaku. Powrót odbędzie się na ${row.w5.returnWay || '_'} ${ + row.w5.returnWay.includes('tarczy') ? row.w5.tmName || '_' : '' + } do godziny ${row.w5.maxHour || '_'}`; + return `Inne: ${row.content}`; }, ]; diff --git a/src/store/store.ts b/src/store/store.ts index 47bc620..2da327a 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -7,7 +7,7 @@ export const useStore = defineStore('store', { return { helperModalOpen: false, - chosenOrderType: 'orderN' as TOrder, + chosenOrderType: 'orderS' as TOrder, chosenLocalOrderId: '', orderMode: 'OrderMessage', @@ -177,6 +177,13 @@ export const useStore = defineStore('store', { { enabled: false, content: '', + w5: { + enabled: false, + maxHour: '', + maxKm: '', + returnWay: 'sygnał ręczny "Do mnie"', + trackNo: '', + }, }, ], } as IOrderS, @@ -184,3 +191,4 @@ export const useStore = defineStore('store', { }, }); + diff --git a/src/styles/global.scss b/src/styles/global.scss index 218ae10..9e146d8 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -56,6 +56,7 @@ button.g-button { &.option { margin: 0 0.25em; + padding: 0.25em; &:focus-visible { outline: 1px solid $accentCol; @@ -65,6 +66,15 @@ button.g-button { color: $accentCol; } } + + &.text { + padding: 0; + color: #000; + + &:focus-visible { + color: $accentCol; + } + } } // Text styles diff --git a/src/types/orderTypes.ts b/src/types/orderTypes.ts index cd4c9aa..a381a50 100644 --- a/src/types/orderTypes.ts +++ b/src/types/orderTypes.ts @@ -107,6 +107,15 @@ export interface IOrderS { { enabled: boolean; content: string; + + w5: { + enabled: boolean; + trackNo: string; + maxKm: string; + returnWay: string; + maxHour: string; + tmName: string; + }; } ]; } @@ -163,3 +172,4 @@ export interface IOrderO { other: string; } + From c40e699b408a52e9e32b0023473379f4029582a9 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 12 Jun 2023 22:02:32 +0200 Subject: [PATCH 2/4] fix: template W5 --- src/components/OrderS.vue | 34 +++++++++++++++++++++++----------- src/store/store.ts | 3 +++ src/types/orderTypes.ts | 2 ++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/components/OrderS.vue b/src/components/OrderS.vue index 8f488b9..44fdbbf 100644 --- a/src/components/OrderS.vue +++ b/src/components/OrderS.vue @@ -214,10 +214,15 @@
Inne:
- zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr - , maksymalnie do - km szlaku. Powrót odbędzie się na - + + + + po torze szlakowym nr + do kilometra + . Powrót odbędzie się na + . + do godziny
@@ -317,12 +322,19 @@ export default defineComponent({ () => { const row = order.rows[3]; - if (row.w5.enabled) - return `Inne: zezwalam na wyjazd poza wskaźnik przetaczania W5 na tor szlakowy nr ${ - row.w5.trackNo || '_' - }, maksymalnie do ${row.w5.maxKm || '_'} km szlaku. Powrót odbędzie się na ${row.w5.returnWay || '_'} ${ - row.w5.returnWay.includes('tarczy') ? row.w5.tmName || '_' : '' - } do godziny ${row.w5.maxHour || '_'}`; + if (row.w5.enabled) { + const { borderType, trackNo, maxHour, maxKm, returnWay, tmName } = row.w5; + const textArray = []; + + textArray.push('Inne: zezwalam na wyjazd poza', borderType || '_', 'po torze szlakowym nr', trackNo || '_'); + if (maxKm) textArray.push(`do kilometra ${maxKm}`); + textArray.push('.'); + textArray.push('Powrót odbędzie się na', returnWay || '_'); + if (returnWay.includes('tarczy')) textArray.push(tmName || '_'); + textArray.push(`do godziny ${maxHour || '_'}`); + + return textArray.join(' ').replace(/ \./, '.'); + } return `Inne: ${row.content}`; }, diff --git a/src/store/store.ts b/src/store/store.ts index 2da327a..d5f37de 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -180,6 +180,8 @@ export const useStore = defineStore('store', { w5: { enabled: false, maxHour: '', + borderType: 'wskaźnik przetaczania W5', + tmName: '', maxKm: '', returnWay: 'sygnał ręczny "Do mnie"', trackNo: '', @@ -192,3 +194,4 @@ export const useStore = defineStore('store', { }); + diff --git a/src/types/orderTypes.ts b/src/types/orderTypes.ts index a381a50..ade7190 100644 --- a/src/types/orderTypes.ts +++ b/src/types/orderTypes.ts @@ -110,6 +110,7 @@ export interface IOrderS { w5: { enabled: boolean; + borderType: string; trackNo: string; maxKm: string; returnWay: string; @@ -173,3 +174,4 @@ export interface IOrderO { other: string; } + From 39236ece3e304530ad908beaf931e89d7b399c07 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 12 Jun 2023 22:03:36 +0200 Subject: [PATCH 3/4] bump: 1.3.0; hotfixy --- package.json | 2 +- src/store/store.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9197369..45095ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "genera-tor", - "version": "1.2.1", + "version": "1.3.0", "private": true, "scripts": { "dev": "vite --port 8080", diff --git a/src/store/store.ts b/src/store/store.ts index d5f37de..bafe2dd 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -7,7 +7,7 @@ export const useStore = defineStore('store', { return { helperModalOpen: false, - chosenOrderType: 'orderS' as TOrder, + chosenOrderType: 'orderN' as TOrder, chosenLocalOrderId: '', orderMode: 'OrderMessage', From 53be6c8cf249fa8bb0de64744d044b75476937fa Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 12 Jun 2023 22:09:54 +0200 Subject: [PATCH 4/4] hotfix --- src/components/OrderS.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/OrderS.vue b/src/components/OrderS.vue index 44fdbbf..5d73c91 100644 --- a/src/components/OrderS.vue +++ b/src/components/OrderS.vue @@ -223,8 +223,8 @@ do kilometra . Powrót odbędzie się na