From 711015d5fd537dc898be2b7d7c44c8f101261084 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 21 Nov 2026 00:23:13 +0100 Subject: [PATCH] feat(admin): live flight status, booking mail import and paddle water data as rows of the addon cards The addons page listed the trip, global and integration addons and then three loose cards under them: live flight status, the booking mail import and the paddle water data. They now sit where they belong, as rows of the cards: - Live flight status is a row of the trip card, with its switch, locked when FLIGHT_LIVE_ENABLED holds it. - The booking mail import is a row of the integration card with its switch; while it is on, "Set up mail import" opens the transport, address, AI allowance, test and status in a dialog, the way AI is set up. - The paddle water data are a row under the Tours addon that opens the regions in a dialog, counting the open requests, else the regions. The phone follows with the same rows and bottom sheets. The setup row and the setup dialog are shared components (AddonSetupRow, AddonSetupDialog on the desktop, MAdminOptionRow and MAdminSetupRow on the phone), the card counts stay the addons' own, and the settings tab loses its features part. --- client/scripts/feature-pairs.json | 2 +- client/scripts/theme-baseline.json | 2 +- .../components/Admin/AddonManager.test.tsx | 37 +++++++++ client/src/components/Admin/AddonManager.tsx | 55 ++++++++++++-- .../src/components/Admin/AddonSetupDialog.tsx | 68 +++++++++++++++++ client/src/components/Admin/AddonSetupRow.tsx | 38 ++++++++++ .../components/Admin/addons/AiAddonTile.tsx | 21 +----- ...tAdminCard.tsx => MailIngestAddonTile.tsx} | 75 +++++++++++-------- .../Admin/paddle/PaddleRegionsPanel.test.tsx | 46 +++++++++--- .../Admin/paddle/PaddleRegionsPanel.tsx | 53 ++++++++++--- client/src/mobile/screens/admin/MAdmin.tsx | 14 +++- .../screens/admin/MAdminAddonManager.tsx | 69 ++++++++++------- .../admin/MAdminPaddleRegionsPanel.tsx | 61 +++++++++------ .../screens/admin/MAdminSettingsSection.tsx | 50 ++----------- client/src/mobile/screens/admin/MAdminUi.tsx | 54 ++++++++++++- .../screens/admin/MMailIngestAdminCard.tsx | 47 ++++++++---- client/src/pages/AdminPage.test.tsx | 5 -- client/src/pages/AdminPage.tsx | 14 +++- .../src/pages/admin/AdminSettingsTab.test.tsx | 3 +- client/src/pages/admin/AdminSettingsTab.tsx | 52 ++----------- .../tests/unit/mobile/admin/MAdmin.test.tsx | 6 +- .../mobile/admin/MAdminAddonManager.test.tsx | 23 ++++++ .../admin/MAdminPaddleRegionsPanel.test.tsx | 27 ++++++- .../admin/MAdminSettingsSection.test.tsx | 9 +-- shared/src/i18n/ar/mailAdmin.ts | 1 + shared/src/i18n/az/mailAdmin.ts | 1 + shared/src/i18n/br/mailAdmin.ts | 1 + shared/src/i18n/ca/mailAdmin.ts | 1 + shared/src/i18n/cs/mailAdmin.ts | 1 + shared/src/i18n/de/mailAdmin.ts | 1 + shared/src/i18n/en/mailAdmin.ts | 1 + shared/src/i18n/es/mailAdmin.ts | 1 + shared/src/i18n/et/mailAdmin.ts | 1 + shared/src/i18n/fr/mailAdmin.ts | 1 + shared/src/i18n/gr/mailAdmin.ts | 1 + shared/src/i18n/he/mailAdmin.ts | 1 + shared/src/i18n/hu/mailAdmin.ts | 1 + shared/src/i18n/id/mailAdmin.ts | 1 + shared/src/i18n/it/mailAdmin.ts | 1 + shared/src/i18n/ja/mailAdmin.ts | 1 + shared/src/i18n/ko/mailAdmin.ts | 1 + shared/src/i18n/nl/mailAdmin.ts | 1 + shared/src/i18n/pl/mailAdmin.ts | 1 + shared/src/i18n/ru/mailAdmin.ts | 1 + shared/src/i18n/sk/mailAdmin.ts | 1 + shared/src/i18n/sv/mailAdmin.ts | 1 + shared/src/i18n/th/mailAdmin.ts | 1 + shared/src/i18n/tr/mailAdmin.ts | 1 + shared/src/i18n/uk/mailAdmin.ts | 1 + shared/src/i18n/vi/mailAdmin.ts | 1 + shared/src/i18n/zh-TW/mailAdmin.ts | 1 + shared/src/i18n/zh/mailAdmin.ts | 1 + 52 files changed, 596 insertions(+), 263 deletions(-) create mode 100644 client/src/components/Admin/AddonSetupDialog.tsx create mode 100644 client/src/components/Admin/AddonSetupRow.tsx rename client/src/components/Admin/mailIngest/{MailIngestAdminCard.tsx => MailIngestAddonTile.tsx} (86%) diff --git a/client/scripts/feature-pairs.json b/client/scripts/feature-pairs.json index 58f062177..2fc9d10a0 100644 --- a/client/scripts/feature-pairs.json +++ b/client/scripts/feature-pairs.json @@ -190,7 +190,7 @@ { "feature": "Booking mail import: admin card", "hooks": ["src/components/Admin/mailIngest/useMailIngestAdmin.ts", "src/components/Admin/mailIngest/mailIngestAdminModel.ts"], - "desktop": ["src/components/Admin/mailIngest/MailIngestAdminCard.tsx"], + "desktop": ["src/components/Admin/mailIngest/MailIngestAddonTile.tsx"], "mobile": ["src/mobile/screens/admin/MMailIngestAdminCard.tsx"] }, { diff --git a/client/scripts/theme-baseline.json b/client/scripts/theme-baseline.json index 10da2cade..9edd21dac 100644 --- a/client/scripts/theme-baseline.json +++ b/client/scripts/theme-baseline.json @@ -146,7 +146,7 @@ "mobile/components/MToastHost.tsx": 2, "mobile/components/MUserPickerList.tsx": 1, "mobile/screens/admin/MAdmin.tsx": 8, - "mobile/screens/admin/MAdminAddonManager.tsx": 4, + "mobile/screens/admin/MAdminAddonManager.tsx": 3, "mobile/screens/admin/MAdminAuditLogPanel.tsx": 15, "mobile/screens/admin/MAdminBackupPanel.tsx": 7, "mobile/screens/admin/MAdminCategoryManager.tsx": 8, diff --git a/client/src/components/Admin/AddonManager.test.tsx b/client/src/components/Admin/AddonManager.test.tsx index 66e3470e4..2340d3db6 100644 --- a/client/src/components/Admin/AddonManager.test.tsx +++ b/client/src/components/Admin/AddonManager.test.tsx @@ -7,6 +7,7 @@ import { useAuthStore } from '../../store/authStore'; import { useSettingsStore } from '../../store/settingsStore'; import { useAddonStore } from '../../store/addonStore'; import { ToastContainer } from '../shared/Toast'; +import { mailIngestRepo } from '../../repo/mailIngestRepo'; import AddonManager from './AddonManager'; function buildAddon(overrides = {}) { @@ -691,4 +692,40 @@ describe('AddonManager', () => { expect(roadtrip.querySelector('svg.lucide-car-front')).toBeInTheDocument(); expect(tours.querySelector('svg.lucide-puzzle')).not.toBeInTheDocument(); }); + + it('FE-ADMIN-ADDON-045: live flight status is a row of the trip card, switched there and locked by the environment', async () => { + server.use(addonsRoute([buildAddon({ id: 'packing', name: 'Lists', icon: 'ListChecks', type: 'trip', enabled: true })])); + const onToggle = vi.fn(); + const { unmount } = render(); + const trip = (await screen.findByRole('heading', { name: 'Trip' })).closest('section')!; + await userEvent.click(within(trip).getByRole('button', { name: 'Follow booked flights live' })); + expect(onToggle).toHaveBeenCalledTimes(1); + // The count stays the addons': the flight row is an instance option beside them. + expect(within(trip).getByText('1/1')).toBeInTheDocument(); + unmount(); + + render(); + expect(await screen.findByRole('button', { name: 'Follow booked flights live' })).toBeDisabled(); + }); + + it('FE-ADMIN-ADDON-046: the booking mail import is a row of the integration card whose setup opens in a dialog', async () => { + server.use(addonsRoute([buildAddon({ id: 'mcp', name: 'MCP', icon: 'Terminal', type: 'integration', enabled: false })])); + vi.spyOn(mailIngestRepo, 'adminSettings').mockResolvedValue({ mail_ingest_enabled: 'true' }); + vi.spyOn(mailIngestRepo, 'adminStatus').mockRejectedValue(new Error('no status')); + render(); + const integration = (await screen.findByRole('heading', { name: 'Integration' })).closest('section')!; + expect(within(integration).getByText('Booking mail import')).toBeInTheDocument(); + await userEvent.click(await within(integration).findByRole('button', { name: 'Set up mail import' })); + const dialog = await screen.findByRole('dialog'); + expect(within(dialog).getByText('How mail arrives')).toBeInTheDocument(); + }); + + it('FE-ADMIN-ADDON-047: without the mail option the integration card has no mail row and nothing is loaded', async () => { + server.use(addonsRoute([buildAddon({ id: 'mcp', name: 'MCP', icon: 'Terminal', type: 'integration', enabled: false })])); + const load = vi.spyOn(mailIngestRepo, 'adminSettings'); + render(); + await screen.findByRole('heading', { name: 'Integration' }); + expect(screen.queryByText('Booking mail import')).not.toBeInTheDocument(); + expect(load).not.toHaveBeenCalled(); + }); }); diff --git a/client/src/components/Admin/AddonManager.tsx b/client/src/components/Admin/AddonManager.tsx index 591b78e5b..da038115c 100644 --- a/client/src/components/Admin/AddonManager.tsx +++ b/client/src/components/Admin/AddonManager.tsx @@ -1,6 +1,6 @@ -import type { ComponentType, ReactNode } from 'react' +import type { ComponentType } from 'react' import { useTranslation } from '../../i18n' -import { Puzzle, ListChecks, Wallet, FileText, CalendarDays, Globe, Briefcase, Image, Terminal, Link2, Compass, BookOpen, Sparkles, Luggage, Plane, Bookmark, Users, Loader2, Mountain, CarFront } from 'lucide-react' +import { Puzzle, ListChecks, Wallet, FileText, CalendarDays, Globe, Briefcase, Image, Terminal, Link2, Compass, BookOpen, Sparkles, Luggage, Plane, Bookmark, Users, Loader2, Mountain, CarFront, Radar } from 'lucide-react' import EmptyState from '../shared/EmptyState' import DawarichIcon from '../shared/DawarichIcon' import AirTrailIcon from '../shared/AirTrailIcon' @@ -12,6 +12,9 @@ import { SettingsCard, SettingsColumns, StatusPill } from '../Settings/settingsK import { type Addon, type CollabFeatures, COLLAB_SUB_FEATURES, getAddonLabel } from './addons/addonModel' import { useAddonManager } from './addons/useAddonManager' import AiAddonTile from './addons/AiAddonTile' +import MailIngestAddonTile from './mailIngest/MailIngestAddonTile' +import PaddleRegionsPanel from './paddle/PaddleRegionsPanel' +import ToggleSwitch from '../Settings/ToggleSwitch' import { ImmichIcon, SynologyIcon } from './addons/PhotoProviderIcons' import WandererMark from '../Tours/wanderer/WandererMark' @@ -65,13 +68,24 @@ const TYPE_META: Record; labelK integration: { icon: Link2, labelKey: 'admin.addons.type.integration', hintKey: 'admin.addons.integrationHint' }, } -export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, collabFeatures, onToggleCollabFeature, aside }: { +/** The live flight status switch, an instance setting that sits with the trip addons. */ +export interface FlightLiveOption { + on: boolean + /** The server environment (FLIGHT_LIVE_ENABLED) holds it; the switch shows the state and says why. */ + locked: boolean + managed: boolean + onToggle: () => void +} + +export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, collabFeatures, onToggleCollabFeature, flightLive, mailImport = false }: { bagTrackingEnabled?: boolean onToggleBagTracking?: () => void collabFeatures?: CollabFeatures onToggleCollabFeature?: (key: string) => void - /** Cards that set up what the integrations reach (flight status, booking mails), under them in the right column. */ - aside?: ReactNode + /** Live flight status, a row of the trip card: it follows the trips' booked flights. */ + flightLive?: FlightLiveOption + /** Booking mail import, a row of the integration card with its setup dialog; off on a managed install. */ + mailImport?: boolean }) { const { t } = useTranslation() const { @@ -181,6 +195,8 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, onToggle={() => void toggle()} /> )), + // The paddle water data the tour planner reads, set up in a dialog of its own. + , ] } return null @@ -202,6 +218,9 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, ) } + /** Whether a card holds rows beside its own addons: the AI tile, an instance option. */ + const extraRows = (key: string) => + (key === 'trip' && !!flightLive) || (key === 'integration' && (aiAddons.length > 0 || mailImport)) /* A card per type, the way every other admin tab sets its cards: Trip in the left column, Global and Integration in the right one, each card with the dialogs' head band carrying the type, its count and what it means. */ @@ -209,14 +228,14 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, { key: 'trip', addons: tripAddons }, { key: 'global', addons: globalAddons }, { key: 'integration', addons: integrationAddons }, - ].filter(g => g.addons.length > 0 || (g.key === 'integration' && aiAddons.length > 0)) + ].filter(g => g.addons.length > 0 || extraRows(g.key)) const card = (g: (typeof groups)[number]) => { const meta = TYPE_META[g.key] const all = g.key === 'integration' ? [...aiAddons, ...g.addons] : g.addons const visible = g.addons const ai = g.key === 'integration' && aiAddons.length > 0 - if (!visible.length && !ai) return null + if (!visible.length && !ai && !extraRows(g.key)) return null const on = all.filter(a => a.enabled).length return ( } {visible.map(tile)} + {/* Not addons but instance options of the same kind, as rows of the same card; + the count above stays the addons'. */} + {g.key === 'trip' && flightLive && } + {g.key === 'integration' && mailImport && } ) @@ -251,5 +274,21 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, ) } - return {cards.end}{aside}} /> + return +} + +/** Live flight status as a trip row: on, it follows every booked flight on its day. */ +function FlightLiveTile({ option }: { option: FlightLiveOption }) { + const { t } = useTranslation() + const name = t('flightLive.adminTitle') + const hint = option.managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint') + return ( + } + name={name} + description={option.locked ? `${hint} ${t('flightLive.envLocked')}` : hint} + enabled={option.on} + trailing={} + /> + ) } diff --git a/client/src/components/Admin/AddonSetupDialog.tsx b/client/src/components/Admin/AddonSetupDialog.tsx new file mode 100644 index 000000000..abe25bb94 --- /dev/null +++ b/client/src/components/Admin/AddonSetupDialog.tsx @@ -0,0 +1,68 @@ +import React, { useId, type ReactNode } from 'react'; +import { useTranslation } from '../../i18n'; +import { + DialogButton, + DialogFooter, + DialogHeader, + DialogShell, + DialogTile, + FooterSpacer, + NEUTRAL_TINT, +} from '../shared/DialogShell'; + +/** + * The dialog an addon's setup row opens: the icon tile, the addon it belongs + * to above the title, what it sets up below, and one Close, since everything + * inside saves on its own (booking mails, paddle water data). + */ +export default function AddonSetupDialog({ + icon, + eyebrow, + title, + sub, + onClose, + blocked = false, + children, +}: { + icon: ReactNode; + eyebrow: string; + title: string; + sub: string; + onClose: () => void; + /** A confirmation stacked on top holds the dialog while it is open. */ + blocked?: boolean; + children: ReactNode; +}): React.ReactElement { + const { t } = useTranslation(); + const labelId = useId(); + return ( + {icon}} + tint={NEUTRAL_TINT} + labelId={labelId} + eyebrow={eyebrow} + title={title} + sub={sub} + subWraps + onClose={onClose} + /> + } + footer={ + + + + {t('common.close')} + + + } + > + {children} + + ); +} diff --git a/client/src/components/Admin/AddonSetupRow.tsx b/client/src/components/Admin/AddonSetupRow.tsx new file mode 100644 index 000000000..cbae99562 --- /dev/null +++ b/client/src/components/Admin/AddonSetupRow.tsx @@ -0,0 +1,38 @@ +import { ChevronRight, Settings2 } from 'lucide-react'; +import React, { type ReactNode } from 'react'; +import { fs } from '../shared/DialogShell'; + +/** + * The last row of an addon's shelf that opens its settings dialog: a gear, what + * the dialog sets up, and a chevron. It keeps a card of addons as short as its + * switches and puts the long forms behind one tap (AI, booking mails, paddle + * water data). A badge says what waits inside, such as requests to look at. + */ +export default function AddonSetupRow({ + label, + onOpen, + badge, +}: { + label: string; + onOpen: () => void; + badge?: ReactNode; +}): React.ReactElement { + return ( +
  • + +
  • + ); +} diff --git a/client/src/components/Admin/addons/AiAddonTile.tsx b/client/src/components/Admin/addons/AiAddonTile.tsx index 1ff0e2803..4b5d8e0cf 100644 --- a/client/src/components/Admin/addons/AiAddonTile.tsx +++ b/client/src/components/Admin/addons/AiAddonTile.tsx @@ -1,8 +1,9 @@ -import { ChevronRight, Settings2, Sparkles } from 'lucide-react'; +import { Sparkles } from 'lucide-react'; import React from 'react'; import { useTranslation } from '../../../i18n'; import { StatusPill } from '../../Settings/settingsKit'; import { fs } from '../../shared/DialogShell'; +import AddonSetupRow from '../AddonSetupRow'; import AddonSubRow from '../AddonSubRow'; import AddonTile from '../AddonTile'; import { type Addon, getAddonLabel } from './addonModel'; @@ -54,23 +55,7 @@ export default function AiAddonTile({ /> ); })} - {tile.canSetUp && ( -
  • - -
  • - )} + {tile.canSetUp && }
    {tile.dialogOpen && } diff --git a/client/src/components/Admin/mailIngest/MailIngestAdminCard.tsx b/client/src/components/Admin/mailIngest/MailIngestAddonTile.tsx similarity index 86% rename from client/src/components/Admin/mailIngest/MailIngestAdminCard.tsx rename to client/src/components/Admin/mailIngest/MailIngestAddonTile.tsx index abc75bd55..01bd41b3f 100644 --- a/client/src/components/Admin/mailIngest/MailIngestAdminCard.tsx +++ b/client/src/components/Admin/mailIngest/MailIngestAddonTile.tsx @@ -1,22 +1,17 @@ import { AlertTriangle, CheckCircle, Copy, Loader2, Mail, PlugZap, Save, XCircle } from 'lucide-react'; -import type { ReactNode } from 'react'; +import { useState, type ReactNode } from 'react'; import { useTranslation } from '../../../i18n'; import type { TranslationFn } from '../../../types'; import { copyText } from '../../../utils/clipboard'; import { relativeTime } from '../../../utils/relativeTime'; -import { - HintMark, - SETTINGS_BUTTON, - SETTINGS_BUTTON_PRIMARY, - SettingRow, - SettingRows, - SettingsCard, - StatusPill, -} from '../../Settings/settingsKit'; +import { HintMark, SETTINGS_BUTTON, SETTINGS_BUTTON_PRIMARY, StatusPill } from '../../Settings/settingsKit'; import ToggleSwitch from '../../Settings/ToggleSwitch'; import CustomSelect from '../../shared/CustomSelect'; import { EditorField, GRID_2, INPUT, READONLY_BOX } from '../../shared/dialogParts'; import { useToast } from '../../shared/Toast'; +import AddonSetupDialog from '../AddonSetupDialog'; +import AddonSetupRow from '../AddonSetupRow'; +import AddonTile from '../AddonTile'; import { TRANSPORTS, problemText, @@ -306,32 +301,46 @@ function Setup({ admin, form, t, locale }: { admin: MailIngestAdmin; form: MailA } /** - * The booking mail import in the admin settings of a self-hosted install: the - * instance switch, how mail arrives (IMAP or a signed webhook), the forwarding - * address template, the AI allowance per person and day, a connection test and - * the status in counts. Not shown on a managed install, where the operator - * runs the TREK Cloud relay. + * The booking mail import as a row of the integration card: its switch, and + * while it is on one row to the dialog that sets it up (how mail arrives, the + * forwarding address template, the AI allowance per person and day, a + * connection test and the status in counts). Not shown on a managed install, + * where the operator runs the TREK Cloud relay. */ -export default function MailIngestAdminCard() { +export default function MailIngestAddonTile() { const { t, locale } = useTranslation(); const admin = useMailIngestAdmin(true); + const [open, setOpen] = useState(false); + const name = t('mailAdmin.title'); return ( - - - admin.toggle(!admin.enabled)} - /> - } - /> - - {admin.enabled && admin.form && } - + <> + } + name={name} + description={`${t('mailAdmin.hint')} ${t('mailAdmin.enabledHint')}`} + enabled={admin.enabled} + trailing={ + admin.toggle(!admin.enabled)} + /> + } + > + {admin.enabled && admin.form && setOpen(true)} />} + + {open && admin.enabled && admin.form && ( + } + eyebrow={name} + title={t('mailAdmin.setup')} + sub={t('mailAdmin.hint')} + onClose={() => setOpen(false)} + > + + + )} + ); } diff --git a/client/src/components/Admin/paddle/PaddleRegionsPanel.test.tsx b/client/src/components/Admin/paddle/PaddleRegionsPanel.test.tsx index 4bbbd5db7..06b093c2c 100644 --- a/client/src/components/Admin/paddle/PaddleRegionsPanel.test.tsx +++ b/client/src/components/Admin/paddle/PaddleRegionsPanel.test.tsx @@ -78,17 +78,22 @@ function adminState(overrides: Partial = {}, search: Partial = {}, search: Partial = {}) { +/** The panel as the Tours shelf shows it: a setup row, opened into its dialog unless asked not to. */ +function show(overrides: Partial = {}, search: Partial = {}, { open = true } = {}) { const state = adminState(overrides, search); hook.usePaddleRegionsAdmin.mockReturnValue(state); - return { state, ...render() }; + const view = render( +
      + +
    + ); + if (open && state.toursOn) fireEvent.click(setupRow()); + return { state, ...view }; } -/** The card's title row, where the number of regions sits beside the title. */ -function titleRow(): HTMLElement { - const row = screen.getByRole('heading', { name: 'Paddle water data' }).parentElement; - if (!row) throw new Error('no title row'); - return row; +/** The shelf row that opens the dialog, where the count of requests or regions sits beside the title. */ +function setupRow(): HTMLElement { + return screen.getAllByRole('button', { name: /^Paddle water data/ })[0]; } function rowOf(name: string): HTMLElement { @@ -100,7 +105,7 @@ function rowOf(name: string): HTMLElement { describe('PaddleRegionsPanel', () => { it('FE-ADMIN-PADDLEREG-001: renders nothing while the Tours addon is off', () => { const { container } = show({ toursOn: false, regions: [READY] }); - expect(container).toBeEmptyDOMElement(); + expect(container.querySelector('ul')).toBeEmptyDOMElement(); }); it('FE-ADMIN-PADDLEREG-002: shows the card with its hint, the attribution and the empty state', () => { @@ -110,7 +115,7 @@ describe('PaddleRegionsPanel', () => { expect(screen.getByText(EMPTY)).toBeInTheDocument(); expect(screen.getByText(ATTRIBUTION)).toBeInTheDocument(); // No count beside the title while there is no region. - expect(titleRow()).toHaveTextContent(/^Paddle water data$/); + expect(setupRow()).toHaveTextContent(/^Paddle water data$/); const search = screen.getByRole('searchbox', { name: 'Add a region' }); expect(search).toBeEnabled(); expect(search).toHaveAttribute('placeholder', 'Search Geofabrik, for example Oberpfalz'); @@ -277,12 +282,31 @@ describe('PaddleRegionsPanel', () => { } }); - it('FE-ADMIN-PADDLEREG-019: the title carries the number of regions', () => { + it('FE-ADMIN-PADDLEREG-019: the setup row carries the open requests, else the number of regions', () => { show({ regions: [READY, WAITING, FAILED_FIRST] }); - expect(within(titleRow()).getByText('3')).toBeInTheDocument(); + expect(within(setupRow()).getByText('3')).toBeInTheDocument(); expect(screen.getAllByTestId('paddle-region-row')).toHaveLength(3); }); + it('FE-ADMIN-PADDLEREG-019b: an open request outranks the region count, a declined one does not count', () => { + const base = { bytes: 1, requested_by: 'elmo', requested_at: '2026-10-18T09:00:00Z' }; + show( + { + regions: [READY, WAITING], + requests: [ + { ...base, id: 'norway', name: 'Norway', reason: 'too_large', declined: true }, + { ...base, id: 'saale', name: 'Saale', reason: 'limit', declined: false }, + ], + }, + {}, + { open: false } + ); + expect(within(setupRow()).getByText('1')).toBeInTheDocument(); + expect(within(setupRow()).queryByText('2')).toBeNull(); + // Closed until the row is opened. + expect(screen.queryByRole('dialog')).toBeNull(); + }); + it('FE-ADMIN-PADDLEREG-020: removing asks first, naming the region, and confirming hands it to the hook', () => { const { state } = show({ regions: [READY], removing: READY }); const message = 'Oberpfalz and its obstacle data are removed. Paddle tours there then show no data.'; diff --git a/client/src/components/Admin/paddle/PaddleRegionsPanel.tsx b/client/src/components/Admin/paddle/PaddleRegionsPanel.tsx index ca590760c..200d2d585 100644 --- a/client/src/components/Admin/paddle/PaddleRegionsPanel.tsx +++ b/client/src/components/Admin/paddle/PaddleRegionsPanel.tsx @@ -1,6 +1,6 @@ import type { PaddleRegion, PaddleRegionCatalogEntry } from '@trek/shared'; import { Check, ChevronRight, Loader2, Plus, RefreshCw, Search, Trash2, Waves, WifiOff } from 'lucide-react'; -import { useId } from 'react'; +import { useId, useState } from 'react'; import { useDateFormat } from '../../../hooks/useDateFormat'; import { useTranslation } from '../../../i18n'; import { formatDisplayDate } from '../../../utils/dateFormat'; @@ -8,7 +8,6 @@ import { SettingRows, SETTINGS_BUTTON, SETTINGS_ICON_BUTTON, - SettingsCard, SettingsHint, StatusPill, } from '../../Settings/settingsKit'; @@ -17,6 +16,8 @@ import { EditorField, INPUT } from '../../shared/dialogParts'; import { fs } from '../../shared/DialogShell'; import ErrorBoundary from '../../shared/ErrorBoundary'; import { Tooltip } from '../../shared/Tooltip'; +import AddonSetupDialog from '../AddonSetupDialog'; +import AddonSetupRow from '../AddonSetupRow'; import { AutoLoadSettings, AutoOriginPill, RequestList } from './PaddleAutoLoadParts'; import { progressPercent, regionStatusTone } from './paddleRegionsModel'; import { usePaddleRegionsAdmin } from './usePaddleRegionsAdmin'; @@ -27,8 +28,10 @@ type Admin = ReturnType; * PAD-05A in the admin area: the regions TREK reads paddle obstacles for, * picked from Geofabrik's list, and (PAD-11C) how TREK loads the region of a * place a paddler plans in by itself, with the regions that wait for an admin. - * The desktop admin shows this card under the addons while the Tours addon - * is on; the phone has MAdminPaddleRegionsPanel on the same hook. + * The desktop admin shows it as a row of the Tours addon that opens it as a + * dialog while the addon is on; the row counts what waits for the admin (the + * requests) or else the regions. The phone has MAdminPaddleRegionsPanel on + * the same hook. */ export default function PaddleRegionsPanel() { return ( @@ -41,14 +44,42 @@ export default function PaddleRegionsPanel() { function Panel() { const { t } = useTranslation(); const admin = usePaddleRegionsAdmin(); + const [open, setOpen] = useState(false); if (!admin.toursOn) return null; + const title = t('admin.paddleRegions.title'); + // A declined request no longer waits for anyone; only the open ones ask for a look. + const waiting = admin.requests.filter((r) => !r.declined).length; + const badge = + waiting > 0 ? ( + {waiting} + ) : admin.regions.length > 0 ? ( + {admin.regions.length} + ) : undefined; + const close = () => setOpen(false); return ( - 0 ? {admin.regions.length} : undefined} - > + <> + setOpen(true)} badge={badge} /> + {open && ( + } + eyebrow={t('admin.addons.catalog.tours.name')} + title={title} + sub={t('admin.paddleRegions.hint')} + onClose={close} + blocked={admin.removing !== null} + > + + + )} + + ); +} + +/** What the dialog holds: the state of the list, the settings, the requests, the search and the regions. */ +function PanelBody({ admin }: { admin: Admin }) { + const { t } = useTranslation(); + return ( +
    {admin.offline && (

    - +

    ); } diff --git a/client/src/mobile/screens/admin/MAdmin.tsx b/client/src/mobile/screens/admin/MAdmin.tsx index 07e84851e..0c9ad2148 100644 --- a/client/src/mobile/screens/admin/MAdmin.tsx +++ b/client/src/mobile/screens/admin/MAdmin.tsx @@ -1,5 +1,4 @@ import MAdminSchoolHolidayCatalog from './MAdminSchoolHolidayCatalog' -import MAdminPaddleRegionsPanel from './MAdminPaddleRegionsPanel' import { useState } from 'react' import { ArrowUp, @@ -246,10 +245,17 @@ export default function MAdmin() { onToggleBagTracking={toggleBagTracking} collabFeatures={collabFeatures} onToggleCollabFeature={toggleCollabFeature} + // Live flight status and the booking mail import are rows of the addon groups, + // and the paddle water data a row under Tours (desktop parity). + flightLive={{ + on: admin.flightLive, + locked: admin.flightLiveLocked, + managed: !!managed, + onToggle: () => + void admin.handleToggleAuthSetting('flight_live_enabled', !admin.flightLive, admin.setFlightLive), + }} + mailImport={!managed} /> - {/* How the integrations reach the world (live flights, booking mails), beside the addons they serve. */} - - )} {activeTab === 'plugins' && } diff --git a/client/src/mobile/screens/admin/MAdminAddonManager.tsx b/client/src/mobile/screens/admin/MAdminAddonManager.tsx index 70ef8d343..8aba03ae7 100644 --- a/client/src/mobile/screens/admin/MAdminAddonManager.tsx +++ b/client/src/mobile/screens/admin/MAdminAddonManager.tsx @@ -3,7 +3,7 @@ import { useTranslation } from '../../../i18n' import { useIsDark } from '../../../hooks/useIsDark' import { Puzzle, ListChecks, Wallet, FileText, CalendarDays, Globe, Briefcase, Image, Terminal, Link2, Compass, BookOpen, - Sparkles, Luggage, Plane, Bookmark, Users, Mountain, CarFront, Settings2, ChevronRight, + Sparkles, Luggage, Plane, Bookmark, Users, Mountain, CarFront, Radar, } from 'lucide-react' import DawarichIcon from '../../../components/shared/DawarichIcon' import AirTrailIcon from '../../../components/shared/AirTrailIcon' @@ -21,7 +21,10 @@ import AiSettingsDialog from '../../../components/Admin/addons/AiAdminConfig' import { AI_ADDON_ICONS, type AiAddonId } from '../../../components/Admin/addons/aiAddons' import { useAiAddonTile } from '../../../components/Admin/addons/useAiAddonTile' import { ImmichIcon, SynologyIcon } from '../../../components/Admin/addons/PhotoProviderIcons' -import { MAdminCard } from './MAdminUi' +import { MAdminCard, MAdminOptionRow, MAdminSetupRow } from './MAdminUi' +import MAdminPaddleRegionsPanel from './MAdminPaddleRegionsPanel' +import MMailIngestAdminCard from './MMailIngestAdminCard' +import type { FlightLiveOption } from '../../../components/Admin/AddonManager' import MHintLabel from '../../components/MHintLabel' import WandererMark from '../../../components/Tours/wanderer/WandererMark' import MSkeleton from '../../components/MSkeleton' @@ -59,7 +62,16 @@ function AddonIcon({ name, size = 18, enabled = true }: AddonIconProps) { return } -export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTracking, collabFeatures, onToggleCollabFeature }: { bagTrackingEnabled?: boolean; onToggleBagTracking?: () => void; collabFeatures?: CollabFeatures; onToggleCollabFeature?: (key: string) => void }) { +export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTracking, collabFeatures, onToggleCollabFeature, flightLive, mailImport = false }: { + bagTrackingEnabled?: boolean + onToggleBagTracking?: () => void + collabFeatures?: CollabFeatures + onToggleCollabFeature?: (key: string) => void + /** Live flight status, a row of the trip group (desktop parity). */ + flightLive?: FlightLiveOption + /** Booking mail import, a row of the integration group with its setup sheet; off on a managed install. */ + mailImport?: boolean +}) { const { t } = useTranslation() const dark = useIsDark() const { @@ -98,7 +110,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac ) : ( <> {/* Trip Addons */} - {tripAddons.length > 0 && ( + {(tripAddons.length > 0 || flightLive) && ( {tripAddons.map((addon, i) => ( @@ -135,6 +147,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac onToggle={() => void toggle()} /> ))} + )} {addon.id === 'collab' && addon.enabled && collabFeatures && onToggleCollabFeature && ( @@ -153,6 +166,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac )} ))} + {flightLive && } )} @@ -171,13 +185,14 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac )} {/* Integration Addons, headed by the AI ones as one group, as on the desktop */} - {(integrationAddons.length > 0 || aiAddons.length > 0) && ( + {(integrationAddons.length > 0 || aiAddons.length > 0 || mailImport) && ( {aiAddons.length > 0 && } {integrationAddons.map((addon, i) => ( ))} + {mailImport && } )} @@ -216,16 +231,28 @@ interface MAddonRowProps { function MAddonRow({ addon, onToggle, t, first }: MAddonRowProps) { const label = getAddonLabel(t, addon) return ( -
    - {/* overflow-hidden so a brand mark that fills the slot keeps its rounded corners. */} - - - -
    - -
    - onToggle(addon)} /> -
    + } + title={label.name} + hint={label.description} + first={first} + trailing={ onToggle(addon)} />} + /> + ) +} + +/** Live flight status as a trip row, locked with a word when the server environment holds it. */ +function MFlightLiveRow({ option, first }: { option: FlightLiveOption; first: boolean }) { + const { t } = useTranslation() + const hint = option.managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint') + return ( + } + title={t('flightLive.adminTitle')} + hint={option.locked ? `${hint} ${t('flightLive.envLocked')}` : hint} + first={first} + trailing={} + /> ) } @@ -301,17 +328,7 @@ function MAiAddons({ addons, onToggle }: { addons: Addon[]; onToggle: (addon: Ad /> ) })} - {tile.canSetUp && ( - - )} + {tile.canSetUp && } {tile.dialogOpen && } ) diff --git a/client/src/mobile/screens/admin/MAdminPaddleRegionsPanel.tsx b/client/src/mobile/screens/admin/MAdminPaddleRegionsPanel.tsx index 14f8fbba0..3bb0b8ad6 100644 --- a/client/src/mobile/screens/admin/MAdminPaddleRegionsPanel.tsx +++ b/client/src/mobile/screens/admin/MAdminPaddleRegionsPanel.tsx @@ -15,6 +15,7 @@ import { Waves, WifiOff, } from 'lucide-react'; +import { useState } from 'react'; import { AUTO_LOAD_MODES, autoLoadSizes, @@ -28,8 +29,9 @@ import { useTranslation } from '../../../i18n'; import { formatDisplayDate } from '../../../utils/dateFormat'; import MBadge from '../../components/MBadge'; import MChip from '../../components/MChip'; +import MSheet from '../../components/MSheet'; import MConfirmSheet from '../settings/MConfirmSheet'; -import { MAdminButton, MAdminCard, MAdminClampedText } from './MAdminUi'; +import { MAdminButton, MAdminClampedText, MAdminSetupRow, MAdminSheetFrame } from './MAdminUi'; type Admin = ReturnType; @@ -393,32 +395,49 @@ function Regions({ admin }: { admin: Admin }) { /** * PAD-05A/PAD-11C on the phone: the regions TREK reads paddle data for, how it - * loads a paddler's region by itself and the regions that wait for an admin. - * usePaddleRegionsAdmin is the desktop card's state; this is only the markup. + * loads a paddler's region by itself and the regions that wait for an admin, as + * a row under the Tours addon that opens them in a sheet. The row counts the + * open requests, else the regions. usePaddleRegionsAdmin is the desktop + * dialog's state; this is only the markup. */ export default function MAdminPaddleRegionsPanel() { const { t } = useTranslation(); const admin = usePaddleRegionsAdmin(); + const [open, setOpen] = useState(false); if (!admin.toursOn) return null; + const title = t('admin.paddleRegions.title'); + // A declined request no longer waits for anyone; only the open ones ask for a look. + const waiting = admin.requests.filter((r) => !r.declined).length; + const badge = + waiting > 0 ? ( + + {waiting} + + ) : admin.regions.length > 0 ? ( + {admin.regions.length} + ) : undefined; return ( - -
    - - - -
    -
    - - {t('admin.paddleRegions.title')} - - {admin.regions.length > 0 && {admin.regions.length}} -
    - - {t('admin.paddleRegions.hint')} - -
    -
    + <> + setOpen(true)} badge={badge} /> + {open && ( + setOpen(false)} variant="bottom" material="glass" ariaLabel={title}> + } title={title} onClose={() => setOpen(false)}> +

    + {t('admin.paddleRegions.hint')} +

    + +
    +
    + )} + + ); +} +/** What the sheet holds: the state of the list, the settings, the requests, the search and the regions. */ +function PanelBody({ admin }: { admin: Admin }) { + const { t } = useTranslation(); + return ( + <> {admin.offline && (

    - + ); } diff --git a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx index ecec506d7..65d4165a0 100644 --- a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx +++ b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx @@ -6,7 +6,6 @@ import type { useAdmin } from '../../../pages/admin/useAdmin' import MToggle from '../../components/MToggle' import { MBlockDisclosure, MProviderBlock, MTrekApiBlock } from './MApiProviderBlocks' import MAdminOidcCard from './MAdminOidcCard' -import MMailIngestAdminCard from './MMailIngestAdminCard' import MAdminGoogleDailyLimit from './MAdminGoogleDailyLimit' import MAdminPlaceContrib from './MAdminPlaceContrib' import MAdminServiceQuota from './MAdminServiceQuota' @@ -27,41 +26,22 @@ interface MAdminSettingsSectionProps { t: TranslationFn /** * Which section this renders, cut the way the desktop tabs are: who may sign - * in and what it takes (security), what the install talks to outside - * (services), and the setup of the features the addons switch on (features). + * in and what it takes (security) or what the install talks to outside + * (services). Live flight status and the booking mail import are rows of the + * addon groups (MAdminAddonManager). */ - part: 'security' | 'services' | 'features' + part: 'security' | 'services' } type PartProps = Omit -// The admin's security, services and feature setup sections as phone cards, +// The admin's security and services sections as phone cards, // one function each. All state and mutations come from useAdmin. export default function MAdminSettingsSection({ admin, t, part }: MAdminSettingsSectionProps) { - if (part === 'features') return if (part === 'security') return return } -/** Live flights and booking mails: how the integrations of the addons tab reach the world. */ -function FeaturesPart({ admin, t }: PartProps) { - const { managed, flightLive, setFlightLive, flightLiveLocked, handleToggleAuthSetting } = admin - return ( -

    - {/* Live flight status: open ADS-B data, no key, on by default (desktop parity). */} - void handleToggleAuthSetting('flight_live_enabled', v, setFlightLive)} - /> - {/* Booking mail import: self-hosted only, the operator runs the TREK Cloud relay (desktop parity). */} - {!managed && } -
    - ) -} - /** Who may sign in and what it takes, with the one destructive action last. */ function SecurityPart({ admin, t }: PartProps) { const { @@ -482,23 +462,3 @@ function ServicesPart({ admin, t }: PartProps) { ) } - -/** The live flight status switch, locked with a word when the server environment holds it. */ -function FlightLiveCard({ t, managed, on, locked, onChange }: { - t: TranslationFn - managed: boolean - on: boolean - locked: boolean - onChange: (on: boolean) => void -}) { - return ( - - - } - /> - - ) -} diff --git a/client/src/mobile/screens/admin/MAdminUi.tsx b/client/src/mobile/screens/admin/MAdminUi.tsx index 89d970488..135522595 100644 --- a/client/src/mobile/screens/admin/MAdminUi.tsx +++ b/client/src/mobile/screens/admin/MAdminUi.tsx @@ -1,5 +1,5 @@ import { InputHTMLAttributes, ReactNode, useState } from 'react' -import { ChevronDown, Eye, EyeOff, Loader2, X } from 'lucide-react' +import { ChevronDown, ChevronRight, Eye, EyeOff, Loader2, Settings2, X } from 'lucide-react' import { useTranslation } from '../../../i18n' import MIconBtn from '../../components/MIconBtn' import MHintLabel from '../../components/MHintLabel' @@ -61,6 +61,58 @@ export function MAdminRow({ ) } +/** + * A row of the addons screen: the icon tile, the name with its description + * behind the info mark, and the switch. Addons and the instance options that + * sit with them (live flight status, booking mails) share it. + */ +export function MAdminOptionRow({ + icon, + title, + hint, + trailing, + first = false, +}: { + icon: ReactNode + title: string + hint?: string + trailing: ReactNode + first?: boolean +}) { + return ( +
    + {/* overflow-hidden so a brand mark that fills the slot keeps its rounded corners. */} + + {icon} + +
    + +
    + {trailing} +
    + ) +} + +/** + * The last row under an addon that opens its settings: a gear, what it sets up, + * an optional badge for what waits inside, and a chevron (AI, booking mails, + * paddle water data). + */ +export function MAdminSetupRow({ label, onOpen, badge }: { label: string; onOpen: () => void; badge?: ReactNode }) { + return ( + + ) +} + /** * A description that keeps to two lines until it is tapped. On a phone the long * ones (a map provider's terms, how a loader decides) pushed every control off diff --git a/client/src/mobile/screens/admin/MMailIngestAdminCard.tsx b/client/src/mobile/screens/admin/MMailIngestAdminCard.tsx index 414e5c0f3..bd1633158 100644 --- a/client/src/mobile/screens/admin/MMailIngestAdminCard.tsx +++ b/client/src/mobile/screens/admin/MMailIngestAdminCard.tsx @@ -1,4 +1,5 @@ -import { Inbox, Upload, Webhook, type LucideIcon } from 'lucide-react'; +import { Inbox, Mail, Upload, Webhook, type LucideIcon } from 'lucide-react'; +import { useState } from 'react'; import { TRANSPORTS, problemText, @@ -15,15 +16,16 @@ import { useTranslation } from '../../../i18n'; import type { TranslationFn } from '../../../types'; import { relativeTime } from '../../../utils/relativeTime'; import MSegmented from '../../components/MSegmented'; +import MSheet from '../../components/MSheet'; import MToggle from '../../components/MToggle'; import { MAdminButton, - MAdminCard, - MAdminCardHead, MAdminField, MAdminInput, - MAdminRow, + MAdminOptionRow, MAdminSecretInput, + MAdminSetupRow, + MAdminSheetFrame, } from './MAdminUi'; interface PartProps { @@ -250,19 +252,23 @@ function Setup({ admin, form, t, locale }: PartProps & { locale: string }) { } /** - * The booking mail import in the phone's admin settings, the same card as on - * the desktop (useMailIngestAdmin): the switch, how mail arrives, the address - * template, the AI allowance, the test and the status. Self-hosted only. + * The booking mail import as a row of the phone's integration group, the same + * as on the desktop (useMailIngestAdmin): the switch, and while it is on a row + * to the sheet that sets it up (how mail arrives, the address template, the AI + * allowance, the test and the status). Self-hosted only. */ -export default function MMailIngestAdminCard() { +export default function MMailIngestAdminCard({ first = false }: { first?: boolean }) { const { t, locale } = useTranslation(); const admin = useMailIngestAdmin(true); + const [open, setOpen] = useState(false); + const setupLabel = t('mailAdmin.setup'); return ( - - - + } + title={t('mailAdmin.title')} + hint={`${t('mailAdmin.hint')} ${t('mailAdmin.enabledHint')}`} + first={first} trailing={ } /> - {admin.enabled && admin.form && } - + {admin.enabled && admin.form && setOpen(true)} />} + {open && admin.enabled && admin.form && ( + setOpen(false)} variant="bottom" material="glass" ariaLabel={setupLabel}> + } + title={setupLabel} + onClose={() => setOpen(false)} + > + + + + )} + ); } diff --git a/client/src/pages/AdminPage.test.tsx b/client/src/pages/AdminPage.test.tsx index 76386d99a..6335b133f 100644 --- a/client/src/pages/AdminPage.test.tsx +++ b/client/src/pages/AdminPage.test.tsx @@ -20,9 +20,6 @@ vi.mock('../components/Admin/BackupPanel', () => ({ vi.mock('../components/Admin/GitHubPanel', () => ({ default: () =>
    , })); -vi.mock('../components/Admin/paddle/PaddleRegionsPanel', () => ({ - default: () =>
    , -})); // AddonManager is stubbed but keeps its two callbacks reachable — the page owns // the optimistic toggle logic behind them. @@ -225,8 +222,6 @@ describe('AdminPage', () => { fireEvent.click(screen.getByRole('button', { name: /^addons$/i })); expect(screen.getByTestId('addon-manager')).toBeInTheDocument(); - // The paddle water data sit under the addons; the panel hides itself while Tours is off. - expect(screen.getByTestId('paddle-regions-panel')).toBeInTheDocument(); }); }); diff --git a/client/src/pages/AdminPage.tsx b/client/src/pages/AdminPage.tsx index a3a195052..bcb7bd0fe 100644 --- a/client/src/pages/AdminPage.tsx +++ b/client/src/pages/AdminPage.tsx @@ -1,5 +1,4 @@ import SchoolHolidayCatalog from '../components/Admin/SchoolHolidayCatalog' -import PaddleRegionsPanel from '../components/Admin/paddle/PaddleRegionsPanel' import React, { Fragment } from 'react' import DevNotificationsPanel from '../components/Admin/DevNotificationsPanel' import DefaultUserSettingsTab from '../components/Admin/DefaultUserSettingsTab' @@ -166,10 +165,17 @@ function AdminPageDesktop(): React.ReactElement { onToggleBagTracking={toggleBagTracking} collabFeatures={collabFeatures} onToggleCollabFeature={toggleCollabFeature} - // How the integrations reach the world: live flight status, booking mails. - aside={} + // Live flight status follows the trips' flights; the booking mail import is + // the operator's relay on a managed install. + flightLive={{ + on: admin.flightLive, + locked: admin.flightLiveLocked, + managed, + onToggle: () => + void admin.handleToggleAuthSetting('flight_live_enabled', !admin.flightLive, admin.setFlightLive), + }} + mailImport={!managed} /> -
    )} diff --git a/client/src/pages/admin/AdminSettingsTab.test.tsx b/client/src/pages/admin/AdminSettingsTab.test.tsx index 746024a01..a2815c44b 100644 --- a/client/src/pages/admin/AdminSettingsTab.test.tsx +++ b/client/src/pages/admin/AdminSettingsTab.test.tsx @@ -13,13 +13,12 @@ import AdminSettingsTab from './AdminSettingsTab'; type Spy = ReturnType; type Spies = Record & { toast: Record }; -/** The three tabs the settings are split into (security, services, features), on one page. */ +/** The two tabs the settings are split into (security, services), on one page. */ function AllParts({ admin, t }: { admin: AdminHook; t: ReturnType['t'] }) { return ( <> - ); } diff --git a/client/src/pages/admin/AdminSettingsTab.tsx b/client/src/pages/admin/AdminSettingsTab.tsx index 302e34781..1f05e6e3b 100644 --- a/client/src/pages/admin/AdminSettingsTab.tsx +++ b/client/src/pages/admin/AdminSettingsTab.tsx @@ -1,7 +1,7 @@ import React from 'react' import { AlertTriangle, CheckCircle, Compass, Eye, EyeOff, FileType, Fingerprint, KeyRound, Loader2, LockKeyhole, LogIn, - Plane, RefreshCw, Save, XCircle, + RefreshCw, Save, XCircle, } from 'lucide-react' import ToggleSwitch from '../../components/Settings/ToggleSwitch' import CustomSelect from '../../components/shared/CustomSelect' @@ -14,7 +14,6 @@ import GoogleOptions from './GoogleOptions' import GoogleDailyLimitRow from '../../components/Admin/GoogleDailyLimitRow' import ProviderBlock from './ProviderBlock' import TrekApiCard from './TrekApiCard' -import MailIngestAdminCard from '../../components/Admin/mailIngest/MailIngestAdminCard' import PlaceContribPanel from '../../components/Admin/PlaceContribPanel' import { useAdminSettingsActions } from '../../components/Admin/useAdminSettingsActions' import { placesGoogleOnlyHint } from '../../utils/placeSource' @@ -25,11 +24,10 @@ interface AdminSettingsTabProps { admin: ReturnType t: TranslationFn /** - * Which tab this renders: sign-in and its safety (security), what the - * install talks to outside (services), or the setup of the features the - * addons tab switches on (features). + * Which tab this renders: sign-in and its safety (security) or what the + * install talks to outside (services). */ - part: 'security' | 'services' | 'features' + part: 'security' | 'services' } /** @@ -126,7 +124,6 @@ export default function AdminSettingsTab({ admin, t, part }: AdminSettingsTabPro oidcConfig, setOidcConfig, savingOidc, passwordLogin, setPasswordLogin, passwordRegistration, setPasswordRegistration, oidcLogin, setOidcLogin, oidcRegistration, setOidcRegistration, oidcAutoRedirect, setOidcAutoRedirect, - flightLive, setFlightLive, flightLiveLocked, envOverrideOidcOnly, oidcConfigured, requireMfa, passkeyLogin, setPasskeyLogin, passkeyConfigured, webauthnRpId, setWebauthnRpId, webauthnOrigins, setWebauthnOrigins, savingWebauthn, handleSaveWebauthn, @@ -395,34 +392,6 @@ export default function AdminSettingsTab({ admin, t, part }: AdminSettingsTabPro )} ) - const flightCard = ( - <> - {/* Live flight status: open ADS-B data, no key, on by default; the admin may keep it off. */} - - - void handleToggleAuthSetting('flight_live_enabled', !flightLive, setFlightLive)} - /> - } - /> - - - - ) - const mailCard = ( - <> - {/* Booking mail import: how forwarded booking mails reach this install. On a managed - install the operator runs the TREK Cloud relay, so the card is not shown there. */} - {!managed && } - - ) const servicesCard = ( <> {/* Place search and routing: TREK's own services first, then which provider @@ -714,16 +683,9 @@ export default function AdminSettingsTab({ admin, t, part }: AdminSettingsTabPro ) // What used to be one "Settings" tab, split by what an admin comes for: - // who may sign in and how (security), what the install talks to outside - // (services), and how the features in the addons tab are set up there. - if (part === 'features') { - return ( - <> - {flightCard} - {mailCard} - - ) - } + // who may sign in and how (security) and what the install talks to outside + // (services). Live flight status and the booking mail import are rows of the + // addons tab's cards now. if (part === 'services') { // Place search and the services on the left, the keys and file types on the right. return ( diff --git a/client/tests/unit/mobile/admin/MAdmin.test.tsx b/client/tests/unit/mobile/admin/MAdmin.test.tsx index aa6db949f..089afaba0 100644 --- a/client/tests/unit/mobile/admin/MAdmin.test.tsx +++ b/client/tests/unit/mobile/admin/MAdmin.test.tsx @@ -61,9 +61,6 @@ vi.mock('../../../../src/mobile/screens/admin/MAdminStoragePanel', () => ({ })); // The addon manager is reduced to the two controls MAdmin wires itself. -vi.mock('../../../../src/mobile/screens/admin/MAdminPaddleRegionsPanel', () => ({ - default: () =>
    , -})); vi.mock('../../../../src/mobile/screens/admin/MAdminAddonManager', () => ({ default: ({ bagTrackingEnabled, @@ -232,7 +229,8 @@ describe('MAdmin', () => { expect(screen.getByTestId('category-manager')).toBeInTheDocument(); await openSection('Addons'); - expect(screen.getByTestId('paddle-regions-panel')).toBeInTheDocument(); + // The paddle water data, live flights and booking mails are rows inside the addon groups now. + expect(screen.getByTestId('bag-state')).toBeInTheDocument(); await openSection('Plugins'); expect(screen.getByTestId('plugins-panel')).toBeInTheDocument(); diff --git a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx index 376830158..3a3dba802 100644 --- a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx @@ -8,6 +8,7 @@ import { buildSettings } from '../../../helpers/factories'; import { useSettingsStore } from '../../../../src/store/settingsStore'; import { useAddonStore } from '../../../../src/store/addonStore'; import { ToastContainer } from '../../../../src/components/shared/Toast'; +import { mailIngestRepo } from '../../../../src/repo/mailIngestRepo'; import MAdminAddonManager from '../../../../src/mobile/screens/admin/MAdminAddonManager'; interface AddonFixture { @@ -571,4 +572,26 @@ describe('MAdminAddonManager', () => { await user.click(toggle); await waitFor(() => expect(puts).toEqual([{ enabled: true }])); }); + + it('FE-MOB-AADD-038: live flight status is a row of the trip group, switched there and locked by the environment', async () => { + server.use(addonsRoute([buildAddon({ id: 'packing', name: 'Lists', type: 'trip', enabled: true })])); + const onToggle = vi.fn(); + const { unmount } = render(); + await userEvent.click(await screen.findByRole('switch', { name: 'Follow booked flights live' })); + expect(onToggle).toHaveBeenCalledTimes(1); + unmount(); + + render(); + expect(await screen.findByRole('switch', { name: 'Follow booked flights live' })).toBeDisabled(); + }); + + it('FE-MOB-AADD-039: the booking mail import is a row of the integration group whose setup opens in a sheet', async () => { + server.use(addonsRoute([buildAddon({ id: 'mcp', name: 'MCP', icon: 'Terminal', type: 'integration', enabled: false })])); + vi.spyOn(mailIngestRepo, 'adminSettings').mockResolvedValue({ mail_ingest_enabled: 'true' }); + vi.spyOn(mailIngestRepo, 'adminStatus').mockRejectedValue(new Error('no status')); + render(); + expect(await screen.findByText('Booking mail import')).toBeInTheDocument(); + await userEvent.click(await screen.findByRole('button', { name: 'Set up mail import' })); + expect(await screen.findByText('How mail arrives')).toBeInTheDocument(); + }); }); diff --git a/client/tests/unit/mobile/admin/MAdminPaddleRegionsPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminPaddleRegionsPanel.test.tsx index 2186635ac..268b37217 100644 --- a/client/tests/unit/mobile/admin/MAdminPaddleRegionsPanel.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminPaddleRegionsPanel.test.tsx @@ -1,4 +1,4 @@ -// FE-MOB-APAD-001 to FE-MOB-APAD-010: the paddle regions card of the phone admin, drawn from a +// FE-MOB-APAD-001 to FE-MOB-APAD-011: the paddle regions row and sheet of the phone admin, drawn from a // controlled usePaddleRegionsAdmin (the hook has its own test). import type { PaddleRegion, PaddleRegionPending } from '@trek/shared'; import { describe, expect, it, vi } from 'vitest'; @@ -39,7 +39,7 @@ const REQUEST: PaddleRegionPending = { declined: false, } as PaddleRegionPending; -function show(overrides: Partial = {}, search: Partial = {}) { +function show(overrides: Partial = {}, search: Partial = {}, { open = true } = {}) { const state: Admin = { toursOn: true, offline: false, @@ -64,9 +64,16 @@ function show(overrides: Partial = {}, search: Partial = }; hook.usePaddleRegionsAdmin.mockReturnValue(state); render(); + // The row under Tours opens the sheet that holds everything below. + if (state.toursOn && open) fireEvent.click(setupRow()); return state; } +/** The row under the Tours addon that opens the sheet, with its count beside the title. */ +function setupRow(): HTMLElement { + return screen.getAllByRole('button', { name: /^Paddle water data/ })[0]; +} + describe('MAdminPaddleRegionsPanel', () => { it('FE-MOB-APAD-001: shows nothing while the Tours addon is off', () => { show({ toursOn: false }); @@ -164,4 +171,20 @@ describe('MAdminPaddleRegionsPanel', () => { fireEvent.click(within(question).getByRole('button', { name: 'Remove' })); expect(state.confirmRemove).toHaveBeenCalled(); }); + + it('FE-MOB-APAD-011: the row counts the open requests before the regions, and opens the sheet only when tapped', () => { + show( + { + regions: [region(), region({ id: 'saale', name: 'Saale' })], + requests: [REQUEST, { ...REQUEST, id: 'x', declined: true }], + }, + {}, + { open: false } + ); + expect(within(setupRow()).getByText('1')).toBeInTheDocument(); + expect(within(setupRow()).queryByText('2')).toBeNull(); + expect(screen.queryByTestId('paddle-region-row')).toBeNull(); + fireEvent.click(setupRow()); + expect(screen.getAllByTestId('paddle-region-row')).toHaveLength(2); + }); }); diff --git a/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx b/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx index f17c3f660..67b8a8ef0 100644 --- a/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx @@ -16,7 +16,7 @@ vi.mock('../../../../src/mobile/screens/admin/MAdminServiceQuota', () => ({ defa vi.mock('../../../../src/mobile/screens/admin/MAdminPlaceContrib', () => ({ default: () =>
    })); vi.mock('../../../../src/mobile/screens/admin/MAdminGoogleDailyLimit', () => ({ default: () =>
    })); -const PARTS = ['security', 'services', 'features'] as const; +const PARTS = ['security', 'services'] as const; /** All three sections at once, so each card's behaviour is tested wherever it now lives. */ function AllParts({ admin, t }: { admin: AdminHook; t: ReturnType['t'] }) { @@ -114,12 +114,9 @@ describe('MAdminSettingsSection', () => { expect(screen.getByText('API Keys')).toBeInTheDocument(); expect(screen.getAllByText('Allowed File Types').length).toBeGreaterThan(0); expect(screen.queryByText('Authentication Methods')).not.toBeInTheDocument(); + // Live flight status is a row of the addons' trip group now, in neither section. + expect(screen.queryByText('Live flight status')).not.toBeInTheDocument(); services.unmount(); - - render(); - expect(screen.getByText('Live flight status')).toBeInTheDocument(); - expect(screen.queryByText('API Keys')).not.toBeInTheDocument(); - expect(screen.queryByText('Danger Zone')).not.toBeInTheDocument(); }); it('FE-MOB-ASET-026: a managed install keeps the danger zone and the passkey domain to its operator', () => { diff --git a/shared/src/i18n/ar/mailAdmin.ts b/shared/src/i18n/ar/mailAdmin.ts index 31129e691..4d583b744 100644 --- a/shared/src/i18n/ar/mailAdmin.ts +++ b/shared/src/i18n/ar/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'استيراد رسائل الحجز', 'mailAdmin.hint': 'تتحول رسائل تأكيد الحجز المُعاد توجيهها إلى حجوزات في الرحلة المناسبة.', + 'mailAdmin.setup': 'إعداد استيراد البريد', 'mailAdmin.enabled': 'استيراد رسائل الحجز', 'mailAdmin.enabledHint': 'يمنح كل مستخدم في هذا التثبيت عنوان إعادة توجيه. عند الإيقاف، لا يستقبل أي عنوان بريداً.', 'mailAdmin.transport.label': 'كيفية وصول البريد', diff --git a/shared/src/i18n/az/mailAdmin.ts b/shared/src/i18n/az/mailAdmin.ts index 5d7953039..dd6f49074 100644 --- a/shared/src/i18n/az/mailAdmin.ts +++ b/shared/src/i18n/az/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Rezervasiya məktublarının idxalı', 'mailAdmin.hint': 'Yönləndirilən rezervasiya təsdiqləri düzgün səyahətdə rezervasiyaya çevrilir.', + 'mailAdmin.setup': 'Məktub idxalını qur', 'mailAdmin.enabled': 'Rezervasiya məktublarını idxal et', 'mailAdmin.enabledHint': 'Bu quraşdırmadakı hər kəsə yönləndirmə ünvanı verir. Deaktiv olduqda heç bir ünvan məktub qəbul etmir.', diff --git a/shared/src/i18n/br/mailAdmin.ts b/shared/src/i18n/br/mailAdmin.ts index ed48cb4a6..b961ff5b6 100644 --- a/shared/src/i18n/br/mailAdmin.ts +++ b/shared/src/i18n/br/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Importação de e-mails de reserva', 'mailAdmin.hint': 'As confirmações de reserva encaminhadas viram reservas na viagem certa.', + 'mailAdmin.setup': 'Configurar importação de e-mails', 'mailAdmin.enabled': 'Importar e-mails de reserva', 'mailAdmin.enabledHint': 'Dá a todos nesta instalação um endereço de encaminhamento. Desativado, nenhum endereço recebe e-mails.', diff --git a/shared/src/i18n/ca/mailAdmin.ts b/shared/src/i18n/ca/mailAdmin.ts index d3fd9dbf0..17dd66efc 100644 --- a/shared/src/i18n/ca/mailAdmin.ts +++ b/shared/src/i18n/ca/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Importació de correus de reserva', 'mailAdmin.hint': 'Les confirmacions de reserva reenviades es converteixen en reserves del viatge correcte.', + 'mailAdmin.setup': 'Configura la importació de correus', 'mailAdmin.enabled': 'Importa correus de reserva', 'mailAdmin.enabledHint': 'Dona a tothom en aquesta instal·lació una adreça de reenviament. Desactivat, cap adreça rep correu.', diff --git a/shared/src/i18n/cs/mailAdmin.ts b/shared/src/i18n/cs/mailAdmin.ts index 861a4ff52..d0b959cf8 100644 --- a/shared/src/i18n/cs/mailAdmin.ts +++ b/shared/src/i18n/cs/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import e-mailů s rezervacemi', 'mailAdmin.hint': 'Přeposlaná potvrzení rezervací se stanou rezervacemi ve správném výletu.', + 'mailAdmin.setup': 'Nastavit import e-mailů', 'mailAdmin.enabled': 'Importovat e-maily s rezervacemi', 'mailAdmin.enabledHint': 'Dá každému na této instalaci adresu pro přeposílání. Při vypnutí žádná adresa nepřijímá poštu.', diff --git a/shared/src/i18n/de/mailAdmin.ts b/shared/src/i18n/de/mailAdmin.ts index f50c8ce59..c7ad8b43d 100644 --- a/shared/src/i18n/de/mailAdmin.ts +++ b/shared/src/i18n/de/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Buchungsmail-Import', 'mailAdmin.hint': 'Weitergeleitete Buchungsbestätigungen werden zu Buchungen in der passenden Reise.', + 'mailAdmin.setup': 'Mail-Import einrichten', 'mailAdmin.enabled': 'Buchungsmails importieren', 'mailAdmin.enabledHint': 'Gibt allen auf dieser Instanz eine Weiterleitungsadresse. Aus, nimmt keine Adresse Mails an.', diff --git a/shared/src/i18n/en/mailAdmin.ts b/shared/src/i18n/en/mailAdmin.ts index 9933cd773..39288ca5d 100644 --- a/shared/src/i18n/en/mailAdmin.ts +++ b/shared/src/i18n/en/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Booking mail import', 'mailAdmin.hint': 'Forwarded booking confirmations become bookings in the right trip.', + 'mailAdmin.setup': 'Set up mail import', 'mailAdmin.enabled': 'Import booking mails', 'mailAdmin.enabledHint': 'Gives everyone on this install a forwarding address. Off, no address takes mail.', 'mailAdmin.transport.label': 'How mail arrives', diff --git a/shared/src/i18n/es/mailAdmin.ts b/shared/src/i18n/es/mailAdmin.ts index 70ce9cc1b..6426e8938 100644 --- a/shared/src/i18n/es/mailAdmin.ts +++ b/shared/src/i18n/es/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Importación de correos de reserva', 'mailAdmin.hint': 'Las confirmaciones de reserva reenviadas se convierten en reservas del viaje correcto.', + 'mailAdmin.setup': 'Configurar la importación de correos', 'mailAdmin.enabled': 'Importar correos de reserva', 'mailAdmin.enabledHint': 'Da a todos los usuarios de esta instalación una dirección de reenvío. Desactivado, ninguna dirección recibe correo.', diff --git a/shared/src/i18n/et/mailAdmin.ts b/shared/src/i18n/et/mailAdmin.ts index 0ca231879..b0375f2f8 100644 --- a/shared/src/i18n/et/mailAdmin.ts +++ b/shared/src/i18n/et/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Broneeringukirjade import', 'mailAdmin.hint': 'Edastatud broneeringute kinnitustest saavad broneeringud õigel reisil.', + 'mailAdmin.setup': 'Seadista kirjade import', 'mailAdmin.enabled': 'Impordi broneeringukirjad', 'mailAdmin.enabledHint': 'Annab igaühele selles paigalduses edastusaadressi. Väljalülitatuna ei võta ükski aadress kirju vastu.', diff --git a/shared/src/i18n/fr/mailAdmin.ts b/shared/src/i18n/fr/mailAdmin.ts index f4e680020..d2740140f 100644 --- a/shared/src/i18n/fr/mailAdmin.ts +++ b/shared/src/i18n/fr/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import des e-mails de réservation', 'mailAdmin.hint': 'Les confirmations de réservation transférées deviennent des réservations dans le bon voyage.', + 'mailAdmin.setup': 'Configurer l’import des e-mails', 'mailAdmin.enabled': 'Importer les e-mails de réservation', 'mailAdmin.enabledHint': 'Donne à chaque utilisateur de cette installation une adresse de transfert. Désactivé, aucune adresse ne reçoit d’e-mails.', diff --git a/shared/src/i18n/gr/mailAdmin.ts b/shared/src/i18n/gr/mailAdmin.ts index 002841f9f..5a47903b1 100644 --- a/shared/src/i18n/gr/mailAdmin.ts +++ b/shared/src/i18n/gr/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Εισαγωγή email κρατήσεων', 'mailAdmin.hint': 'Οι προωθημένες επιβεβαιώσεις κράτησης γίνονται κρατήσεις στο σωστό ταξίδι.', + 'mailAdmin.setup': 'Ρύθμιση εισαγωγής email', 'mailAdmin.enabled': 'Εισαγωγή email κρατήσεων', 'mailAdmin.enabledHint': 'Δίνει σε όλους σε αυτή την εγκατάσταση μια διεύθυνση προώθησης. Όταν είναι ανενεργό, καμία διεύθυνση δεν δέχεται email.', diff --git a/shared/src/i18n/he/mailAdmin.ts b/shared/src/i18n/he/mailAdmin.ts index df6f9682f..03576a051 100644 --- a/shared/src/i18n/he/mailAdmin.ts +++ b/shared/src/i18n/he/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'ייבוא דוא״ל הזמנות', 'mailAdmin.hint': 'אישורי הזמנה שהועברו הופכים להזמנות בטיול המתאים.', + 'mailAdmin.setup': 'הגדרת ייבוא דוא״ל', 'mailAdmin.enabled': 'ייבוא דוא״ל הזמנות', 'mailAdmin.enabledHint': 'נותן לכל משתמש בהתקנה הזו כתובת להעברה. כשהאפשרות כבויה, אף כתובת לא מקבלת דוא״ל.', 'mailAdmin.transport.label': 'איך הדוא״ל מגיע', diff --git a/shared/src/i18n/hu/mailAdmin.ts b/shared/src/i18n/hu/mailAdmin.ts index 8fb113a93..6f55ddef4 100644 --- a/shared/src/i18n/hu/mailAdmin.ts +++ b/shared/src/i18n/hu/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Foglalási e-mailek importja', 'mailAdmin.hint': 'A továbbított foglalási visszaigazolásokból foglalás lesz a megfelelő utazásban.', + 'mailAdmin.setup': 'E-mail-import beállítása', 'mailAdmin.enabled': 'Foglalási e-mailek importálása', 'mailAdmin.enabledHint': 'Mindenkinek ad egy továbbítási címet ezen a telepítésen. Kikapcsolva egyik cím sem fogad levelet.', diff --git a/shared/src/i18n/id/mailAdmin.ts b/shared/src/i18n/id/mailAdmin.ts index 5645f51d9..f25159798 100644 --- a/shared/src/i18n/id/mailAdmin.ts +++ b/shared/src/i18n/id/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Impor email pemesanan', 'mailAdmin.hint': 'Konfirmasi pemesanan yang diteruskan menjadi pemesanan di perjalanan yang tepat.', + 'mailAdmin.setup': 'Atur impor email', 'mailAdmin.enabled': 'Impor email pemesanan', 'mailAdmin.enabledHint': 'Memberi semua orang di instalasi ini alamat penerusan. Jika nonaktif, tidak ada alamat yang menerima email.', diff --git a/shared/src/i18n/it/mailAdmin.ts b/shared/src/i18n/it/mailAdmin.ts index 5f6072173..8b55a78ff 100644 --- a/shared/src/i18n/it/mailAdmin.ts +++ b/shared/src/i18n/it/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Importazione delle e-mail di prenotazione', 'mailAdmin.hint': 'Le conferme di prenotazione inoltrate diventano prenotazioni nel viaggio giusto.', + 'mailAdmin.setup': 'Configura l’importazione delle e-mail', 'mailAdmin.enabled': 'Importa e-mail di prenotazione', 'mailAdmin.enabledHint': 'Dà a tutti su questa installazione un indirizzo di inoltro. Disattivato, nessun indirizzo riceve posta.', diff --git a/shared/src/i18n/ja/mailAdmin.ts b/shared/src/i18n/ja/mailAdmin.ts index 9ce20b253..df5bcff3d 100644 --- a/shared/src/i18n/ja/mailAdmin.ts +++ b/shared/src/i18n/ja/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': '予約メールの取り込み', 'mailAdmin.hint': '転送された予約確認メールが、適切な旅行の予約になります。', + 'mailAdmin.setup': 'メール取り込みを設定', 'mailAdmin.enabled': '予約メールを取り込む', 'mailAdmin.enabledHint': 'このインストールの全員に転送用アドレスを発行します。オフの間は、どのアドレスもメールを受け付けません。', diff --git a/shared/src/i18n/ko/mailAdmin.ts b/shared/src/i18n/ko/mailAdmin.ts index b258a96b3..867363745 100644 --- a/shared/src/i18n/ko/mailAdmin.ts +++ b/shared/src/i18n/ko/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': '예약 메일 가져오기', 'mailAdmin.hint': '전달된 예약 확인 메일이 알맞은 여행의 예약이 됩니다.', + 'mailAdmin.setup': '메일 가져오기 설정', 'mailAdmin.enabled': '예약 메일 가져오기', 'mailAdmin.enabledHint': '이 설치의 모든 사용자에게 전달용 주소를 제공합니다. 끄면 어떤 주소도 메일을 받지 않습니다.', 'mailAdmin.transport.label': '메일 수신 방식', diff --git a/shared/src/i18n/nl/mailAdmin.ts b/shared/src/i18n/nl/mailAdmin.ts index 37830c999..5b2bc9eab 100644 --- a/shared/src/i18n/nl/mailAdmin.ts +++ b/shared/src/i18n/nl/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import van boekingsmails', 'mailAdmin.hint': 'Doorgestuurde boekingsbevestigingen worden boekingen in de juiste reis.', + 'mailAdmin.setup': 'Mailimport instellen', 'mailAdmin.enabled': 'Boekingsmails importeren', 'mailAdmin.enabledHint': 'Geeft iedereen op deze installatie een doorstuuradres. Uit: geen enkel adres neemt mail aan.', diff --git a/shared/src/i18n/pl/mailAdmin.ts b/shared/src/i18n/pl/mailAdmin.ts index 7a9a21d4a..8bac647fe 100644 --- a/shared/src/i18n/pl/mailAdmin.ts +++ b/shared/src/i18n/pl/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import wiadomości z rezerwacjami', 'mailAdmin.hint': 'Przekazane potwierdzenia rezerwacji stają się rezerwacjami we właściwej podróży.', + 'mailAdmin.setup': 'Skonfiguruj import wiadomości', 'mailAdmin.enabled': 'Importuj wiadomości z rezerwacjami', 'mailAdmin.enabledHint': 'Daje każdemu użytkownikowi tej instalacji adres do przekazywania. Po wyłączeniu żaden adres nie przyjmuje poczty.', diff --git a/shared/src/i18n/ru/mailAdmin.ts b/shared/src/i18n/ru/mailAdmin.ts index 27a6fd767..4a1ec065c 100644 --- a/shared/src/i18n/ru/mailAdmin.ts +++ b/shared/src/i18n/ru/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Импорт писем с бронированиями', 'mailAdmin.hint': 'Пересланные подтверждения бронирований становятся бронированиями в нужной поездке.', + 'mailAdmin.setup': 'Настроить импорт писем', 'mailAdmin.enabled': 'Импортировать письма с бронированиями', 'mailAdmin.enabledHint': 'Даёт каждому пользователю этой установки адрес для пересылки. Если выключено, ни один адрес не принимает почту.', diff --git a/shared/src/i18n/sk/mailAdmin.ts b/shared/src/i18n/sk/mailAdmin.ts index 0a028a9ea..c9249c370 100644 --- a/shared/src/i18n/sk/mailAdmin.ts +++ b/shared/src/i18n/sk/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import e-mailov s rezerváciami', 'mailAdmin.hint': 'Preposlané potvrdenia rezervácií sa stanú rezerváciami v správnom výlete.', + 'mailAdmin.setup': 'Nastaviť import e-mailov', 'mailAdmin.enabled': 'Importovať e-maily s rezerváciami', 'mailAdmin.enabledHint': 'Dá každému na tejto inštalácii adresu na preposielanie. Pri vypnutí žiadna adresa neprijíma poštu.', diff --git a/shared/src/i18n/sv/mailAdmin.ts b/shared/src/i18n/sv/mailAdmin.ts index ae33381b0..c4da06df5 100644 --- a/shared/src/i18n/sv/mailAdmin.ts +++ b/shared/src/i18n/sv/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Import av bokningsmejl', 'mailAdmin.hint': 'Vidarebefordrade bokningsbekräftelser blir bokningar i rätt resa.', + 'mailAdmin.setup': 'Konfigurera mejlimport', 'mailAdmin.enabled': 'Importera bokningsmejl', 'mailAdmin.enabledHint': 'Ger alla på den här installationen en vidarebefordringsadress. När det är av tar ingen adress emot mejl.', diff --git a/shared/src/i18n/th/mailAdmin.ts b/shared/src/i18n/th/mailAdmin.ts index 80e12c003..53544987d 100644 --- a/shared/src/i18n/th/mailAdmin.ts +++ b/shared/src/i18n/th/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'การนำเข้าอีเมลการจอง', 'mailAdmin.hint': 'อีเมลยืนยันการจองที่ส่งต่อมาจะกลายเป็นการจองในทริปที่ถูกต้อง', + 'mailAdmin.setup': 'ตั้งค่าการนำเข้าอีเมล', 'mailAdmin.enabled': 'นำเข้าอีเมลการจอง', 'mailAdmin.enabledHint': 'ให้ทุกคนในการติดตั้งนี้มีที่อยู่สำหรับส่งต่อ เมื่อปิด จะไม่มีที่อยู่ใดรับอีเมล', 'mailAdmin.transport.label': 'วิธีรับอีเมล', diff --git a/shared/src/i18n/tr/mailAdmin.ts b/shared/src/i18n/tr/mailAdmin.ts index 1fb488abb..91bfa81f9 100644 --- a/shared/src/i18n/tr/mailAdmin.ts +++ b/shared/src/i18n/tr/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Rezervasyon e-postası içe aktarma', 'mailAdmin.hint': 'Yönlendirilen rezervasyon onayları doğru seyahatte rezervasyona dönüşür.', + 'mailAdmin.setup': 'E-posta içe aktarmayı ayarla', 'mailAdmin.enabled': 'Rezervasyon e-postalarını içe aktar', 'mailAdmin.enabledHint': 'Bu kurulumdaki herkese bir yönlendirme adresi verir. Kapalıyken hiçbir adres e-posta kabul etmez.', diff --git a/shared/src/i18n/uk/mailAdmin.ts b/shared/src/i18n/uk/mailAdmin.ts index 4fb550db5..acf04a80e 100644 --- a/shared/src/i18n/uk/mailAdmin.ts +++ b/shared/src/i18n/uk/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Імпорт листів із бронюваннями', 'mailAdmin.hint': 'Переслані підтвердження бронювань стають бронюваннями в потрібній подорожі.', + 'mailAdmin.setup': 'Налаштувати імпорт листів', 'mailAdmin.enabled': 'Імпортувати листи з бронюваннями', 'mailAdmin.enabledHint': 'Дає кожному користувачу цієї інсталяції адресу для пересилання. Якщо вимкнено, жодна адреса не приймає пошту.', diff --git a/shared/src/i18n/vi/mailAdmin.ts b/shared/src/i18n/vi/mailAdmin.ts index 32724032e..f30b45354 100644 --- a/shared/src/i18n/vi/mailAdmin.ts +++ b/shared/src/i18n/vi/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': 'Nhập email đặt chỗ', 'mailAdmin.hint': 'Email xác nhận đặt chỗ được chuyển tiếp sẽ trở thành đặt chỗ trong đúng chuyến đi.', + 'mailAdmin.setup': 'Thiết lập nhập email', 'mailAdmin.enabled': 'Nhập email đặt chỗ', 'mailAdmin.enabledHint': 'Cấp cho mọi người trên bản cài đặt này một địa chỉ chuyển tiếp. Khi tắt, không địa chỉ nào nhận email.', diff --git a/shared/src/i18n/zh-TW/mailAdmin.ts b/shared/src/i18n/zh-TW/mailAdmin.ts index 0e78aaac5..d17284e05 100644 --- a/shared/src/i18n/zh-TW/mailAdmin.ts +++ b/shared/src/i18n/zh-TW/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': '預訂郵件匯入', 'mailAdmin.hint': '轉寄的預訂確認郵件會變成正確旅行中的預訂。', + 'mailAdmin.setup': '設定郵件匯入', 'mailAdmin.enabled': '匯入預訂郵件', 'mailAdmin.enabledHint': '為此執行個體上的每個人提供一個轉寄地址。關閉後,任何地址都不接收郵件。', 'mailAdmin.transport.label': '郵件送達方式', diff --git a/shared/src/i18n/zh/mailAdmin.ts b/shared/src/i18n/zh/mailAdmin.ts index cdc8cf78c..fb42261f5 100644 --- a/shared/src/i18n/zh/mailAdmin.ts +++ b/shared/src/i18n/zh/mailAdmin.ts @@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types'; const mailAdmin: TranslationStrings = { 'mailAdmin.title': '预订邮件导入', 'mailAdmin.hint': '转发的预订确认邮件会变成正确旅行中的预订。', + 'mailAdmin.setup': '设置邮件导入', 'mailAdmin.enabled': '导入预订邮件', 'mailAdmin.enabledHint': '为此实例上的每个人提供一个转发地址。关闭后,任何地址都不接收邮件。', 'mailAdmin.transport.label': '邮件送达方式',