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.
This commit is contained in:
Maurice
2026-11-21 00:23:13 +01:00
parent 6ebd5cf0c7
commit 711015d5fd
52 changed files with 596 additions and 263 deletions
+1 -1
View File
@@ -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"]
},
{
+1 -1
View File
@@ -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,
@@ -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(<AddonManager flightLive={{ on: false, locked: false, managed: false, onToggle }} />);
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(<AddonManager flightLive={{ on: true, locked: true, managed: false, onToggle }} />);
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(<AddonManager mailImport />);
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(<AddonManager />);
await screen.findByRole('heading', { name: 'Integration' });
expect(screen.queryByText('Booking mail import')).not.toBeInTheDocument();
expect(load).not.toHaveBeenCalled();
});
});
+47 -8
View File
@@ -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<string, { icon: ComponentType<{ size?: number }>; 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.
<PaddleRegionsPanel key="paddle-regions" />,
]
}
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 (
<SettingsCard
@@ -235,6 +254,10 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking,
{/* The AI addons share a connection and a settings dialog, so they head the card as one tile. */}
{ai && <AiAddonTile addons={aiAddons} onToggle={handleToggle} />}
{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 && <FlightLiveTile option={flightLive} />}
{g.key === 'integration' && mailImport && <MailIngestAddonTile />}
</div>
</SettingsCard>
)
@@ -251,5 +274,21 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking,
)
}
return <SettingsColumns start={cards.start} end={<>{cards.end}{aside}</>} />
return <SettingsColumns start={cards.start} end={cards.end} />
}
/** 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 (
<AddonTile
icon={<Radar size={18} />}
name={name}
description={option.locked ? `${hint} ${t('flightLive.envLocked')}` : hint}
enabled={option.on}
trailing={<ToggleSwitch on={option.on} label={t('flightLive.adminToggle')} disabled={option.locked} onToggle={option.onToggle} />}
/>
)
}
@@ -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 (
<DialogShell
onClose={onClose}
labelledBy={labelId}
width="detail"
blocked={blocked}
header={
<DialogHeader
tile={<DialogTile>{icon}</DialogTile>}
tint={NEUTRAL_TINT}
labelId={labelId}
eyebrow={eyebrow}
title={title}
sub={sub}
subWraps
onClose={onClose}
/>
}
footer={
<DialogFooter>
<FooterSpacer />
<DialogButton variant="primary" onClick={onClose}>
{t('common.close')}
</DialogButton>
</DialogFooter>
}
>
{children}
</DialogShell>
);
}
@@ -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 (
<li>
<button
type="button"
onClick={onOpen}
className="flex min-h-[44px] w-full items-center gap-2.5 border-0 bg-transparent py-1.5 pe-4 ps-[60px] text-start transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover focus-visible:outline-none"
>
<span className="grid h-6 w-6 flex-none place-items-center text-content-muted">
<Settings2 size={14} />
</span>
<span className="min-w-0 flex-1 truncate font-medium text-content" style={fs(12.5, 'body')}>
{label}
</span>
{badge}
<ChevronRight size={15} strokeWidth={2.2} className="flex-none text-content-faint rtl:rotate-180" />
</button>
</li>
);
}
@@ -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 && (
<li>
<button
type="button"
onClick={tile.openDialog}
className="flex min-h-[44px] w-full items-center gap-2.5 border-0 bg-transparent py-1.5 pe-4 ps-[60px] text-start transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover focus-visible:outline-none"
>
<span className="grid h-6 w-6 flex-none place-items-center text-content-muted">
<Settings2 size={14} />
</span>
<span className="min-w-0 flex-1 truncate font-medium text-content" style={fs(12.5, 'body')}>
{t('admin.addons.ai.setup')}
</span>
<ChevronRight size={15} strokeWidth={2.2} className="flex-none text-content-faint rtl:rotate-180" />
</button>
</li>
)}
{tile.canSetUp && <AddonSetupRow label={t('admin.addons.ai.setup')} onOpen={tile.openDialog} />}
</AddonTile>
{tile.dialogOpen && <AiSettingsDialog addons={addons} onClose={tile.closeDialog} />}
</>
@@ -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 (
<SettingsCard icon={Mail} title={t('mailAdmin.title')} hint={t('mailAdmin.hint')}>
<SettingRows>
<SettingRow
label={t('mailAdmin.enabled')}
hint={t('mailAdmin.enabledHint')}
control={
<ToggleSwitch
on={admin.enabled}
label={t('mailAdmin.enabled')}
disabled={!admin.loaded}
onToggle={() => admin.toggle(!admin.enabled)}
/>
}
/>
</SettingRows>
{admin.enabled && admin.form && <Setup admin={admin} form={admin.form} t={t} locale={locale} />}
</SettingsCard>
<>
<AddonTile
icon={<Mail size={15} />}
name={name}
description={`${t('mailAdmin.hint')} ${t('mailAdmin.enabledHint')}`}
enabled={admin.enabled}
trailing={
<ToggleSwitch
on={admin.enabled}
label={t('mailAdmin.enabled')}
disabled={!admin.loaded}
onToggle={() => admin.toggle(!admin.enabled)}
/>
}
>
{admin.enabled && admin.form && <AddonSetupRow label={t('mailAdmin.setup')} onOpen={() => setOpen(true)} />}
</AddonTile>
{open && admin.enabled && admin.form && (
<AddonSetupDialog
icon={<Mail size={20} strokeWidth={2} />}
eyebrow={name}
title={t('mailAdmin.setup')}
sub={t('mailAdmin.hint')}
onClose={() => setOpen(false)}
>
<Setup admin={admin} form={admin.form} t={t} locale={locale} />
</AddonSetupDialog>
)}
</>
);
}
@@ -78,17 +78,22 @@ function adminState(overrides: Partial<Admin> = {}, search: Partial<Admin['searc
};
}
function show(overrides: Partial<Admin> = {}, search: Partial<Admin['search']> = {}) {
/** The panel as the Tours shelf shows it: a setup row, opened into its dialog unless asked not to. */
function show(overrides: Partial<Admin> = {}, search: Partial<Admin['search']> = {}, { open = true } = {}) {
const state = adminState(overrides, search);
hook.usePaddleRegionsAdmin.mockReturnValue(state);
return { state, ...render(<PaddleRegionsPanel />) };
const view = render(
<ul>
<PaddleRegionsPanel />
</ul>
);
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.';
@@ -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<typeof usePaddleRegionsAdmin>;
* 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 ? (
<StatusPill tone="warning">{waiting}</StatusPill>
) : admin.regions.length > 0 ? (
<StatusPill>{admin.regions.length}</StatusPill>
) : undefined;
const close = () => setOpen(false);
return (
<SettingsCard
icon={Waves}
title={t('admin.paddleRegions.title')}
hint={t('admin.paddleRegions.hint')}
badge={admin.regions.length > 0 ? <StatusPill>{admin.regions.length}</StatusPill> : undefined}
>
<>
<AddonSetupRow label={title} onOpen={() => setOpen(true)} badge={badge} />
{open && (
<AddonSetupDialog
icon={<Waves size={20} strokeWidth={2} />}
eyebrow={t('admin.addons.catalog.tours.name')}
title={title}
sub={t('admin.paddleRegions.hint')}
onClose={close}
blocked={admin.removing !== null}
>
<PanelBody admin={admin} />
</AddonSetupDialog>
)}
</>
);
}
/** 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 (
<div className="flex flex-col gap-4">
{admin.offline && (
<p
role="status"
@@ -86,7 +117,7 @@ function Panel() {
message={t('admin.paddleRegions.removeMessage', { name: admin.removing?.name ?? '' })}
confirmLabel={t('common.remove')}
/>
</SettingsCard>
</div>
);
}
+10 -4
View File
@@ -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. */}
<MAdminSettingsSection admin={admin} t={t} part="features" />
<MAdminPaddleRegionsPanel />
</div>
)}
{activeTab === 'plugins' && <MAdminPluginsPanel />}
@@ -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 <Icon size={size} />
}
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) && (
<MAdminCard>
<MGroupHead icon={Briefcase} label={t('admin.addons.type.trip')} hint={t('admin.addons.tripHint')} />
{tripAddons.map((addon, i) => (
@@ -135,6 +147,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac
onToggle={() => void toggle()}
/>
))}
<MAdminPaddleRegionsPanel />
</>
)}
{addon.id === 'collab' && addon.enabled && collabFeatures && onToggleCollabFeature && (
@@ -153,6 +166,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac
)}
</div>
))}
{flightLive && <MFlightLiveRow option={flightLive} first={tripAddons.length === 0} />}
</MAdminCard>
)}
@@ -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) && (
<MAdminCard>
<MGroupHead icon={Link2} label={t('admin.addons.type.integration')} hint={t('admin.addons.integrationHint')} />
{aiAddons.length > 0 && <MAiAddons addons={aiAddons} onToggle={handleToggle} />}
{integrationAddons.map((addon, i) => (
<MAddonRow key={addon.id} addon={addon} onToggle={handleToggle} t={t} first={i === 0 && aiAddons.length === 0} />
))}
{mailImport && <MMailIngestAdminCard first={integrationAddons.length === 0 && aiAddons.length === 0} />}
</MAdminCard>
)}
</>
@@ -216,16 +231,28 @@ interface MAddonRowProps {
function MAddonRow({ addon, onToggle, t, first }: MAddonRowProps) {
const label = getAddonLabel(t, addon)
return (
<div className={`flex items-center gap-3 py-[11px] ${first ? '' : 'border-t border-[color:var(--m-rowbr)]'}`}>
{/* overflow-hidden so a brand mark that fills the slot keeps its rounded corners. */}
<span className="flex h-[38px] w-[38px] flex-none items-center justify-center overflow-hidden rounded-[11px] bg-[color:var(--m-ic)] text-m-ink">
<AddonIcon name={addon.icon} size={18} enabled={addon.enabled} />
</span>
<div className="min-w-0 flex-1">
<MHintLabel label={label.name} hint={label.description} />
</div>
<MToggle checked={addon.enabled} ariaLabel={label.name} onChange={() => onToggle(addon)} />
</div>
<MAdminOptionRow
icon={<AddonIcon name={addon.icon} size={18} enabled={addon.enabled} />}
title={label.name}
hint={label.description}
first={first}
trailing={<MToggle checked={addon.enabled} ariaLabel={label.name} onChange={() => 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 (
<MAdminOptionRow
icon={<Radar size={18} />}
title={t('flightLive.adminTitle')}
hint={option.locked ? `${hint} ${t('flightLive.envLocked')}` : hint}
first={first}
trailing={<MToggle checked={option.on} ariaLabel={t('flightLive.adminToggle')} disabled={option.locked} onChange={option.onToggle} />}
/>
)
}
@@ -301,17 +328,7 @@ function MAiAddons({ addons, onToggle }: { addons: Addon[]; onToggle: (addon: Ad
/>
)
})}
{tile.canSetUp && (
<button
type="button"
onClick={tile.openDialog}
className="flex w-full items-center gap-3 border-t border-[color:var(--m-rowbr)] py-[11px] ps-[50px] text-start"
>
<Settings2 size={14} className="flex-none text-m-faint" />
<span className="min-w-0 flex-1 truncate text-[0.75rem] font-bold text-m-ink">{t('admin.addons.ai.setup')}</span>
<ChevronRight size={15} className="flex-none text-m-faint rtl:rotate-180" />
</button>
)}
{tile.canSetUp && <MAdminSetupRow label={t('admin.addons.ai.setup')} onOpen={tile.openDialog} />}
{tile.dialogOpen && <AiSettingsDialog addons={addons} onClose={tile.closeDialog} />}
</div>
)
@@ -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<typeof usePaddleRegionsAdmin>;
@@ -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 ? (
<MBadge caps={false} tone="strong">
{waiting}
</MBadge>
) : admin.regions.length > 0 ? (
<MBadge caps={false}>{admin.regions.length}</MBadge>
) : undefined;
return (
<MAdminCard>
<div className="flex items-start gap-3">
<span className="flex h-[38px] w-[38px] flex-none items-center justify-center rounded-[11px] bg-[color:var(--m-ic)] text-m-ink">
<Waves size={18} />
</span>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="min-w-0 truncate text-[length:calc(14px*var(--fs-scale-body,1))] font-extrabold text-m-ink">
{t('admin.paddleRegions.title')}
</span>
{admin.regions.length > 0 && <MBadge caps={false}>{admin.regions.length}</MBadge>}
</div>
<MAdminClampedText className="mt-[2px] text-[length:calc(10px*var(--fs-scale-caption,1))]">
{t('admin.paddleRegions.hint')}
</MAdminClampedText>
</div>
</div>
<>
<MAdminSetupRow label={title} onOpen={() => setOpen(true)} badge={badge} />
{open && (
<MSheet open onClose={() => setOpen(false)} variant="bottom" material="glass" ariaLabel={title}>
<MAdminSheetFrame icon={<Waves size={19} strokeWidth={1.8} />} title={title} onClose={() => setOpen(false)}>
<p className="m-0 font-geist text-[length:calc(10px*var(--fs-scale-caption,1))] leading-relaxed text-m-muted">
{t('admin.paddleRegions.hint')}
</p>
<PanelBody admin={admin} />
</MAdminSheetFrame>
</MSheet>
)}
</>
);
}
/** 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 && (
<p
role="status"
@@ -462,6 +481,6 @@ export default function MAdminPaddleRegionsPanel() {
danger
onConfirm={admin.confirmRemove}
/>
</MAdminCard>
</>
);
}
@@ -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<MAdminSettingsSectionProps, 'part'>
// 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 <FeaturesPart admin={admin} t={t} />
if (part === 'security') return <SecurityPart admin={admin} t={t} />
return <ServicesPart admin={admin} t={t} />
}
/** 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 (
<div className="space-y-3">
{/* Live flight status: open ADS-B data, no key, on by default (desktop parity). */}
<FlightLiveCard
t={t}
managed={!!managed}
on={flightLive}
locked={flightLiveLocked}
onChange={(v) => void handleToggleAuthSetting('flight_live_enabled', v, setFlightLive)}
/>
{/* Booking mail import: self-hosted only, the operator runs the TREK Cloud relay (desktop parity). */}
{!managed && <MMailIngestAdminCard />}
</div>
)
}
/** 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) {
</div>
)
}
/** 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 (
<MAdminCard>
<MAdminCardHead title={t('flightLive.adminTitle')} hint={managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint')} />
<MAdminRow
title={t('flightLive.adminToggle')}
hint={locked ? t('flightLive.envLocked') : undefined}
trailing={<MToggle checked={on} ariaLabel={t('flightLive.adminToggle')} disabled={locked} onChange={onChange} />}
/>
</MAdminCard>
)
}
+53 -1
View File
@@ -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 (
<div className={`flex items-center gap-3 py-[11px] ${first ? '' : 'border-t border-[color:var(--m-rowbr)]'}`}>
{/* overflow-hidden so a brand mark that fills the slot keeps its rounded corners. */}
<span className="flex h-[38px] w-[38px] flex-none items-center justify-center overflow-hidden rounded-[11px] bg-[color:var(--m-ic)] text-m-ink">
{icon}
</span>
<div className="min-w-0 flex-1">
<MHintLabel label={title} hint={hint} />
</div>
{trailing}
</div>
)
}
/**
* 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 (
<button
type="button"
onClick={onOpen}
className="flex w-full items-center gap-3 border-t border-[color:var(--m-rowbr)] py-[11px] ps-[50px] text-start"
>
<Settings2 size={14} className="flex-none text-m-faint" />
<span className="min-w-0 flex-1 truncate text-[length:calc(12px*var(--fs-scale-body,1))] font-bold text-m-ink">{label}</span>
{badge}
<ChevronRight size={15} className="flex-none text-m-faint rtl:rotate-180" />
</button>
)
}
/**
* 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
@@ -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 (
<MAdminCard>
<MAdminCardHead title={t('mailAdmin.title')} hint={t('mailAdmin.hint')} />
<MAdminRow
title={t('mailAdmin.enabled')}
hint={t('mailAdmin.enabledHint')}
<>
<MAdminOptionRow
icon={<Mail size={18} />}
title={t('mailAdmin.title')}
hint={`${t('mailAdmin.hint')} ${t('mailAdmin.enabledHint')}`}
first={first}
trailing={
<MToggle
checked={admin.enabled}
@@ -272,7 +278,18 @@ export default function MMailIngestAdminCard() {
/>
}
/>
{admin.enabled && admin.form && <Setup admin={admin} form={admin.form} t={t} locale={locale} />}
</MAdminCard>
{admin.enabled && admin.form && <MAdminSetupRow label={setupLabel} onOpen={() => setOpen(true)} />}
{open && admin.enabled && admin.form && (
<MSheet open onClose={() => setOpen(false)} variant="bottom" material="glass" ariaLabel={setupLabel}>
<MAdminSheetFrame
icon={<Mail size={19} strokeWidth={1.8} />}
title={setupLabel}
onClose={() => setOpen(false)}
>
<Setup admin={admin} form={admin.form} t={t} locale={locale} />
</MAdminSheetFrame>
</MSheet>
)}
</>
);
}
-5
View File
@@ -20,9 +20,6 @@ vi.mock('../components/Admin/BackupPanel', () => ({
vi.mock('../components/Admin/GitHubPanel', () => ({
default: () => <div data-testid="github-panel" />,
}));
vi.mock('../components/Admin/paddle/PaddleRegionsPanel', () => ({
default: () => <div data-testid="paddle-regions-panel" />,
}));
// 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();
});
});
+10 -4
View File
@@ -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={<AdminSettingsTab admin={admin} t={t} part="features" />}
// 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}
/>
<PaddleRegionsPanel />
</div>
)}
@@ -13,13 +13,12 @@ import AdminSettingsTab from './AdminSettingsTab';
type Spy = ReturnType<typeof vi.fn>;
type Spies = Record<string, Spy> & { toast: Record<string, Spy> };
/** 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<typeof useTranslation>['t'] }) {
return (
<>
<AdminSettingsTab admin={admin} t={t} part="security" />
<AdminSettingsTab admin={admin} t={t} part="services" />
<AdminSettingsTab admin={admin} t={t} part="features" />
</>
);
}
+7 -45
View File
@@ -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<typeof useAdmin>
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. */}
<SettingsCard icon={Plane} title={t('flightLive.adminTitle')} hint={managed ? t('flightLive.adminHintManaged') : t('flightLive.adminHint')}>
<SettingRows>
<SettingRow
label={t('flightLive.adminToggle')}
hint={flightLiveLocked ? t('flightLive.envLocked') : undefined}
control={
<ToggleSwitch
on={flightLive}
label={t('flightLive.adminToggle')}
disabled={flightLiveLocked}
onToggle={() => void handleToggleAuthSetting('flight_live_enabled', !flightLive, setFlightLive)}
/>
}
/>
</SettingRows>
</SettingsCard>
</>
)
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 && <MailIngestAdminCard />}
</>
)
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 (
@@ -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: () => <div data-testid="paddle-regions-panel" />,
}));
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();
@@ -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(<MAdminAddonManager flightLive={{ on: false, locked: false, managed: false, onToggle }} />);
await userEvent.click(await screen.findByRole('switch', { name: 'Follow booked flights live' }));
expect(onToggle).toHaveBeenCalledTimes(1);
unmount();
render(<MAdminAddonManager flightLive={{ on: true, locked: true, managed: false, onToggle }} />);
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(<MAdminAddonManager mailImport />);
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();
});
});
@@ -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<Admin> = {}, search: Partial<Admin['search']> = {}) {
function show(overrides: Partial<Admin> = {}, search: Partial<Admin['search']> = {}, { open = true } = {}) {
const state: Admin = {
toursOn: true,
offline: false,
@@ -64,9 +64,16 @@ function show(overrides: Partial<Admin> = {}, search: Partial<Admin['search']> =
};
hook.usePaddleRegionsAdmin.mockReturnValue(state);
render(<MAdminPaddleRegionsPanel />);
// 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);
});
});
@@ -16,7 +16,7 @@ vi.mock('../../../../src/mobile/screens/admin/MAdminServiceQuota', () => ({ defa
vi.mock('../../../../src/mobile/screens/admin/MAdminPlaceContrib', () => ({ default: () => <div data-testid="place-contrib" /> }));
vi.mock('../../../../src/mobile/screens/admin/MAdminGoogleDailyLimit', () => ({ default: () => <div data-testid="google-daily-limit" /> }));
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<typeof useTranslation>['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(<PartHarness admin={admin} part="features" />);
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', () => {
+1
View File
@@ -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': 'كيفية وصول البريد',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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': 'איך הדוא״ל מגיע',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types';
const mailAdmin: TranslationStrings = {
'mailAdmin.title': '予約メールの取り込み',
'mailAdmin.hint': '転送された予約確認メールが、適切な旅行の予約になります。',
'mailAdmin.setup': 'メール取り込みを設定',
'mailAdmin.enabled': '予約メールを取り込む',
'mailAdmin.enabledHint':
'このインストールの全員に転送用アドレスを発行します。オフの間は、どのアドレスもメールを受け付けません。',
+1
View File
@@ -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': '메일 수신 방식',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types';
const mailAdmin: TranslationStrings = {
'mailAdmin.title': 'Импорт писем с бронированиями',
'mailAdmin.hint': 'Пересланные подтверждения бронирований становятся бронированиями в нужной поездке.',
'mailAdmin.setup': 'Настроить импорт писем',
'mailAdmin.enabled': 'Импортировать письма с бронированиями',
'mailAdmin.enabledHint':
'Даёт каждому пользователю этой установки адрес для пересылки. Если выключено, ни один адрес не принимает почту.',
+1
View File
@@ -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.',
+1
View File
@@ -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.',
+1
View File
@@ -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': 'วิธีรับอีเมล',
+1
View File
@@ -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.',
+1
View File
@@ -3,6 +3,7 @@ import type { TranslationStrings } from '../types';
const mailAdmin: TranslationStrings = {
'mailAdmin.title': 'Імпорт листів із бронюваннями',
'mailAdmin.hint': 'Переслані підтвердження бронювань стають бронюваннями в потрібній подорожі.',
'mailAdmin.setup': 'Налаштувати імпорт листів',
'mailAdmin.enabled': 'Імпортувати листи з бронюваннями',
'mailAdmin.enabledHint':
'Дає кожному користувачу цієї інсталяції адресу для пересилання. Якщо вимкнено, жодна адреса не приймає пошту.',
+1
View File
@@ -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.',
+1
View File
@@ -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': '郵件送達方式',
+1
View File
@@ -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': '邮件送达方式',