From b9391a99210f15886486ac48256756b453f01ec5 Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 20 Oct 2026 16:54:35 +0200 Subject: [PATCH] fix(tours): hold an actual track change back while the tour is offline or queued Linking or unlinking a recorded track went out even in offline mode and behind a queued write of the same tour, and its answer replaced the whole cached tour with the server's older state, losing the local change. Both now refuse as online only in those cases and for a tour the server has not got, the view says so, and the answer only updates the cached tour's recordings. --- .../Tours/activity/useTourActivities.test.ts | 18 ++++++++- .../Tours/activity/useTourActivities.ts | 6 +++ client/src/repo/tourRepo.test.ts | 37 ++++++++++++++++++ client/src/repo/tourRepo.ts | 38 ++++++++++++++++--- shared/src/i18n/ar/tours.ts | 1 + shared/src/i18n/az/tours.ts | 2 + shared/src/i18n/br/tours.ts | 2 + shared/src/i18n/ca/tours.ts | 1 + shared/src/i18n/cs/tours.ts | 1 + shared/src/i18n/de/tours.ts | 2 + shared/src/i18n/en/tours.ts | 1 + shared/src/i18n/es/tours.ts | 2 + shared/src/i18n/et/tours.ts | 1 + shared/src/i18n/fr/tours.ts | 2 + shared/src/i18n/gr/tours.ts | 2 + shared/src/i18n/hu/tours.ts | 2 + shared/src/i18n/id/tours.ts | 2 + shared/src/i18n/it/tours.ts | 2 + shared/src/i18n/ja/tours.ts | 1 + shared/src/i18n/ko/tours.ts | 1 + shared/src/i18n/nl/tours.ts | 2 + shared/src/i18n/pl/tours.ts | 2 + shared/src/i18n/ru/tours.ts | 2 + shared/src/i18n/sk/tours.ts | 1 + shared/src/i18n/sv/tours.ts | 2 + shared/src/i18n/th/tours.ts | 1 + shared/src/i18n/tours-locales.spec.ts | 2 +- shared/src/i18n/tr/tours.ts | 2 + shared/src/i18n/uk/tours.ts | 2 + shared/src/i18n/vi/tours.ts | 2 + shared/src/i18n/zh-TW/tours.ts | 1 + shared/src/i18n/zh/tours.ts | 1 + 32 files changed, 137 insertions(+), 7 deletions(-) diff --git a/client/src/components/Tours/activity/useTourActivities.test.ts b/client/src/components/Tours/activity/useTourActivities.test.ts index fa83ae5c2..0f1ba2f2e 100644 --- a/client/src/components/Tours/activity/useTourActivities.test.ts +++ b/client/src/components/Tours/activity/useTourActivities.test.ts @@ -1,10 +1,11 @@ -// FE-ACT-HOOK-001 to FE-ACT-HOOK-006 +// FE-ACT-HOOK-001 to FE-ACT-HOOK-007 // ACT-01: the actual tracks read with the tour's detail, linked from the // dialog and unlinked after confirming, each write telling the lists and the // user, and a refusal named in the user's words without changing anything. import { act, renderHook, waitFor } from '@testing-library/react'; import type { TourActivity, TourListItem } from '@trek/shared'; import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { OnlineOnlyError } from '../../../repo/onlineOnly'; import type { TourExecution } from './tourActivityModel'; import { useTourActivities } from './useTourActivities'; @@ -113,6 +114,21 @@ describe('useTourActivities', () => { expect(result.current.assigning).toBeNull(); }); + it('FE-ACT-HOOK-007: offline or behind a waiting write of the tour, it says so rather than that the change failed', async () => { + repo.assignActivity.mockRejectedValue(new OnlineOnlyError()); + repo.unassignActivity.mockRejectedValue(new OnlineOnlyError()); + const { result } = render(); + await waitFor(() => expect(result.current.activities).not.toBeNull()); + act(() => result.current.openAssign()); + await act(async () => result.current.assign(30, null)); + expect(toast.error).toHaveBeenLastCalledWith('tours.activity.offline'); + expect(result.current.assigning).toEqual({}); + act(() => result.current.askRemove(activity(1, null))); + await act(async () => result.current.remove()); + expect(toast.error).toHaveBeenLastCalledWith('tours.activity.offline'); + expect(toast.error).not.toHaveBeenCalledWith('tours.activity.failed'); + }); + it('FE-ACT-HOOK-005: unlinks only after the question, and nothing for someone who may not change the tour', async () => { const onToursChanged = vi.fn(); repo.unassignActivity.mockResolvedValue({ tour, waypoints: [], activities: [] }); diff --git a/client/src/components/Tours/activity/useTourActivities.ts b/client/src/components/Tours/activity/useTourActivities.ts index 2d0bacdcb..07cbf088a 100644 --- a/client/src/components/Tours/activity/useTourActivities.ts +++ b/client/src/components/Tours/activity/useTourActivities.ts @@ -1,6 +1,7 @@ import type { TourActivity, TourDetailResponse, TourListItem } from '@trek/shared'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from '../../../i18n'; +import { OnlineOnlyError } from '../../../repo/onlineOnly'; import { tourRepo } from '../../../repo/tourRepo'; import { useToast } from '../../shared/Toast'; import { inDayOrder, refusalOf, type TourExecution } from './tourActivityModel'; @@ -83,6 +84,11 @@ export function useTourActivities({ tripId, tour, executions, canEdit, onToursCh toast.success(t(success)); return true; } catch (error: unknown) { + // Offline, or behind a write of the tour still waiting: said as such, not as a failure. + if (error instanceof OnlineOnlyError) { + toast.error(t('tours.activity.offline')); + return false; + } const refusal = refusalOf(error); toast.error(t(refusal ? `tours.activity.refused.${refusal}` : 'tours.activity.failed')); return false; diff --git a/client/src/repo/tourRepo.test.ts b/client/src/repo/tourRepo.test.ts index 587724923..1147c576b 100644 --- a/client/src/repo/tourRepo.test.ts +++ b/client/src/repo/tourRepo.test.ts @@ -7,6 +7,7 @@ import { http, HttpResponse } from 'msw' import type { TourCreateRequest, TourListItem } from '@trek/shared' import { server } from '../../tests/helpers/msw/server' import { tourRepo } from './tourRepo' +import { OnlineOnlyError } from './onlineOnly' import { offlineDb, clearAll, replaceTripTours } from '../db/offlineDb' import { buildPlace } from '../../tests/helpers/factories' import { plannedTotalText, tourPlannedTimes } from '../components/Tours/tourPresentation' @@ -450,6 +451,42 @@ describe('tourRepo provenance and copies (P2C-02, P2C-07)', () => { expect((await offlineDb.tours.get(40))?.activities).toEqual([]) }) + it('FE-REPO-TOUR-046: an actual track is not changed offline, behind a queued write or on a tour the server has not got, and its answer touches only the recordings (ACT-01)', async () => { + let sent = 0 + server.use( + http.put('/api/trips/3/tours/40/activities', () => { + sent++ + return HttpResponse.json({ tour: tour({ name: 'Old name', activity_tracks: [{ id: 5, track_place_id: 41, assignment_id: null }] }), waypoints: [], activities: [] }) + }), + http.delete('/api/trips/3/tours/40/activities/5', () => { sent++; return HttpResponse.json({ tour: tour(), waypoints: [], activities: [] }) }), + ) + const link = { track_place_id: 41, assignment_id: null } + + setOnline(false) + await expect(tourRepo.assignActivity(3, 40, link)).rejects.toBeInstanceOf(OnlineOnlyError) + await expect(tourRepo.unassignActivity(3, 40, 5)).rejects.toBeInstanceOf(OnlineOnlyError) + setOnline(true) + + await expect(tourRepo.assignActivity(3, -7, link)).rejects.toBeInstanceOf(OnlineOnlyError) + + await offlineDb.tours.put({ ...tour({ name: 'Edited here' }), trip_id: 3 }) + await offlineDb.mutationQueue.put({ + id: 'queued-tour', tripId: 3, method: 'PUT', url: '/trips/3/tours/40', body, createdAt: 1, + status: 'pending', attempts: 0, lastError: null, resource: 'tours', entityId: 40, + }) + await expect(tourRepo.assignActivity(3, 40, link)).rejects.toBeInstanceOf(OnlineOnlyError) + expect(sent).toBe(0) + await offlineDb.mutationQueue.clear() + + // Once nothing waits, the change goes out and the cached tour takes its recordings in, its own edits kept. + await tourRepo.assignActivity(3, 40, link) + expect(sent).toBe(1) + const cached = await offlineDb.tours.get(40) + expect(cached?.name).toBe('Edited here') + expect(cached?.activities).toEqual([]) + expect(cached?.activity_tracks).toEqual([{ id: 5, track_place_id: 41, assignment_id: null }]) + }) + it('FE-REPO-TOUR-021: a copy is asked of the server under its name and cached as a tour of the trip', async () => { let sent: unknown = null server.use(http.post('/api/trips/3/tours/40/copy', async ({ request }) => { diff --git a/client/src/repo/tourRepo.ts b/client/src/repo/tourRepo.ts index b70dd680a..090c60882 100644 --- a/client/src/repo/tourRepo.ts +++ b/client/src/repo/tourRepo.ts @@ -14,8 +14,31 @@ import { mutationQueue, generateUUID, nextTempId } from '../sync/mutationQueue' import { isEffectivelyOffline } from '../sync/networkMode' import { applyObstacleOps } from './obstacleCheckLocal' import { onlineThenCache } from './withOfflineFallback' +import { OnlineOnlyError } from './onlineOnly' import type { Place } from '../types' +/** + * ACT-01: an assignment change goes out only for a tour the server has, while + * no older write of it waits in the queue; `mustQueue` is true offline too. + */ +async function requireActivityWrite(placeId: number): Promise { + if (placeId < 0 || (await mutationQueue.mustQueue('tours', placeId))) throw new OnlineOnlyError() +} + +/** + * ACT-01: the answer to an assignment change taken into the cached tour: its + * recordings and the list's word on them, nothing else of the row, so a plan + * the server has not seen yet is never overwritten. A tour not cached yet + * takes the whole answer. + */ +async function cacheActivities(tripId: number | string, placeId: number, result: TourDetailResponse): Promise { + const changed = await offlineDb.tours.update(placeId, { + activities: result.activities ?? [], + activity_tracks: result.tour.activity_tracks ?? [], + }) + if (changed === 0) await cacheTourAnswer(Number(tripId), result) +} + /** The list item a cached row stands for: the cache-only fields stripped. */ function toListItem({ trip_id: _tripId, waypoints: _waypoints, provenance: _provenance, obstacle_check: _check, activities: _activities, packing_link: _packingLink, ...tour }: CachedTour): TourListItem { return tour @@ -326,19 +349,24 @@ export const tourRepo = { /** * ACT-01, online only like the GPX import a recording comes through: the * assignment points at a recording the server keeps, so it needs the server - * to answer. Nothing of the plan changes, so nothing waits in the queue; the - * answer keeps the cached detail fresh. + * to answer. It goes out only while nothing older of the tour waits in the + * queue (an offline edit, a ski classification): the answer is the server's + * tour before that write, and is never laid over it. A tour not yet on the + * server (a temporary id) has nothing to assign to. Nothing of the plan + * changes, so only the recordings of the cached tour take the answer in. */ async assignActivity(tripId: number | string, placeId: number, body: TourActivityAssignRequest): Promise { + await requireActivityWrite(placeId) const result = await tourActivitiesApi.assign(tripId, placeId, body) - await cacheTourAnswer(Number(tripId), result) + await cacheActivities(tripId, placeId, result) return result }, - /** ACT-01: a recorded track taken off the tour again; online only, like the assignment. */ + /** ACT-01: a recorded track taken off the tour again; online only and held back like the assignment. */ async unassignActivity(tripId: number | string, placeId: number, activityId: number): Promise { + await requireActivityWrite(placeId) const result = await tourActivitiesApi.unassign(tripId, placeId, activityId) - await cacheTourAnswer(Number(tripId), result) + await cacheActivities(tripId, placeId, result) return result }, diff --git a/shared/src/i18n/ar/tours.ts b/shared/src/i18n/ar/tours.ts index 725f23f40..662d0157a 100644 --- a/shared/src/i18n/ar/tours.ts +++ b/shared/src/i18n/ar/tours.ts @@ -1250,6 +1250,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'تم ربط المسار الفعلي', 'tours.activity.removed': 'تم فك ربط المسار الفعلي', 'tours.activity.failed': 'تعذّر تغيير المسار الفعلي', + 'tours.activity.offline': 'تغيير المسار الفعلي يحتاج إلى اتصال، وتُرسَل التغييرات المنتظرة لهذه الجولة أولًا', 'tours.activity.dialogEyebrow': 'إضافة المسار الفعلي', 'tours.activity.dialogHint': 'تبقى الخطة كما هي. يُربط المسار فقط.', 'tours.activity.execution': 'نُفّذت في', diff --git a/shared/src/i18n/az/tours.ts b/shared/src/i18n/az/tours.ts index 55887bcb9..6e46117c7 100644 --- a/shared/src/i18n/az/tours.ts +++ b/shared/src/i18n/az/tours.ts @@ -1206,6 +1206,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Faktiki iz bağlandı', 'tours.activity.removed': 'Faktiki izin əlaqəsi silindi', 'tours.activity.failed': 'Faktiki izi dəyişmək mümkün olmadı', + 'tours.activity.offline': + 'Faktiki izi dəyişmək üçün bağlantı lazımdır və bu turun gözləyən dəyişiklikləri əvvəlcə göndərilir', 'tours.activity.dialogEyebrow': 'Faktiki iz əlavə et', 'tours.activity.dialogHint': 'Plan olduğu kimi qalır. İz sadəcə bağlanır.', 'tours.activity.execution': 'Keçirildiyi gün', diff --git a/shared/src/i18n/br/tours.ts b/shared/src/i18n/br/tours.ts index 1e4bc1ff6..b05d379fc 100644 --- a/shared/src/i18n/br/tours.ts +++ b/shared/src/i18n/br/tours.ts @@ -1218,6 +1218,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Trilha real vinculada', 'tours.activity.removed': 'Trilha real desvinculada', 'tours.activity.failed': 'Não foi possível alterar a trilha real', + 'tours.activity.offline': + 'Alterar a trilha real precisa de conexão, e as alterações pendentes deste passeio vão primeiro', 'tours.activity.dialogEyebrow': 'Adicionar trilha real', 'tours.activity.dialogHint': 'O plano continua como está. A trilha é apenas vinculada.', 'tours.activity.execution': 'Feito em', diff --git a/shared/src/i18n/ca/tours.ts b/shared/src/i18n/ca/tours.ts index 0668a5394..2507d808a 100644 --- a/shared/src/i18n/ca/tours.ts +++ b/shared/src/i18n/ca/tours.ts @@ -1224,6 +1224,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Traç real vinculat', 'tours.activity.removed': 'Traç real desvinculat', 'tours.activity.failed': 'No s’ha pogut canviar el traç real', + 'tours.activity.offline': 'Canviar el traç real necessita connexió, i els canvis pendents d’aquesta ruta van primer', 'tours.activity.dialogEyebrow': 'Afegeix el traç real', 'tours.activity.dialogHint': 'El pla es queda com està. El traç només es vincula.', 'tours.activity.execution': 'Feta el', diff --git a/shared/src/i18n/cs/tours.ts b/shared/src/i18n/cs/tours.ts index d2062316d..b16afd84f 100644 --- a/shared/src/i18n/cs/tours.ts +++ b/shared/src/i18n/cs/tours.ts @@ -1207,6 +1207,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Skutečná trasa propojena', 'tours.activity.removed': 'Skutečná trasa odpojena', 'tours.activity.failed': 'Skutečnou trasu se nepodařilo změnit', + 'tours.activity.offline': 'Změna skutečné trasy potřebuje připojení a čekající změny této túry jdou první', 'tours.activity.dialogEyebrow': 'Přidat skutečnou trasu', 'tours.activity.dialogHint': 'Plán zůstává, jak je. Trasa se jen propojí.', 'tours.activity.execution': 'Uskutečněno', diff --git a/shared/src/i18n/de/tours.ts b/shared/src/i18n/de/tours.ts index 72d88367b..c904e6f70 100644 --- a/shared/src/i18n/de/tours.ts +++ b/shared/src/i18n/de/tours.ts @@ -1231,6 +1231,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Ist-Track verknüpft', 'tours.activity.removed': 'Ist-Track gelöst', 'tours.activity.failed': 'Der Ist-Track konnte nicht geändert werden', + 'tours.activity.offline': + 'Den Ist-Track zu ändern braucht eine Verbindung, und die wartenden Änderungen dieser Tour gehen vor', 'tours.activity.dialogEyebrow': 'Ist-Track hinzufügen', 'tours.activity.dialogHint': 'Die Planung bleibt, wie sie ist. Der Track wird nur verknüpft.', 'tours.activity.execution': 'Durchgeführt am', diff --git a/shared/src/i18n/en/tours.ts b/shared/src/i18n/en/tours.ts index e02168206..0904bfb7c 100644 --- a/shared/src/i18n/en/tours.ts +++ b/shared/src/i18n/en/tours.ts @@ -1193,6 +1193,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Actual track linked', 'tours.activity.removed': 'Actual track unlinked', 'tours.activity.failed': 'The actual track could not be changed', + 'tours.activity.offline': 'Changing the actual track needs a connection, and this tour’s waiting changes go first', 'tours.activity.dialogEyebrow': 'Add actual track', 'tours.activity.dialogHint': 'The plan stays as it is. The track is only linked.', 'tours.activity.execution': 'Done on', diff --git a/shared/src/i18n/es/tours.ts b/shared/src/i18n/es/tours.ts index 70793656e..11d5fb2a6 100644 --- a/shared/src/i18n/es/tours.ts +++ b/shared/src/i18n/es/tours.ts @@ -1217,6 +1217,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Track real vinculado', 'tours.activity.removed': 'Track real desvinculado', 'tours.activity.failed': 'No se pudo cambiar el track real', + 'tours.activity.offline': + 'Cambiar el track real necesita conexión, y los cambios pendientes de esta ruta van primero', 'tours.activity.dialogEyebrow': 'Añadir track real', 'tours.activity.dialogHint': 'El plan queda como está. El track solo se vincula.', 'tours.activity.execution': 'Hecha el', diff --git a/shared/src/i18n/et/tours.ts b/shared/src/i18n/et/tours.ts index 1fdfc5c37..a489f538a 100644 --- a/shared/src/i18n/et/tours.ts +++ b/shared/src/i18n/et/tours.ts @@ -1202,6 +1202,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Tegelik rada seotud', 'tours.activity.removed': 'Tegeliku raja seos eemaldatud', 'tours.activity.failed': 'Tegelikku rada ei õnnestunud muuta', + 'tours.activity.offline': 'Tegeliku raja muutmiseks on vaja ühendust ja selle matka ootel muudatused lähevad enne', 'tours.activity.dialogEyebrow': 'Lisa tegelik rada', 'tours.activity.dialogHint': 'Plaan jääb samaks. Rada ainult seotakse.', 'tours.activity.execution': 'Läbitud', diff --git a/shared/src/i18n/fr/tours.ts b/shared/src/i18n/fr/tours.ts index e83d40e68..59f6e4222 100644 --- a/shared/src/i18n/fr/tours.ts +++ b/shared/src/i18n/fr/tours.ts @@ -1242,6 +1242,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Trace réelle liée', 'tours.activity.removed': 'Trace réelle déliée', 'tours.activity.failed': 'La trace réelle n’a pas pu être modifiée', + 'tours.activity.offline': + 'Modifier la trace réelle demande une connexion, et les modifications en attente de cette sortie passent d’abord', 'tours.activity.dialogEyebrow': 'Ajouter la trace réelle', 'tours.activity.dialogHint': 'Le plan reste tel quel. La trace est seulement liée.', 'tours.activity.execution': 'Réalisée le', diff --git a/shared/src/i18n/gr/tours.ts b/shared/src/i18n/gr/tours.ts index d89f7b170..d04704aa8 100644 --- a/shared/src/i18n/gr/tours.ts +++ b/shared/src/i18n/gr/tours.ts @@ -1244,6 +1244,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Η πραγματική διαδρομή συνδέθηκε', 'tours.activity.removed': 'Η πραγματική διαδρομή αποσυνδέθηκε', 'tours.activity.failed': 'Δεν ήταν δυνατή η αλλαγή της πραγματικής διαδρομής', + 'tours.activity.offline': + 'Η αλλαγή της πραγματικής διαδρομής χρειάζεται σύνδεση, και οι εκκρεμείς αλλαγές αυτής της διαδρομής στέλνονται πρώτα', 'tours.activity.dialogEyebrow': 'Προσθήκη πραγματικής διαδρομής', 'tours.activity.dialogHint': 'Το σχέδιο μένει ως έχει. Η διαδρομή απλώς συνδέεται.', 'tours.activity.execution': 'Έγινε στις', diff --git a/shared/src/i18n/hu/tours.ts b/shared/src/i18n/hu/tours.ts index ca2014c83..c38df103a 100644 --- a/shared/src/i18n/hu/tours.ts +++ b/shared/src/i18n/hu/tours.ts @@ -1222,6 +1222,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Tényleges nyomvonal összekapcsolva', 'tours.activity.removed': 'Tényleges nyomvonal leválasztva', 'tours.activity.failed': 'A tényleges nyomvonalat nem sikerült módosítani', + 'tours.activity.offline': + 'A tényleges nyomvonal módosításához kapcsolat kell, és a túra várakozó módosításai mennek előbb', 'tours.activity.dialogEyebrow': 'Tényleges nyomvonal hozzáadása', 'tours.activity.dialogHint': 'A terv változatlan marad. A nyomvonalat csak összekapcsoljuk.', 'tours.activity.execution': 'Teljesítve', diff --git a/shared/src/i18n/id/tours.ts b/shared/src/i18n/id/tours.ts index 6c6c807a6..1649387a4 100644 --- a/shared/src/i18n/id/tours.ts +++ b/shared/src/i18n/id/tours.ts @@ -1200,6 +1200,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Jejak aktual ditautkan', 'tours.activity.removed': 'Jejak aktual dilepaskan', 'tours.activity.failed': 'Jejak aktual tidak dapat diubah', + 'tours.activity.offline': + 'Mengubah jejak aktual memerlukan koneksi, dan perubahan tur ini yang masih menunggu dikirim lebih dulu', 'tours.activity.dialogEyebrow': 'Tambah jejak aktual', 'tours.activity.dialogHint': 'Rencana tetap seperti semula. Jejak hanya ditautkan.', 'tours.activity.execution': 'Dilakukan pada', diff --git a/shared/src/i18n/it/tours.ts b/shared/src/i18n/it/tours.ts index abf708ae1..5c16b4f14 100644 --- a/shared/src/i18n/it/tours.ts +++ b/shared/src/i18n/it/tours.ts @@ -1232,6 +1232,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Traccia effettiva collegata', 'tours.activity.removed': 'Traccia effettiva scollegata', 'tours.activity.failed': 'Non è stato possibile modificare la traccia effettiva', + 'tours.activity.offline': + 'Per modificare la traccia effettiva serve una connessione, e le modifiche in attesa di questo tour vanno prima', 'tours.activity.dialogEyebrow': 'Aggiungi traccia effettiva', 'tours.activity.dialogHint': 'Il piano resta com’è. La traccia viene solo collegata.', 'tours.activity.execution': 'Svolto il', diff --git a/shared/src/i18n/ja/tours.ts b/shared/src/i18n/ja/tours.ts index adf060657..284e7c64a 100644 --- a/shared/src/i18n/ja/tours.ts +++ b/shared/src/i18n/ja/tours.ts @@ -1166,6 +1166,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': '実際のトラックをリンクしました', 'tours.activity.removed': '実際のトラックのリンクを解除しました', 'tours.activity.failed': '実際のトラックを変更できませんでした', + 'tours.activity.offline': '実際のトラックを変更するには接続が必要です。このツアーの未送信の変更が先に送られます', 'tours.activity.dialogEyebrow': '実際のトラックを追加', 'tours.activity.dialogHint': '計画はそのままです。トラックをリンクするだけです。', 'tours.activity.execution': '実施日', diff --git a/shared/src/i18n/ko/tours.ts b/shared/src/i18n/ko/tours.ts index 87a73bbf4..81ffc253d 100644 --- a/shared/src/i18n/ko/tours.ts +++ b/shared/src/i18n/ko/tours.ts @@ -1163,6 +1163,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': '실제 트랙을 연결했습니다', 'tours.activity.removed': '실제 트랙 연결을 해제했습니다', 'tours.activity.failed': '실제 트랙을 변경할 수 없습니다', + 'tours.activity.offline': '실제 트랙을 변경하려면 연결이 필요하며, 이 투어의 대기 중인 변경이 먼저 전송됩니다', 'tours.activity.dialogEyebrow': '실제 트랙 추가', 'tours.activity.dialogHint': '계획은 그대로입니다. 트랙만 연결됩니다.', 'tours.activity.execution': '진행일', diff --git a/shared/src/i18n/nl/tours.ts b/shared/src/i18n/nl/tours.ts index a461f51df..7f558f5e6 100644 --- a/shared/src/i18n/nl/tours.ts +++ b/shared/src/i18n/nl/tours.ts @@ -1224,6 +1224,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Werkelijke track gekoppeld', 'tours.activity.removed': 'Werkelijke track ontkoppeld', 'tours.activity.failed': 'De werkelijke track kon niet worden gewijzigd', + 'tours.activity.offline': + 'De werkelijke track wijzigen vraagt een verbinding, en de wachtende wijzigingen van deze tocht gaan voor', 'tours.activity.dialogEyebrow': 'Werkelijke track toevoegen', 'tours.activity.dialogHint': 'De planning blijft zoals ze is. De track wordt alleen gekoppeld.', 'tours.activity.execution': 'Gedaan op', diff --git a/shared/src/i18n/pl/tours.ts b/shared/src/i18n/pl/tours.ts index 893111ad9..aff148982 100644 --- a/shared/src/i18n/pl/tours.ts +++ b/shared/src/i18n/pl/tours.ts @@ -1253,6 +1253,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Połączono rzeczywistą trasę', 'tours.activity.removed': 'Odłączono rzeczywistą trasę', 'tours.activity.failed': 'Nie udało się zmienić rzeczywistej trasy', + 'tours.activity.offline': + 'Zmiana rzeczywistej trasy wymaga połączenia, a oczekujące zmiany tej wycieczki idą najpierw', 'tours.activity.dialogEyebrow': 'Dodaj rzeczywistą trasę', 'tours.activity.dialogHint': 'Plan pozostaje bez zmian. Trasa jest tylko połączona.', 'tours.activity.execution': 'Odbyta dnia', diff --git a/shared/src/i18n/ru/tours.ts b/shared/src/i18n/ru/tours.ts index 6b99ee1b3..c8a8bc3b7 100644 --- a/shared/src/i18n/ru/tours.ts +++ b/shared/src/i18n/ru/tours.ts @@ -1258,6 +1258,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Фактический трек привязан', 'tours.activity.removed': 'Фактический трек отвязан', 'tours.activity.failed': 'Не удалось изменить фактический трек', + 'tours.activity.offline': + 'Для изменения фактического трека нужно подключение, и сначала отправляются ожидающие изменения этого маршрута', 'tours.activity.dialogEyebrow': 'Добавить фактический трек', 'tours.activity.dialogHint': 'План остаётся прежним. Трек только привязывается.', 'tours.activity.execution': 'Пройден', diff --git a/shared/src/i18n/sk/tours.ts b/shared/src/i18n/sk/tours.ts index 8c6fa1082..11d7c058f 100644 --- a/shared/src/i18n/sk/tours.ts +++ b/shared/src/i18n/sk/tours.ts @@ -1211,6 +1211,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Skutočná trasa prepojená', 'tours.activity.removed': 'Skutočná trasa odpojená', 'tours.activity.failed': 'Skutočnú trasu sa nepodarilo zmeniť', + 'tours.activity.offline': 'Zmena skutočnej trasy potrebuje pripojenie a čakajúce zmeny tejto túry idú prvé', 'tours.activity.dialogEyebrow': 'Pridať skutočnú trasu', 'tours.activity.dialogHint': 'Plán zostáva, ako je. Trasa sa len prepojí.', 'tours.activity.execution': 'Uskutočnené', diff --git a/shared/src/i18n/sv/tours.ts b/shared/src/i18n/sv/tours.ts index 9412013ba..afde08c07 100644 --- a/shared/src/i18n/sv/tours.ts +++ b/shared/src/i18n/sv/tours.ts @@ -1197,6 +1197,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Faktiskt spår kopplat', 'tours.activity.removed': 'Faktiskt spår bortkopplat', 'tours.activity.failed': 'Det faktiska spåret kunde inte ändras', + 'tours.activity.offline': + 'Att ändra det faktiska spåret kräver en anslutning, och turens väntande ändringar skickas först', 'tours.activity.dialogEyebrow': 'Lägg till faktiskt spår', 'tours.activity.dialogHint': 'Planen förblir som den är. Spåret kopplas bara.', 'tours.activity.execution': 'Genomförd', diff --git a/shared/src/i18n/th/tours.ts b/shared/src/i18n/th/tours.ts index fa76c6415..e8ff932cc 100644 --- a/shared/src/i18n/th/tours.ts +++ b/shared/src/i18n/th/tours.ts @@ -1146,6 +1146,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'เชื่อมเส้นทางจริงแล้ว', 'tours.activity.removed': 'ยกเลิกการเชื่อมเส้นทางจริงแล้ว', 'tours.activity.failed': 'ไม่สามารถเปลี่ยนเส้นทางจริงได้', + 'tours.activity.offline': 'การเปลี่ยนเส้นทางจริงต้องใช้การเชื่อมต่อ และการเปลี่ยนแปลงที่รอส่งของทัวร์นี้จะถูกส่งก่อน', 'tours.activity.dialogEyebrow': 'เพิ่มเส้นทางจริง', 'tours.activity.dialogHint': 'แผนยังคงเหมือนเดิม เส้นทางถูกเชื่อมเท่านั้น', 'tours.activity.execution': 'ทำเมื่อ', diff --git a/shared/src/i18n/tours-locales.spec.ts b/shared/src/i18n/tours-locales.spec.ts index b24fa4c45..5d68df2a0 100644 --- a/shared/src/i18n/tours-locales.spec.ts +++ b/shared/src/i18n/tours-locales.spec.ts @@ -20,7 +20,7 @@ const toursModules = import.meta.glob<{ default: TranslationStrings }>('./*/tour const TOUR_DOMAINS: { file: string; generalKeyCount: number; modules: DomainModules }[] = [ { file: 'tours', - generalKeyCount: 1175, + generalKeyCount: 1176, modules: toursModules, }, { diff --git a/shared/src/i18n/tr/tours.ts b/shared/src/i18n/tr/tours.ts index 953946c5a..53e9e22bc 100644 --- a/shared/src/i18n/tr/tours.ts +++ b/shared/src/i18n/tr/tours.ts @@ -1203,6 +1203,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Gerçek iz bağlandı', 'tours.activity.removed': 'Gerçek izin bağlantısı kaldırıldı', 'tours.activity.failed': 'Gerçek iz değiştirilemedi', + 'tours.activity.offline': + 'Gerçek izi değiştirmek bağlantı gerektirir ve bu turun bekleyen değişiklikleri önce gönderilir', 'tours.activity.dialogEyebrow': 'Gerçek iz ekle', 'tours.activity.dialogHint': 'Plan olduğu gibi kalır. İz yalnızca bağlanır.', 'tours.activity.execution': 'Yapıldığı gün', diff --git a/shared/src/i18n/uk/tours.ts b/shared/src/i18n/uk/tours.ts index 329e02e03..370da1671 100644 --- a/shared/src/i18n/uk/tours.ts +++ b/shared/src/i18n/uk/tours.ts @@ -1245,6 +1245,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Фактичний трек прив’язано', 'tours.activity.removed': 'Фактичний трек відв’язано', 'tours.activity.failed': 'Не вдалося змінити фактичний трек', + 'tours.activity.offline': + 'Для зміни фактичного треку потрібне підключення, і спершу надсилаються зміни цього маршруту, що очікують', 'tours.activity.dialogEyebrow': 'Додати фактичний трек', 'tours.activity.dialogHint': 'План лишається незмінним. Трек лише прив’язується.', 'tours.activity.execution': 'Пройдено', diff --git a/shared/src/i18n/vi/tours.ts b/shared/src/i18n/vi/tours.ts index a487d251a..b526d3aca 100644 --- a/shared/src/i18n/vi/tours.ts +++ b/shared/src/i18n/vi/tours.ts @@ -1190,6 +1190,8 @@ const tours: TranslationStrings = { 'tours.activity.assigned': 'Đã liên kết lộ trình thực tế', 'tours.activity.removed': 'Đã bỏ liên kết lộ trình thực tế', 'tours.activity.failed': 'Không thể thay đổi lộ trình thực tế', + 'tours.activity.offline': + 'Thay đổi lộ trình thực tế cần kết nối mạng, và các thay đổi đang chờ của tour này được gửi trước', 'tours.activity.dialogEyebrow': 'Thêm lộ trình thực tế', 'tours.activity.dialogHint': 'Kế hoạch giữ nguyên. Lộ trình chỉ được liên kết.', 'tours.activity.execution': 'Thực hiện vào', diff --git a/shared/src/i18n/zh-TW/tours.ts b/shared/src/i18n/zh-TW/tours.ts index 1c8ad5c97..4c024cfda 100644 --- a/shared/src/i18n/zh-TW/tours.ts +++ b/shared/src/i18n/zh-TW/tours.ts @@ -1107,6 +1107,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': '已連結實際軌跡', 'tours.activity.removed': '已取消連結實際軌跡', 'tours.activity.failed': '無法變更實際軌跡', + 'tours.activity.offline': '變更實際軌跡需要網路連線,此路線待傳送的變更會先傳送', 'tours.activity.dialogEyebrow': '新增實際軌跡', 'tours.activity.dialogHint': '計畫維持不變,只會連結軌跡。', 'tours.activity.execution': '完成於', diff --git a/shared/src/i18n/zh/tours.ts b/shared/src/i18n/zh/tours.ts index e322ab1a0..c52c9a07a 100644 --- a/shared/src/i18n/zh/tours.ts +++ b/shared/src/i18n/zh/tours.ts @@ -1108,6 +1108,7 @@ const tours: TranslationStrings = { 'tours.activity.assigned': '已关联实际轨迹', 'tours.activity.removed': '已取消关联实际轨迹', 'tours.activity.failed': '无法更改实际轨迹', + 'tours.activity.offline': '更改实际轨迹需要网络连接,此路线待发送的更改会先发送', 'tours.activity.dialogEyebrow': '添加实际轨迹', 'tours.activity.dialogHint': '计划保持不变,只关联轨迹。', 'tours.activity.execution': '完成于',