From 1a377ddfd827c6944ea0570f0540c1119a0427be Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 9 Mar 2026 23:53:57 +0100 Subject: [PATCH] chore(app): added info bar about migration to a new domain --- src/App.vue | 22 ++++++++++++++++++++++ src/components/App/MigrateInfo.vue | 30 ++++++++++++++++++++++++++++++ src/locales/en.json | 7 ++++++- src/locales/pl.json | 5 +++++ src/stores/global.store.ts | 3 ++- 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 src/components/App/MigrateInfo.vue diff --git a/src/App.vue b/src/App.vue index a77bdfc..645241f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,9 +5,15 @@ + + + + + + @@ -22,6 +28,7 @@ import { useGlobalStore } from './stores/global.store'; import { useI18n } from 'vue-i18n'; import { useRegisterSW } from 'virtual:pwa-register/vue'; import { DataStatus } from './types/api.types'; +import MigrateInfo from './components/App/MigrateInfo.vue'; const originalDocumentTitle = document.title; @@ -34,6 +41,7 @@ const { needRefresh, updateServiceWorker } = useRegisterSW({ immediate: true }); onMounted(async () => { setupLocale(); setupDarkMode(); + handleMigrationInfo(); setupOfflineMode(); loadStorageTimetables(); setupAfterPrintClose(); @@ -112,4 +120,18 @@ function handleQueries() { } } } + +function handleMigrationInfo() { + // Show only on old domain + if (location.hostname !== 'srjp-td2.web.app' && location.hostname != 'localhost') return; + + const showInfo = localStorage.getItem('showMigrationInfo'); + + // Do not show if already acknowledged + if (showInfo === 'false') return; + + setTimeout(() => { + globalStore.isMigrationInfoOpen = true; + }, 2000); +} diff --git a/src/components/App/MigrateInfo.vue b/src/components/App/MigrateInfo.vue new file mode 100644 index 0000000..6c6037e --- /dev/null +++ b/src/components/App/MigrateInfo.vue @@ -0,0 +1,30 @@ + + + diff --git a/src/locales/en.json b/src/locales/en.json index 8d4dda0..e123a57 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -11,7 +11,7 @@ }, "data-offline-mode": "You're currently using the offline mode of the SRJP app - server data is unavailable!", - + "headers": { "line_no": "Line\nno.", "line_km": "Km", @@ -26,6 +26,11 @@ "relation": "Route" }, + "migrate-info": { + "line-1": "Rozkładownik is being moved to a new domain - {0}! You can still use the current website, but it will no longer be updated and will be shut down in the nearest future!", + "accept-btn": "ROGER THAT!" + }, + "storage-empty-header": "ARCHIVED TIMETABLES SEARCH MODE", "storage-empty-info": "Timetables will be shown here after their archiving.", "storage-preview-title": "ARCHIVED TIMETABLES", diff --git a/src/locales/pl.json b/src/locales/pl.json index 2a59299..d575409 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -26,6 +26,11 @@ "relation": "Relacja" }, + "migrate-info": { + "line-1": "Rozkładownik zostaje przeniesiony na nową domenę - {0}! Możesz korzystać z obecnej strony, jednak nie będzie ona otrzymywać już aktualizacji i w przyszłości zostanie wyłączona!", + "accept-btn": "PRZYJĄŁEM!" + }, + "storage-empty-header": "TRYB WYSZUKIWANA ZAPISANYCH ROZKŁADÓW JAZDY", "storage-empty-info": "Użyj funkcji zapisu rozkładu jazdy, aby go tutaj wyświetlić.", "storage-preview-title": "ZAPISANE ROZKŁADY JAZDY", diff --git a/src/stores/global.store.ts b/src/stores/global.store.ts index 67a4134..74b9b67 100644 --- a/src/stores/global.store.ts +++ b/src/stores/global.store.ts @@ -35,7 +35,8 @@ export const useGlobalStore = defineStore('global', { route: '' }, - showSettings: false + showSettings: false, + isMigrationInfoOpen: false }), getters: { activeTimetableTrains() {