diff --git a/client/e2e/help/admin.guide.ts b/client/e2e/help/admin.guide.ts index e9f9f20fc..eb8e425b1 100644 --- a/client/e2e/help/admin.guide.ts +++ b/client/e2e/help/admin.guide.ts @@ -375,7 +375,7 @@ const SCRIPTS: Record = { only(p => section(p, 'Authentication Methods').getByText('Password Login', { exact: true }).locator('xpath=../..')), // The SSO rows exist only once OIDC is configured; the run shows where that happens. only(p => section(p, 'Single Sign-On (OIDC)')), - only(p => section(p, 'Require two-factor authentication (2FA)')), + only(p => section(p, 'Require 2FA')), ], }, 'admin-passkeys': { diff --git a/client/src/mobile/components/MHintLabel.tsx b/client/src/mobile/components/MHintLabel.tsx new file mode 100644 index 000000000..e59e4b9ae --- /dev/null +++ b/client/src/mobile/components/MHintLabel.tsx @@ -0,0 +1,56 @@ +import { Info } from 'lucide-react'; +import { useState, type ReactNode } from 'react'; + +interface MHintLabelProps { + label: ReactNode; + /** The explanation. It waits behind the mark until tapped; a screen reader reads it after the label all the same. */ + hint?: ReactNode; + labelClassName?: string; +} + +/** + * A setting's label with its explanation behind a small mark, the phone's form + * of the desktop HintMark: the row stays one line, a tap on the mark opens the + * sentence under the label and a second tap folds it again. + */ +export default function MHintLabel({ + label, + hint, + labelClassName = 'text-[length:calc(13px*var(--fs-scale-body,1))] font-bold text-m-ink', +}: MHintLabelProps) { + const [open, setOpen] = useState(false); + return ( +
+ {/* The mark rides at the end of the label's last line, also when a long label wraps. */} +
+ {label} + {hint && ( + // Touch only: the sentence below is in the page for a screen reader already. + + )} +
+ {hint && ( +
+ {hint} +
+ )} +
+ ); +} diff --git a/client/src/mobile/screens/admin/MAdmin.tsx b/client/src/mobile/screens/admin/MAdmin.tsx index aa3463885..07e84851e 100644 --- a/client/src/mobile/screens/admin/MAdmin.tsx +++ b/client/src/mobile/screens/admin/MAdmin.tsx @@ -9,16 +9,17 @@ import { Bug, ChevronDown, ChevronLeft, + Compass, Database, FileText, - Github, + GitBranch, HardDrive, + KeyRound, Map, - Plug, Puzzle, ScrollText, - Settings as SettingsIcon, Shield, + ShieldCheck, SlidersHorizontal, UserCog, UserPlus, @@ -46,7 +47,7 @@ import MAdminUsersSection from './MAdminUsersSection' import { MAdminButton } from './MAdminUi' import { managedAdminTabs } from '../../../managed' import { useIsSplit } from '../../../hooks/sizeClass' -import MSectionNav, { MSectionRow, SECTION_SCREEN, type MSection } from '../../components/MSectionNav' +import MSectionNav, { MSectionList, SECTION_SCREEN, type MSection } from '../../components/MSectionNav' // Stat card of the 2×2 grid (design §6.3): 34px icon tile, 19px/800 number, // small tracking label. Count-up animation matches the desktop stat cards. @@ -66,16 +67,16 @@ function MAdminStat({ label, value, icon: Icon }: { label: string; value: number } /** - * Mobile admin screen (design §6): section switcher pill with the 11-entry - * dropdown, update banner, stats grid and the users section; every other - * desktop admin section stays reachable through the dropdown. + * Mobile admin screen (design §6): section switcher pill with the grouped + * dropdown of the desktop sidebar's sections, update banner, stats grid and + * the active section. */ export default function MAdmin() { const { t, locale } = useTranslation() const admin = useAdmin() const { demoMode, mcpEnabled, devMode, managed, navigate, - activeTab: deskTab, setActiveTab, stats, serverTimezone, + activeTab, setActiveTab, stats, serverTimezone, bagTrackingEnabled, collabFeatures, setShowCreateUser, updateInfo, setShowUpdateModal, @@ -86,30 +87,32 @@ export default function MAdmin() { // settings, instead of behind the header's dropdown. const split = useIsSplit() - // Same sections and gating as the desktop sidebar, ordered and iconed like - // the design's dropdown (§6.1). + // The desktop sidebar's sections, groups, order, icons and gating, so a link + // to a tab and a habit from the laptop land on the same place here. + const gUsers = t('admin.group.users') + const gConfig = t('admin.group.config') + const gMaintenance = t('admin.group.maintenance') + const groupOf = { users: gUsers, config: gConfig, integration: gConfig, maintenance: gMaintenance } const sections: MSection[] = [ - { id: 'users', label: t('admin.tabs.users'), icon: Users }, - { id: 'defaults', label: t('admin.tabs.defaults'), icon: UserCog }, - { id: 'config', label: t('admin.tabs.config'), icon: SlidersHorizontal }, - { id: 'settings', label: t('admin.tabs.settings'), icon: SettingsIcon }, - { id: 'addons', label: t('admin.tabs.addons'), icon: Blocks }, - ...(managed ? [] : [{ id: 'plugins', label: t('admin.tabs.plugins'), icon: Puzzle }]), - ...(managed ? [] : [{ id: 'storage', label: t('admin.tabs.storage'), icon: HardDrive }]), - { id: 'notifications', label: t('admin.tabs.notifications'), icon: Bell }, - ...(mcpEnabled ? [{ id: 'mcp-tokens', label: t('admin.tabs.mcpTokens'), icon: Plug }] : []), - // Same two the desktop list drops: releases and backup schedule belong to - // whoever operates the install. - ...(managed ? [] : [{ id: 'github', label: t('admin.tabs.github'), icon: Github }]), - ...(managed ? [] : [{ id: 'backup', label: t('admin.tabs.backup'), icon: Database }]), - { id: 'audit', label: t('admin.tabs.audit'), icon: ScrollText }, - ...(devMode ? [{ id: 'dev-notifications', label: 'Dev: Notifications', icon: Bug }] : []), + { id: 'users', label: t('admin.tabs.users'), icon: Users, group: gUsers }, + { id: 'defaults', label: t('admin.tabs.defaults'), icon: UserCog, group: gUsers }, + { id: 'security', label: t('admin.tabs.security'), icon: ShieldCheck, group: gConfig }, + { id: 'services', label: t('admin.tabs.services'), icon: Compass, group: gConfig }, + { id: 'addons', label: t('admin.tabs.addons'), icon: Puzzle, group: gConfig }, + { id: 'config', label: t('admin.tabs.config'), icon: SlidersHorizontal, group: gConfig }, + { id: 'notifications', label: t('admin.tabs.notifications'), icon: Bell, group: gConfig }, + ...(mcpEnabled ? [{ id: 'mcp-tokens', label: t('admin.tabs.mcpTokens'), icon: KeyRound, group: gConfig }] : []), + // A hosted instance offers no plugins, storage backends, backup schedule or + // releases: they belong to whoever operates the install. + ...(managed ? [] : [{ id: 'plugins', label: t('admin.tabs.plugins'), icon: Blocks, group: gConfig }]), + ...(managed ? [] : [{ id: 'storage', label: t('admin.tabs.storage'), icon: HardDrive, group: gMaintenance }]), + ...(managed ? [] : [{ id: 'backup', label: t('admin.tabs.backup'), icon: Database, group: gMaintenance }]), + ...(managed ? [] : [{ id: 'github', label: t('admin.tabs.github'), icon: GitBranch, group: gMaintenance }]), + { id: 'audit', label: t('admin.tabs.audit'), icon: ScrollText, group: gMaintenance }, + ...(devMode ? [{ id: 'dev-notifications', label: 'Dev: Notifications', icon: Bug, group: gMaintenance }] : []), // The install's own tabs (managed/index.tsx), after the built-in ones as on the desktop. - ...managedAdminTabs.map(tab => ({ id: tab.id, label: tab.label, icon: tab.Icon })), + ...managedAdminTabs.map(tab => ({ id: tab.id, label: tab.label, icon: tab.Icon, group: groupOf[tab.group ?? 'config'] })), ] - // The desktop splits the settings into Security and Services; the phone keeps - // them in its one Settings section, so either desktop tab (and a link to it) opens that. - const activeTab = deskTab === 'security' || deskTab === 'services' ? 'settings' : deskTab const activeSection = sections.find((s) => s.id === activeTab) ?? sections[0] return ( @@ -173,17 +176,14 @@ export default function MAdmin() { {/* Section dropdown */} {sectionsOpen && !split && (
- {sections.map((section) => ( - { - setActiveTab(section.id) - setSectionsOpen(false) - }} - /> - ))} + { + setActiveTab(id) + setSectionsOpen(false) + }} + />
)} @@ -228,7 +228,8 @@ export default function MAdmin() { {/* Active section */} {activeTab === 'users' && } - {activeTab === 'settings' && } + {activeTab === 'security' && } + {activeTab === 'services' && } {activeTab === 'notifications' && } {activeTab === 'defaults' && } {activeTab === 'config' && ( @@ -246,6 +247,8 @@ export default function MAdmin() { collabFeatures={collabFeatures} onToggleCollabFeature={toggleCollabFeature} /> + {/* How the integrations reach the world (live flights, booking mails), beside the addons they serve. */} + )} diff --git a/client/src/mobile/screens/admin/MAdminAddonManager.tsx b/client/src/mobile/screens/admin/MAdminAddonManager.tsx index 4711471a1..70ef8d343 100644 --- a/client/src/mobile/screens/admin/MAdminAddonManager.tsx +++ b/client/src/mobile/screens/admin/MAdminAddonManager.tsx @@ -21,7 +21,8 @@ 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, MAdminClampedText } from './MAdminUi' +import { MAdminCard } from './MAdminUi' +import MHintLabel from '../../components/MHintLabel' import WandererMark from '../../../components/Tours/wanderer/WandererMark' import MSkeleton from '../../components/MSkeleton' @@ -189,11 +190,14 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac function MGroupHead({ icon: Icon, label, hint }: { icon: typeof Briefcase; label: string; hint: string }) { return (
-
- - {label} +
+ +
-

{hint}

) } @@ -205,11 +209,12 @@ interface MAddonRowProps { first?: boolean } -/** Addon row: icon tile, name + type badge, description, MToggle. */ +/** + * Addon row: icon tile, name with its description behind the info mark, MToggle. + * No type badge: every row stands under its type's heading already. + */ function MAddonRow({ addon, onToggle, t, first }: MAddonRowProps) { const label = getAddonLabel(t, addon) - const typeLabel = - addon.type === 'global' ? t('admin.addons.type.global') : addon.type === 'integration' ? t('admin.addons.type.integration') : t('admin.addons.type.trip') return (
{/* overflow-hidden so a brand mark that fills the slot keeps its rounded corners. */} @@ -217,13 +222,7 @@ function MAddonRow({ addon, onToggle, t, first }: MAddonRowProps) {
-
- {label.name} - - {typeLabel} - -
- {label.description} +
onToggle(addon)} />
@@ -265,8 +264,7 @@ function MSubRow({ icon: Icon, providerIcon: ProviderIcon, title, subtitle, enab {Icon ? : ProviderIcon ? : null}
-
{title}
- {subtitle} +
@@ -284,8 +282,7 @@ function MAiAddons({ addons, onToggle }: { addons: Addon[]; onToggle: (addon: Ad
- {t('admin.addons.ai.name')} -

{t('admin.addons.ai.description')}

+
{tile.enabledCount}/{addons.length} diff --git a/client/src/mobile/screens/admin/MAdminBackupPanel.tsx b/client/src/mobile/screens/admin/MAdminBackupPanel.tsx index 0e2c1dda8..61656b20d 100644 --- a/client/src/mobile/screens/admin/MAdminBackupPanel.tsx +++ b/client/src/mobile/screens/admin/MAdminBackupPanel.tsx @@ -21,10 +21,7 @@ import { useTranslation } from '../../../i18n' import MChip from '../../components/MChip' import MToggle from '../../components/MToggle' import MConfirmSheet from '../settings/MConfirmSheet' -import { MAdminButton, MAdminCard, MAdminCardHead, MAdminField, MAdminRow } from './MAdminUi' - -const SELECT_CLASS = - 'h-[42px] w-full rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 text-[0.84375rem] text-m-ink outline-none focus:border-[color:var(--m-faint)]' +import { MAdminButton, MAdminCard, MAdminCardHead, MAdminField, MAdminRow, MAdminSelect } from './MAdminUi' export default function MAdminBackupPanel() { const { @@ -219,23 +216,16 @@ export default function MAdminBackupPanel() { label={t('backup.auto.hour')} hint={serverTimezone ? t('backup.auto.hourHintTz', { format: is12h ? '12h' : '24h', timezone: serverTimezone }) : t('backup.auto.hourHint', { format: is12h ? '12h' : '24h' })} > - + /> )} @@ -259,15 +249,12 @@ export default function MAdminBackupPanel() { {/* Day of month (for monthly) */} {autoSettings.interval === 'monthly' && ( - + onChange={value => handleAutoSettingsChange('day_of_month', Number.parseInt(value, 10))} + options={DAYS_OF_MONTH.map(d => ({ value: String(d), label: String(d) }))} + /> )} diff --git a/client/src/mobile/screens/admin/MAdminPermissionsPanel.tsx b/client/src/mobile/screens/admin/MAdminPermissionsPanel.tsx index 1259cde16..5851e531f 100644 --- a/client/src/mobile/screens/admin/MAdminPermissionsPanel.tsx +++ b/client/src/mobile/screens/admin/MAdminPermissionsPanel.tsx @@ -3,7 +3,7 @@ import { useTranslation } from '../../../i18n' import { PermissionLevel } from '../../../store/permissionsStore' import { CATEGORIES, LEVEL_LABELS, usePermissionsAdmin } from '../../../components/Admin/usePermissionsAdmin' import { Save, RotateCcw } from 'lucide-react' -import { MAdminButton, MAdminCard } from './MAdminUi' +import { MAdminButton, MAdminCard, MAdminRow, MAdminSelect } from './MAdminUi' import MSkeleton from '../../components/MSkeleton' export default function MAdminPermissionsPanel(): React.ReactElement { @@ -43,40 +43,41 @@ export default function MAdminPermissionsPanel(): React.ReactElement {
{t(`perm.cat.${cat.id}`)}
-
- {cat.keys.map(key => { +
+ {cat.keys.map((key, index) => { const entry = entryMap.get(key) if (!entry) return null const currentLevel = values[key] || entry.defaultLevel const isDefault = currentLevel === entry.defaultLevel return ( -
-
-
-
{t(`perm.action.${key}`)}
-
- {t(`perm.actionHint.${key}`)} -
-
- {!isDefault && ( - - {t('perm.customized')} - - )} -
- -
+ + {t(`perm.action.${key}`)} + {/* A changed rule wears the pending dot; its name is in the title for a screen reader. */} + {!isDefault && ( + + {t('perm.customized')} + + )} + + } + hint={t(`perm.actionHint.${key}`)} + trailing={ + handleChange(key, level as PermissionLevel)} + options={entry.allowedLevels.map((level) => ({ value: level, label: t(LEVEL_LABELS[level] || level) }))} + /> + } + /> ) })}
diff --git a/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx b/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx index ee27a6bfc..d825543b1 100644 --- a/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx +++ b/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx @@ -11,7 +11,7 @@ import MToggle from '../../components/MToggle' import MSheet from '../../components/MSheet' import MSegmented from '../../components/MSegmented' import MConfirmSheet from '../settings/MConfirmSheet' -import { MAdminButton, MAdminSheetFrame } from './MAdminUi' +import { MAdminButton, MAdminSelect, MAdminSheetFrame } from './MAdminUi' import { KNOWN_TYPES, PERM_KEYS, blockIsCurrent, dependencyRows, deriveDeps, fingerprint, formatCompactCount, installOffer, isRegistrySourced, parseJson, signatureBlockView, sortLabel, statusLabel, @@ -437,14 +437,12 @@ export default function MAdminPluginsPanel() { ariaLabel={f.label || f.key} /> ) : f.input_type === 'select' && f.options ? ( - + onChange={value => settings.setValue(f.key, value)} + options={[{ value: '', label: '—' }, ...f.options.map(o => ({ value: o.value, label: o.label }))]} + /> ) : ( 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). + */ + part: 'security' | 'services' | 'features' } -// Settings section: auth methods, passkey login, require-MFA, allowed file -// types, API keys, OIDC and the danger zone — the full desktop settings tab -// relaid as mobile cards. All state and mutations come from useAdmin. -export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectionProps) { +// The admin's security, services and feature setup sections as phone cards. +// All state and mutations come from useAdmin. +export default function MAdminSettingsSection({ admin, t, part }: MAdminSettingsSectionProps) { const [providerPickerOpen, setProviderPickerOpen] = useState(false) const { placesPhotosEnabled, placesAutocompleteEnabled, placesDetailsEnabled, placesEnrichEnabled, @@ -53,9 +58,26 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio togglePlaceShadow, } = useAdminSettingsActions(admin, t) - return ( + if (part === 'features') { + 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 && } +
+ ) + } + + if (part === 'security') return (
- {/* Authentication methods */} + {/* Authentication methods, with the passkey switch and the 2FA rule: they are ways in too. */} {envOverrideOidcOnly && ( @@ -127,11 +149,6 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio } /> )} - - - {/* Passkey login */} - - } /> + + } + /> + + + {/* The passkey domain: the instance's address, which the operator owns on a + managed install (server managed.ts), same as the desktop tab. */} + {!managed && ( + + {passkeyLogin && !passkeyConfigured && (

{t('admin.passkey.notConfigured')}

)} - {/* The relying party is the instance's address, which the operator owns on a - managed install (server managed.ts), same as the desktop tab. */} - {!managed && (
- )}
+ )} - {/* Require 2FA */} - + {/* OIDC / SSO: the operator's on a managed install, as on the desktop tab. */} + {!managed && } + + {/* Last and on its own, not beside a harmless switch. Rotating the secret fixes + nothing an instance admin of a managed install can reach. */} + {!managed && ( + +
+ + {t('admin.danger.title')} +
+ setShowRotateJwtModal(true)}> + + {t('admin.rotateJwt.button')} + } />
+ )} +
+ ) - {/* 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 && } - - {/* Allowed file types */} - - -
- - setAllowedFileTypes(e.target.value)} - placeholder="jpg,png,pdf,doc,docx,xls,xlsx,txt,csv" - /> - - - {t('common.save')} - -
-
- + // Services: what the install talks to outside, and the file types it takes. + return ( +
{/* API keys, place search and routing: the operator's on a managed install, same as the desktop tab, so the whole card is left out. Unlike the desktop tab, the phone has no share place details section for a managed install. */} @@ -409,26 +425,22 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio )} - {/* OIDC / SSO: the operator's on a managed install, as on the desktop tab. */} - {!managed && } - - {/* Danger zone */} - -
- - {t('admin.danger.title')} + {/* Allowed file types */} + + +
+ + setAllowedFileTypes(e.target.value)} + placeholder="jpg,png,pdf,doc,docx,xls,xlsx,txt,csv" + /> + + + {t('common.save')} +
- setShowRotateJwtModal(true)}> - - {t('admin.rotateJwt.button')} - - } - />
) diff --git a/client/src/mobile/screens/admin/MAdminUi.tsx b/client/src/mobile/screens/admin/MAdminUi.tsx index 5fb682032..744ca4c03 100644 --- a/client/src/mobile/screens/admin/MAdminUi.tsx +++ b/client/src/mobile/screens/admin/MAdminUi.tsx @@ -1,7 +1,9 @@ import { InputHTMLAttributes, ReactNode, useState } from 'react' -import { Eye, EyeOff, Loader2, X } from 'lucide-react' +import { ChevronDown, Eye, EyeOff, Loader2, X } from 'lucide-react' import { useTranslation } from '../../../i18n' import MIconBtn from '../../components/MIconBtn' +import MHintLabel from '../../components/MHintLabel' +import MSetPickerSheet, { type MSetPickerOption } from '../settings/MSetPickerSheet' /** Opaque content card of the admin screen (r18, --m-sheetop on --m-rowbr). */ export function MAdminCard({ className = '', children }: { className?: string; children: ReactNode }) { @@ -33,7 +35,7 @@ export function MAdminCardHead({ ) } -/** Settings row: bold 13px title + Geist hint on the left, control on the right. */ +/** Settings row: bold 13px title (its hint behind the info mark) on the left, control on the right. */ export function MAdminRow({ title, hint, @@ -52,8 +54,7 @@ export function MAdminRow({ }`} >
-
{title}
- {hint &&
{hint}
} +
{trailing}
@@ -79,13 +80,18 @@ export function MAdminClampedText({ children, className = '' }: { children: stri ) } -/** Labelled form field with an optional hint line under the control. */ +/** Labelled form field; its hint waits behind the label's info mark. */ export function MAdminField({ label, hint, children }: { label: ReactNode; hint?: ReactNode; children: ReactNode }) { return (
-
{label}
+
+ +
{children} - {hint &&
{hint}
}
) } @@ -198,3 +204,54 @@ export function MAdminSheetFrame({ ) } + +interface MAdminSelectProps { + value: string + options: MSetPickerOption[] + onChange: (value: string) => void + /** The picker sheet's title and the control's accessible name. */ + title: string + disabled?: boolean + /** A small pill for the end of a row instead of a full-width field. */ + compact?: boolean +} + +/** + * The phone's select: TREK's own field (or a pill at the end of a row) that + * opens the bottom picker sheet. A native - setInviteForm((f) => ({ ...f, trip_id: e.target.value === '' ? '' : Number(e.target.value) })) - } - className="h-[42px] w-full rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 text-[0.84375rem] text-m-ink outline-none" - > - - {inviteTrips.map((tr) => ( - - ))} - + setInviteForm((f) => ({ ...f, trip_id: value === '' ? '' : Number(value) }))} + options={[ + { value: '', label: t('admin.invite.tripNone') }, + ...inviteTrips.map((tr) => ({ value: String(tr.id), label: tr.title })), + ]} + /> )}
diff --git a/client/src/mobile/screens/settings/MAiConnectionSection.tsx b/client/src/mobile/screens/settings/MAiConnectionSection.tsx index 0e4475cbd..859accc5d 100644 --- a/client/src/mobile/screens/settings/MAiConnectionSection.tsx +++ b/client/src/mobile/screens/settings/MAiConnectionSection.tsx @@ -152,7 +152,7 @@ function MAssistantBehaviour() {
void toggle()} ariaLabel={t('native.lock.setting')} />} />
diff --git a/client/src/mobile/screens/settings/MDawarichConnectionSection.tsx b/client/src/mobile/screens/settings/MDawarichConnectionSection.tsx index f58390837..aa1c73f33 100644 --- a/client/src/mobile/screens/settings/MDawarichConnectionSection.tsx +++ b/client/src/mobile/screens/settings/MDawarichConnectionSection.tsx @@ -52,14 +52,14 @@ export default function MDawarichConnectionSection(): React.ReactElement { } /> update({ transparency: v })} ariaLabel={t('settings.appearance.transparency')} />} /> update({ reduceMotion: v })} ariaLabel={t('settings.appearance.reduceMotion')} />} /> @@ -253,7 +253,7 @@ export default function MSettingsAppearance() { setWidget('desktop', g.master as string, v)} ariaLabel={t(`settings.appearance.widget.${g.master}`)} />} /> ) : ( diff --git a/client/src/mobile/screens/settings/MSettingsGeneral.tsx b/client/src/mobile/screens/settings/MSettingsGeneral.tsx index d0017511b..730abaaa8 100644 --- a/client/src/mobile/screens/settings/MSettingsGeneral.tsx +++ b/client/src/mobile/screens/settings/MSettingsGeneral.tsx @@ -194,7 +194,7 @@ export default function MSettingsGeneral() { } /> } /> } />

diff --git a/client/src/mobile/screens/settings/MSettingsMcp.tsx b/client/src/mobile/screens/settings/MSettingsMcp.tsx index e6b12c496..58a6c32dd 100644 --- a/client/src/mobile/screens/settings/MSettingsMcp.tsx +++ b/client/src/mobile/screens/settings/MSettingsMcp.tsx @@ -329,7 +329,7 @@ export default function MSettingsMcp() { } /> diff --git a/client/src/mobile/screens/settings/MSettingsOffline.tsx b/client/src/mobile/screens/settings/MSettingsOffline.tsx index c615b1cde..5a1bca712 100644 --- a/client/src/mobile/screens/settings/MSettingsOffline.tsx +++ b/client/src/mobile/screens/settings/MSettingsOffline.tsx @@ -59,7 +59,7 @@ export default function MSettingsOffline() { } /> @@ -157,7 +157,7 @@ export default function MSettingsOffline() { } /> {/* The iOS app's own store of the map tiles looked at, beside the trip regions above. */} diff --git a/client/src/mobile/screens/settings/MSettingsUi.tsx b/client/src/mobile/screens/settings/MSettingsUi.tsx index ca99604e7..b8b2c8798 100644 --- a/client/src/mobile/screens/settings/MSettingsUi.tsx +++ b/client/src/mobile/screens/settings/MSettingsUi.tsx @@ -1,5 +1,6 @@ import React, { ReactNode } from 'react' import type { LucideIcon } from 'lucide-react' +import MHintLabel from '../../components/MHintLabel' /** * Shared building blocks of the mobile settings screen, all straight from the @@ -125,17 +126,20 @@ export function MSetOnOff({ on, onChange, onLabel, offLabel, ariaLabel }: MSetOn interface MSetRowProps { label: ReactNode + /** A value under the label (a host, a size, a date): always shown. */ sub?: ReactNode + /** What the setting does: behind the label's info mark, as on the desktop. */ + hint?: ReactNode trailing?: ReactNode first?: boolean } -/** Setting row with label + Geist sub line and a trailing control. */ -export function MSetRow({ label, sub, trailing, first = false }: MSetRowProps) { +/** Setting row with label (and its hint behind the info mark), an optional value line and a trailing control. */ +export function MSetRow({ label, sub, hint, trailing, first = false }: MSetRowProps) { return (

-
{label}
+ {sub &&
{sub}
}
{trailing} @@ -188,7 +192,7 @@ export function MSetButton({ onClick, disabled = false, variant = 'primary', cla type="button" onClick={onClick} disabled={disabled} - className={`inline-flex items-center justify-center gap-[6px] rounded-full px-4 py-[9px] text-[0.78125rem] font-bold disabled:opacity-50 ${look} ${className}`} + className={`inline-flex shrink-0 items-center justify-center gap-[6px] whitespace-nowrap rounded-full px-4 py-[9px] text-[0.78125rem] font-bold disabled:opacity-50 ${look} ${className}`} > {children} diff --git a/client/src/pages/AdminPage.test.tsx b/client/src/pages/AdminPage.test.tsx index e2f6af234..76386d99a 100644 --- a/client/src/pages/AdminPage.test.tsx +++ b/client/src/pages/AdminPage.test.tsx @@ -516,7 +516,7 @@ describe('AdminPage', () => { fireEvent.click(screen.getByRole('button', { name: /^security$/i })); // The 2FA rule is a row of the sign-in card: its label left, its switch right. - const mfaLabel = await screen.findByText('Require two-factor authentication (2FA)', { selector: 'label' }); + const mfaLabel = await screen.findByText('Require 2FA', { selector: 'label' }); const mfaRow = mfaLabel.closest('.flex-wrap'); fireEvent.click(within(mfaRow!).getByRole('button')); diff --git a/client/src/pages/admin/AdminSettingsTab.test.tsx b/client/src/pages/admin/AdminSettingsTab.test.tsx index 89941f6fd..eef0ca0d9 100644 --- a/client/src/pages/admin/AdminSettingsTab.test.tsx +++ b/client/src/pages/admin/AdminSettingsTab.test.tsx @@ -236,7 +236,7 @@ describe('AdminSettingsTab', () => { it('FE-ADMSET-016: require-MFA toggle flips the current value', () => { const admin = renderTab({ requireMfa: false }); - fireEvent.click(toggleFor('Require two-factor authentication (2FA)')); + fireEvent.click(toggleFor('Require 2FA')); expect(admin.handleToggleRequireMfa).toHaveBeenCalledWith(true); }); diff --git a/client/tests/helpers/mobileSelect.ts b/client/tests/helpers/mobileSelect.ts new file mode 100644 index 000000000..60faf9515 --- /dev/null +++ b/client/tests/helpers/mobileSelect.ts @@ -0,0 +1,22 @@ +import { screen, within } from '@testing-library/react'; +import type { UserEvent } from '@testing-library/user-event'; + +/** + * Picks an option of the phone's own select (MAdminSelect): taps the combobox + * named `name`, then the option labelled `option` in the picker sheet it opens. + */ +export async function pickMobileOption(user: UserEvent, name: string, option: string): Promise { + await user.click(screen.getByRole('combobox', { name })); + const sheet = await screen.findByRole('dialog', { name }); + await user.click(within(sheet).getByRole('button', { name: option })); +} + +/** The labels a phone select offers, read from its open picker sheet. */ +export async function mobileOptionLabels(user: UserEvent, name: string): Promise { + await user.click(screen.getByRole('combobox', { name })); + const sheet = await screen.findByRole('dialog', { name }); + return within(sheet) + .getAllByRole('button') + .filter((button) => button.getAttribute('aria-label') === null) + .map((button) => button.textContent ?? ''); +} diff --git a/client/tests/unit/mobile/MHintLabel.test.tsx b/client/tests/unit/mobile/MHintLabel.test.tsx new file mode 100644 index 000000000..978413151 --- /dev/null +++ b/client/tests/unit/mobile/MHintLabel.test.tsx @@ -0,0 +1,37 @@ +// FE-MOB-HINT-001 to FE-MOB-HINT-004 +import userEvent from '@testing-library/user-event'; +import { describe, expect, it } from 'vitest'; +import MHintLabel from '../../../src/mobile/components/MHintLabel'; +import { render, screen } from '../../helpers/render'; + +describe('MHintLabel', () => { + it('FE-MOB-HINT-001: without a hint it is the label alone, with no mark', () => { + render(); + expect(screen.getByText('Password Login')).toBeInTheDocument(); + expect(screen.queryByTestId('m-hint-mark')).not.toBeInTheDocument(); + }); + + it('FE-MOB-HINT-002: the hint stays in the page for a screen reader while the mark is closed', () => { + render(); + const hint = screen.getByText('Allow sign in with email and password'); + expect(hint).toHaveClass('sr-only'); + expect(screen.getByTestId('m-hint-mark')).toHaveAttribute('aria-hidden', 'true'); + }); + + it('FE-MOB-HINT-003: a tap on the mark shows the hint and a second one folds it again', async () => { + const user = userEvent.setup(); + render(); + const mark = screen.getByTestId('m-hint-mark'); + + await user.click(mark); + expect(screen.getByText('Allow sign in with email and password')).not.toHaveClass('sr-only'); + + await user.click(mark); + expect(screen.getByText('Allow sign in with email and password')).toHaveClass('sr-only'); + }); + + it('FE-MOB-HINT-004: the label takes the class it is given', () => { + render(); + expect(screen.getByText('Files')).toHaveClass('uppercase'); + }); +}); diff --git a/client/tests/unit/mobile/admin/MAdmin.test.tsx b/client/tests/unit/mobile/admin/MAdmin.test.tsx index 3b7909dba..aa6db949f 100644 --- a/client/tests/unit/mobile/admin/MAdmin.test.tsx +++ b/client/tests/unit/mobile/admin/MAdmin.test.tsx @@ -137,7 +137,7 @@ describe('MAdmin', () => { expect(screen.getByText('8')).toBeInTheDocument(); }); - it('FE-MOB-ADMIN-002: the section dropdown switches to the settings section', async () => { + it('FE-MOB-ADMIN-002: the section dropdown switches to the security section', async () => { render(); await waitFor(() => expect(screen.getByText('alice')).toBeInTheDocument()); @@ -148,18 +148,22 @@ describe('MAdmin', () => { expect(screen.getByRole('button', { name: 'Defaults' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Backup' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Audit' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Services' })).toBeInTheDocument(); + // Under the desktop sidebar's group headings + expect(screen.getByText('Configuration')).toBeInTheDocument(); + expect(screen.getByText('Maintenance')).toBeInTheDocument(); - fireEvent.click(screen.getByRole('button', { name: 'Settings' })); + fireEvent.click(screen.getByRole('button', { name: 'Security' })); - // Settings section renders the auth methods card, user list is gone + // Security renders the auth methods card, user list is gone await waitFor(() => expect(screen.getByText('Authentication Methods')).toBeInTheDocument()); expect(screen.queryByText('alice')).not.toBeInTheDocument(); }); - it('FE-MOB-ADMIN-002b: a link to the desktop Security or Services tab opens the Settings section', async () => { - for (const tab of ['security', 'services', 'settings']) { + it('FE-MOB-ADMIN-002b: a link to a desktop tab opens the same section, an old Settings link Security', async () => { + for (const [tab, card] of [['security', 'Authentication Methods'], ['settings', 'Authentication Methods'], ['services', 'API Keys']]) { const { unmount } = render(, { initialEntries: [`/admin?tab=${tab}`] }); - await waitFor(() => expect(screen.getByText('Authentication Methods')).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText(card)).toBeInTheDocument()); unmount(); } }); @@ -449,9 +453,9 @@ describe('MAdmin', () => { // No dropdown pill on top of the page: the list beside it is the switcher. expect(screen.queryByRole('button', { name: 'Administration', expanded: false })).not.toBeInTheDocument(); - fireEvent.click(within(sections).getByRole('button', { name: 'Settings' })); + fireEvent.click(within(sections).getByRole('button', { name: 'Security' })); await waitFor(() => expect(screen.getByText('Authentication Methods')).toBeInTheDocument()); - expect(within(sections).getByRole('button', { name: 'Settings' })).toHaveAttribute('aria-current', 'page'); + expect(within(sections).getByRole('button', { name: 'Security' })).toHaveAttribute('aria-current', 'page'); fireEvent.click(within(sections).getByRole('button', { name: 'Create User' })); expect(screen.getByRole('dialog', { name: 'Create User' })).toBeInTheDocument(); diff --git a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx index e7e630de9..376830158 100644 --- a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx @@ -106,7 +106,7 @@ describe('MAdminAddonManager', () => { expect(await screen.findByText('No addons available')).toBeInTheDocument(); }); - it('FE-MOB-AADD-005: trip addons render with the section band, catalog label and type badge', async () => { + it('FE-MOB-AADD-005: trip addons render under the section band with their catalog label, no type badge of their own', async () => { server.use(addonsRoute([buildAddon({ id: 'packing', name: 'Packing', enabled: true })])); render(); @@ -114,7 +114,8 @@ describe('MAdminAddonManager', () => { // The band names the type and says what it means on a line of its own, no dash between them. expect(screen.getByText('Available as a tab within each trip')).toBeInTheDocument(); expect(screen.getByText('Packing lists and to-do tasks for your trips')).toBeInTheDocument(); - expect(screen.getAllByText('Trip')).toHaveLength(2); + // Only the band names the type: every row under it is of that type. + expect(screen.getAllByText('Trip')).toHaveLength(1); expect(screen.getByRole('switch', { name: 'Lists' })).toHaveAttribute('aria-checked', 'true'); }); @@ -275,8 +276,8 @@ describe('MAdminAddonManager', () => { expect(screen.getByRole('switch', { name: 'Immich' })).toHaveAttribute('aria-checked', 'true'); // Journey + three providers, and providers are not shown as top-level rows. expect(screen.getAllByRole('switch')).toHaveLength(4); - // The band and the addon's type badge both say Global. - expect(screen.getAllByText('Global')).toHaveLength(2); + // Only the band says Global. + expect(screen.getAllByText('Global')).toHaveLength(1); }); it('FE-MOB-AADD-015: toggling a provider persists it and rolls back on failure', async () => { @@ -413,8 +414,8 @@ describe('MAdminAddonManager', () => { expect(screen.getByRole('switch', { name: 'Nextcloud' })).toHaveAttribute('aria-checked', 'true'); // Documents plus two providers, and neither provider carries a type badge of its own. expect(screen.getAllByRole('switch')).toHaveLength(3); - // The band and the addon's type badge. - expect(screen.getAllByText('Trip')).toHaveLength(2); + // The band alone names the type. + expect(screen.getAllByText('Trip')).toHaveLength(1); }); it('FE-MOB-AADD-029: the shelf stays hidden while Documents is off', async () => { diff --git a/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx index d5451e1e0..b0112132b 100644 --- a/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx @@ -9,6 +9,7 @@ import { buildSettings } from '../../../helpers/factories'; import { useSettingsStore } from '../../../../src/store/settingsStore'; import { ToastContainer } from '../../../../src/components/shared/Toast'; import MAdminBackupPanel from '../../../../src/mobile/screens/admin/MAdminBackupPanel'; +import { mobileOptionLabels, pickMobileOption } from '../../../helpers/mobileSelect'; const manualBackup = { filename: 'backup-2025-01-15.zip', created_at: '2025-01-15T10:00:00Z', size: 2_048_000 }; const autoBackup = { filename: 'auto-backup-2025-02-01.zip', created_at: '2025-02-01T02:00:00Z', size: 512_000 }; @@ -349,14 +350,16 @@ describe('MAdminBackupPanel', () => { }); it('FE-MOB-MBKP-021: the hour picker renders 24h labels and names the server timezone', async () => { + const user = userEvent.setup(); server.use(autoSettingsHandler({ ...DEFAULT_AUTO, enabled: true }, 'Europe/Berlin')); render(); expect(await screen.findByText('Run at hour')).toBeInTheDocument(); expect(screen.getByText('Server local time (24h format), timezone Europe/Berlin')).toBeInTheDocument(); - expect(screen.getByRole('combobox')).toHaveValue('2'); - expect(screen.getByRole('option', { name: '00:00' })).toBeInTheDocument(); - expect(screen.getByRole('option', { name: '23:00' })).toBeInTheDocument(); + expect(screen.getByRole('combobox', { name: 'Run at hour' })).toHaveTextContent('02:00'); + const labels = await mobileOptionLabels(user, 'Run at hour'); + expect(labels).toContain('00:00'); + expect(labels).toContain('23:00'); }); it('FE-MOB-MBKP-022: with a 12h user preference the hours are labelled AM/PM', async () => { @@ -365,9 +368,10 @@ describe('MAdminBackupPanel', () => { render(); expect(await screen.findByText('Server local time (12h format)')).toBeInTheDocument(); - expect(screen.getByRole('option', { name: '12:00 AM' })).toBeInTheDocument(); - expect(screen.getByRole('option', { name: '11:00 AM' })).toBeInTheDocument(); - expect(screen.getByRole('option', { name: '1:00 PM' })).toBeInTheDocument(); + const labels = await mobileOptionLabels(userEvent.setup(), 'Run at hour'); + expect(labels).toContain('12:00 AM'); + expect(labels).toContain('11:00 AM'); + expect(labels).toContain('1:00 PM'); }); it('FE-MOB-MBKP-023: hourly hides the hour picker, weekly shows weekdays, monthly a day select', async () => { @@ -388,12 +392,10 @@ describe('MAdminBackupPanel', () => { expect(screen.queryByText('Day of week')).not.toBeInTheDocument(); expect(screen.getByText('Day of month')).toBeInTheDocument(); // Hour picker plus the 1–28 day picker - const selects = screen.getAllByRole('combobox'); - expect(selects).toHaveLength(2); - expect(within(selects[1]).getAllByRole('option')).toHaveLength(28); - - fireEvent.change(selects[1], { target: { value: '15' } }); - expect(selects[1]).toHaveValue('15'); + expect(screen.getAllByRole('combobox')).toHaveLength(2); + expect(await mobileOptionLabels(user, 'Day of month')).toHaveLength(28); + await user.click(within(screen.getByRole('dialog', { name: 'Day of month' })).getByRole('button', { name: '15' })); + expect(screen.getByRole('combobox', { name: 'Day of month' })).toHaveTextContent('15'); }); it('FE-MOB-MBKP-024: saving sends the edited schedule and confirms with a toast', async () => { @@ -412,7 +414,7 @@ describe('MAdminBackupPanel', () => { await user.click(screen.getByText('Weekly')); await user.click(screen.getByText('Fri')); await user.click(screen.getByText('30 days')); - fireEvent.change(screen.getByRole('combobox'), { target: { value: '5' } }); + await pickMobileOption(user, 'Run at hour', '05:00'); await user.click(screen.getByRole('button', { name: 'Save' })); expect(await screen.findByText('Auto-backup settings saved')).toBeInTheDocument(); diff --git a/client/tests/unit/mobile/admin/MAdminPermissionsPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminPermissionsPanel.test.tsx index d388bdaba..e26e756a0 100644 --- a/client/tests/unit/mobile/admin/MAdminPermissionsPanel.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminPermissionsPanel.test.tsx @@ -9,6 +9,7 @@ import { resetAllStores } from '../../../helpers/store'; import { usePermissionsStore } from '../../../../src/store/permissionsStore'; import { ToastContainer } from '../../../../src/components/shared/Toast'; import MAdminPermissionsPanel from '../../../../src/mobile/screens/admin/MAdminPermissionsPanel'; +import { mobileOptionLabels, pickMobileOption } from '../../../helpers/mobileSelect'; const ALLOWED = ['admin', 'trip_owner', 'trip_member', 'everybody']; @@ -76,12 +77,12 @@ describe('MAdminPermissionsPanel', () => { }); it('FE-MOB-APERM-003: a select reflects the stored level and offers every allowed level', async () => { + const user = userEvent.setup(); renderPanel(); await screen.findByText('Permission Settings'); - const select = screen.getByRole('combobox', { name: 'Create trips' }) as HTMLSelectElement; - expect(select.value).toBe('trip_member'); - expect(Array.from(select.options).map((o) => o.textContent)).toEqual([ + expect(screen.getByRole('combobox', { name: 'Create trips' })).toHaveTextContent('Trip members'); + expect(await mobileOptionLabels(user, 'Create trips')).toEqual([ 'Admin only', 'Trip owner', 'Trip members', 'Everyone', ]); }); @@ -125,7 +126,7 @@ describe('MAdminPermissionsPanel', () => { const save = screen.getByRole('button', { name: /Save/ }); expect(save).toBeDisabled(); - await user.selectOptions(screen.getByRole('combobox', { name: 'Create trips' }), 'admin'); + await pickMobileOption(user, 'Create trips', 'Admin only'); expect(save).not.toBeDisabled(); expect(screen.getAllByText('customized')).toHaveLength(1); @@ -151,8 +152,8 @@ describe('MAdminPermissionsPanel', () => { await user.click(screen.getByRole('button', { name: 'Reset to defaults' })); await waitFor(() => expect(screen.queryByText('customized')).not.toBeInTheDocument()); - expect((screen.getByRole('combobox', { name: 'Create trips' }) as HTMLSelectElement).value).toBe('trip_member'); - expect((screen.getByRole('combobox', { name: 'Edit trip details' }) as HTMLSelectElement).value).toBe('trip_owner'); + expect(screen.getByRole('combobox', { name: 'Create trips' })).toHaveTextContent('Trip members'); + expect(screen.getByRole('combobox', { name: 'Edit trip details' })).toHaveTextContent('Trip owner'); expect(screen.getByRole('button', { name: /Save/ })).not.toBeDisabled(); }); @@ -168,7 +169,7 @@ describe('MAdminPermissionsPanel', () => { renderPanel(); await screen.findByText('Permission Settings'); - await user.selectOptions(screen.getByRole('combobox', { name: 'Create trips' }), 'admin'); + await pickMobileOption(user, 'Create trips', 'Admin only'); await user.click(screen.getByRole('button', { name: /Save/ })); await screen.findByText('Permission settings saved'); @@ -184,7 +185,7 @@ describe('MAdminPermissionsPanel', () => { renderPanel(); await screen.findByText('Permission Settings'); - await user.selectOptions(screen.getByRole('combobox', { name: 'Create trips' }), 'admin'); + await pickMobileOption(user, 'Create trips', 'Admin only'); await user.click(screen.getByRole('button', { name: /Save/ })); await screen.findByText('Permission settings saved'); @@ -199,7 +200,7 @@ describe('MAdminPermissionsPanel', () => { renderPanel(); await screen.findByText('Permission Settings'); - await user.selectOptions(screen.getByRole('combobox', { name: 'Create trips' }), 'admin'); + await pickMobileOption(user, 'Create trips', 'Admin only'); const save = screen.getByRole('button', { name: /Save/ }); await user.click(save); diff --git a/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx index dfd56d45d..49cb829ae 100644 --- a/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx @@ -1695,13 +1695,14 @@ describe('MAdminPluginsPanel — instance settings', () => { await openRowSheet(plugin({ instanceSettingsCount: 3 })); fireEvent.click(screen.getByText('Instance settings')); - const select = await screen.findByRole('combobox', {}, { timeout: 5000 }); - expect(select).toHaveValue('slow'); + const select = await screen.findByRole('combobox', { name: 'Mode' }, { timeout: 5000 }); + expect(select).toHaveTextContent('Slow'); expect(screen.getByRole('switch', { name: 'enabled' })).toBeInTheDocument(); // label falls back to the key expect(screen.getByRole('spinbutton')).toHaveValue(null); expect(screen.getByText('Pick one')).toBeInTheDocument(); // hint - fireEvent.change(select, { target: { value: 'fast' } }); + fireEvent.click(select); + fireEvent.click(within(await screen.findByRole('dialog', { name: 'Mode' })).getByRole('button', { name: 'Fast' })); fireEvent.click(screen.getByRole('switch', { name: 'enabled' })); fireEvent.change(screen.getByRole('spinbutton'), { target: { value: '3' } }); fireEvent.click(screen.getByRole('button', { name: /^save$/i })); diff --git a/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx b/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx index 124de49cb..56386224e 100644 --- a/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminSettingsSection.test.tsx @@ -10,9 +10,27 @@ import { buildAdminHook, type AdminHook } from '../../../helpers/mobileAdmin'; import { useTranslation } from '../../../../src/i18n'; import MAdminSettingsSection from '../../../../src/mobile/screens/admin/MAdminSettingsSection'; +const PARTS = ['security', 'services', 'features'] 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'] }) { + return ( + <> + {PARTS.map((part) => ( + + ))} + + ); +} + function Harness({ admin }: { admin: AdminHook }) { const { t } = useTranslation(); - return ; + return ; +} + +function PartHarness({ admin, part }: { admin: AdminHook; part: (typeof PARTS)[number] }) { + const { t } = useTranslation(); + return ; } type Spy = ReturnType; @@ -52,7 +70,7 @@ function OidcHarness() { discovery_url: '', }); const admin = buildAdminHook({ oidcConfig, setOidcConfig }); - return ; + return ; } beforeEach(() => { @@ -69,7 +87,7 @@ describe('MAdminSettingsSection', () => { expect(screen.getByText('Authentication Methods')).toBeInTheDocument(); expect(screen.getByText('Passkey login')).toBeInTheDocument(); - expect(screen.getByText('Require two-factor authentication (2FA)')).toBeInTheDocument(); + expect(screen.getByText('Require 2FA')).toBeInTheDocument(); // Card head and field label share the copy expect(screen.getAllByText('Allowed File Types')).toHaveLength(2); expect(screen.getByText('API Keys')).toBeInTheDocument(); @@ -77,6 +95,33 @@ describe('MAdminSettingsSection', () => { expect(screen.getByText('Danger Zone')).toBeInTheDocument(); }); + it('FE-MOB-ASET-025: each section holds the cards of its desktop tab', () => { + const admin = buildAdminHook(); + const { unmount } = render(); + expect(screen.getByText('Authentication Methods')).toBeInTheDocument(); + expect(screen.getByText('Danger Zone')).toBeInTheDocument(); + expect(screen.queryByText('API Keys')).not.toBeInTheDocument(); + expect(screen.queryByText('Live flight status')).not.toBeInTheDocument(); + unmount(); + + const services = render(); + expect(screen.getByText('API Keys')).toBeInTheDocument(); + expect(screen.getAllByText('Allowed File Types').length).toBeGreaterThan(0); + expect(screen.queryByText('Authentication Methods')).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', () => { + renderSettings({ managed: true }); + expect(screen.queryByText('Danger Zone')).not.toBeInTheDocument(); + expect(screen.getByRole('switch', { name: 'Require 2FA' })).toBeInTheDocument(); + }); + it('FE-MOB-ASET-002: the OIDC toggles only appear once OIDC is configured', () => { renderSettings({ oidcConfigured: false }); @@ -140,7 +185,7 @@ describe('MAdminSettingsSection', () => { const user = userEvent.setup(); const admin = renderSettings({ requireMfa: false }); - await user.click(toggle('Require two-factor authentication (2FA)')); + await user.click(toggle('Require 2FA')); expect(admin.handleToggleRequireMfa).toHaveBeenCalledWith(true); }); diff --git a/client/tests/unit/mobile/admin/MAdminUsersSection.test.tsx b/client/tests/unit/mobile/admin/MAdminUsersSection.test.tsx index 7f573959b..c2090a197 100644 --- a/client/tests/unit/mobile/admin/MAdminUsersSection.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminUsersSection.test.tsx @@ -7,6 +7,7 @@ import { resetAllStores } from '../../../helpers/store'; import { buildAdminHook, buildAdminUser, type AdminHook } from '../../../helpers/mobileAdmin'; import { useTranslation } from '../../../../src/i18n'; import MAdminUsersSection from '../../../../src/mobile/screens/admin/MAdminUsersSection'; +import { mobileOptionLabels, pickMobileOption } from '../../../helpers/mobileSelect'; // The permissions matrix self-loads and has its own suite — stub it out here. vi.mock('../../../../src/mobile/screens/admin/MAdminPermissionsPanel', () => ({ @@ -232,15 +233,15 @@ describe('MAdminUsersSection', () => { />, ); - const select = screen.getByRole('combobox') as HTMLSelectElement; - expect(screen.getByRole('option', { name: 'No trip' })).toBeInTheDocument(); - expect(select.value).toBe(''); + const select = screen.getByRole('combobox'); + const name = select.getAttribute('aria-label') ?? ''; + expect(select).toHaveTextContent('No trip'); + expect(await mobileOptionLabels(user, name)).toEqual(['No trip', 'Japan 2026']); + await user.click(within(screen.getByRole('dialog', { name })).getByRole('button', { name: 'Japan 2026' })); + expect(screen.getByRole('combobox')).toHaveTextContent('Japan 2026'); - fireEvent.change(select, { target: { value: '4' } }); - expect((screen.getByRole('combobox') as HTMLSelectElement).value).toBe('4'); - - fireEvent.change(select, { target: { value: '' } }); - expect((screen.getByRole('combobox') as HTMLSelectElement).value).toBe(''); + await pickMobileOption(user, name, 'No trip'); + expect(screen.getByRole('combobox')).toHaveTextContent('No trip'); await user.click(screen.getByRole('button', { name: 'Create & Copy' })); expect(handleCreateInvite).toHaveBeenCalled(); diff --git a/shared/src/i18n/ar/admin.ts b/shared/src/i18n/ar/admin.ts index 0f90e0c6e..7ba5857da 100644 --- a/shared/src/i18n/ar/admin.ts +++ b/shared/src/i18n/ar/admin.ts @@ -132,12 +132,11 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'تم حذف رابط الدعوة', 'admin.invite.createError': 'فشل إنشاء رابط الدعوة', 'admin.invite.deleteError': 'فشل حذف رابط الدعوة', - 'admin.tabs.settings': 'الإعدادات', 'admin.tabs.security': 'الأمان', 'admin.tabs.services': 'الخدمات', 'admin.allowRegistration': 'السماح بالتسجيل', 'admin.allowRegistrationHint': 'يمكن للمستخدمين الجدد التسجيل بأنفسهم', - 'admin.requireMfa': 'فرض المصادقة الثنائية (2FA)', + 'admin.requireMfa': 'فرض 2FA', 'admin.requireMfaHint': 'يجب على المستخدمين الذين لا يملكون 2FA إكمال الإعداد في الإعدادات قبل استخدام التطبيق.', 'admin.apiKeys': 'مفاتيح API', 'admin.apiKeysHint': 'من أين تأتي بيانات الأماكن. فهرس TREK لا يحتاج مفتاحًا؛ والمزوّدان أدناه اختياريان.', diff --git a/shared/src/i18n/az/admin.ts b/shared/src/i18n/az/admin.ts index 4c46f3542..2c0842ca5 100644 --- a/shared/src/i18n/az/admin.ts +++ b/shared/src/i18n/az/admin.ts @@ -131,7 +131,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Dəvət keçidi silindi', 'admin.invite.createError': 'Dəvət keçidi yaratmaq mümkün olmadı', 'admin.invite.deleteError': 'Dəvət keçidini silmək mümkün olmadı', - 'admin.tabs.settings': 'Tənzimləmələr', 'admin.tabs.security': 'Təhlükəsizlik', 'admin.tabs.services': 'Xidmətlər', 'admin.allowRegistration': 'Qeydiyyata icazə ver', @@ -151,7 +150,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Parolla giriş tənzimləmələri OIDC_ONLY mühit dəyişəni ilə idarə olunur və burada dəyişdirilə bilməz.', 'admin.lockoutWarning': 'Ən azı bir giriş üsulu aktiv qalmalıdır', - 'admin.requireMfa': 'İki faktorlu doğrulamanı (2FA) tələb et', + 'admin.requireMfa': '2FA tələb et', 'admin.requireMfaHint': '2FA-sı olmayan istifadəçilər tətbiqdən istifadə etməzdən əvvəl Tənzimləmələr bölməsində quraşdırmanı tamamlamalıdırlar.', 'admin.apiKeys': 'API açarları', diff --git a/shared/src/i18n/br/admin.ts b/shared/src/i18n/br/admin.ts index d9a2c47ac..7603841d5 100644 --- a/shared/src/i18n/br/admin.ts +++ b/shared/src/i18n/br/admin.ts @@ -75,7 +75,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Link de convite excluído', 'admin.invite.createError': 'Falha ao criar link de convite', 'admin.invite.deleteError': 'Falha ao excluir link de convite', - 'admin.tabs.settings': 'Configurações', 'admin.tabs.security': 'Segurança', 'admin.tabs.services': 'Serviços', 'admin.allowRegistration': 'Permitir cadastro', @@ -95,7 +94,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'As configurações de login com senha são controladas pela variável de ambiente OIDC_ONLY e não podem ser alteradas aqui.', 'admin.lockoutWarning': 'Pelo menos um método de login deve permanecer ativado', - 'admin.requireMfa': 'Exigir autenticação em dois fatores (2FA)', + 'admin.requireMfa': 'Exigir 2FA', 'admin.requireMfaHint': 'Usuários sem 2FA precisam concluir a configuração em Configurações antes de usar o app.', 'admin.apiKeys': 'Chaves de API', 'admin.apiKeysHint': diff --git a/shared/src/i18n/ca/admin.ts b/shared/src/i18n/ca/admin.ts index d312ad90b..50da457bd 100644 --- a/shared/src/i18n/ca/admin.ts +++ b/shared/src/i18n/ca/admin.ts @@ -81,7 +81,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Enllaç de convidada eliminat', 'admin.invite.createError': "Error en crear l'enllaç", 'admin.invite.deleteError': "Error en eliminar l'enllaç", - 'admin.tabs.settings': 'Configuració', 'admin.tabs.security': 'Seguretat', 'admin.tabs.services': 'Serveis', 'admin.allowRegistration': 'Permetre el registre', @@ -101,7 +100,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': "La configuració d'inici de sessió amb contrasenya està controlada per la variable d'entorn OIDC_ONLY i no es pot canviar aquí.", 'admin.lockoutWarning': "Almenys un mètode d'inici de sessió ha de romandre activat", - 'admin.requireMfa': 'Exigir autenticació de dos factors (2FA)', + 'admin.requireMfa': 'Exigir 2FA', 'admin.requireMfaHint': "Els usuaris sense 2FA han de completar la configuració a Ajustos abans d'utilitzar l'aplicació.", 'admin.apiKeys': 'Claus API', diff --git a/shared/src/i18n/cs/admin.ts b/shared/src/i18n/cs/admin.ts index 2dc079b57..328a360db 100644 --- a/shared/src/i18n/cs/admin.ts +++ b/shared/src/i18n/cs/admin.ts @@ -79,7 +79,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Pozvánka smazána', 'admin.invite.createError': 'Nepodařilo se vytvořit pozvánku', 'admin.invite.deleteError': 'Nepodařilo se smazat pozvánku', - 'admin.tabs.settings': 'Nastavení', 'admin.tabs.security': 'Zabezpečení', 'admin.tabs.services': 'Služby', 'admin.allowRegistration': 'Povolit registraci', @@ -98,7 +97,7 @@ const admin: TranslationStrings = { 'Když je přihlášení heslem vypnuté, návštěvníci jsou hned přesměrováni k poskytovateli identity. Vypněte to, aby se nejdřív zobrazila přihlašovací stránka s tlačítkem SSO.', 'admin.envOverrideHint': 'Nastavení přihlášení heslem řídí proměnná prostředí OIDC_ONLY a nelze je zde změnit.', 'admin.lockoutWarning': 'Alespoň jedna metoda přihlášení musí zůstat povolená', - 'admin.requireMfa': 'Vyžadovat dvoufázové ověření (2FA)', + 'admin.requireMfa': 'Vyžadovat 2FA', 'admin.requireMfaHint': 'Uživatelé bez 2FA musí dokončit nastavení v Nastavení před použitím aplikace.', 'admin.apiKeys': 'API klíče', 'admin.apiKeysHint': 'Odkud pocházejí data míst. Index TREK nepotřebuje klíč; dva poskytovatelé níže jsou volitelní.', diff --git a/shared/src/i18n/de/admin.ts b/shared/src/i18n/de/admin.ts index 635b30052..51c87d05e 100644 --- a/shared/src/i18n/de/admin.ts +++ b/shared/src/i18n/de/admin.ts @@ -76,7 +76,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Einladungslink gelöscht', 'admin.invite.createError': 'Fehler beim Erstellen des Einladungslinks', 'admin.invite.deleteError': 'Fehler beim Löschen des Einladungslinks', - 'admin.tabs.settings': 'Einstellungen', 'admin.tabs.security': 'Sicherheit', 'admin.tabs.services': 'Dienste', 'admin.allowRegistration': 'Registrierung erlauben', @@ -96,7 +95,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Die Einstellungen zur Passwort-Anmeldung werden über die Umgebungsvariable OIDC_ONLY gesteuert und lassen sich hier nicht ändern.', 'admin.lockoutWarning': 'Mindestens eine Anmeldemethode muss aktiviert bleiben', - 'admin.requireMfa': 'Zwei-Faktor-Authentifizierung (2FA) für alle verlangen', + 'admin.requireMfa': '2FA verlangen', 'admin.requireMfaHint': 'Benutzer ohne 2FA müssen die Einrichtung unter Einstellungen abschließen, bevor sie die App nutzen können.', 'admin.apiKeys': 'API-Schlüssel', diff --git a/shared/src/i18n/en/admin.ts b/shared/src/i18n/en/admin.ts index cfd1a8262..ce46ddac3 100644 --- a/shared/src/i18n/en/admin.ts +++ b/shared/src/i18n/en/admin.ts @@ -127,7 +127,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Invite link deleted', 'admin.invite.createError': 'Failed to create invite link', 'admin.invite.deleteError': 'Failed to delete invite link', - 'admin.tabs.settings': 'Settings', 'admin.tabs.security': 'Security', 'admin.tabs.services': 'Services', 'admin.allowRegistration': 'Allow Registration', @@ -147,7 +146,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Password login settings are controlled by the OIDC_ONLY environment variable and cannot be changed here.', 'admin.lockoutWarning': 'At least one login method must remain enabled', - 'admin.requireMfa': 'Require two-factor authentication (2FA)', + 'admin.requireMfa': 'Require 2FA', 'admin.requireMfaHint': 'Users without 2FA must complete setup in Settings before using the app.', 'admin.apiKeys': 'API Keys', 'admin.apiKeysHint': diff --git a/shared/src/i18n/es/admin.ts b/shared/src/i18n/es/admin.ts index bb7e5ca23..0f252fa09 100644 --- a/shared/src/i18n/es/admin.ts +++ b/shared/src/i18n/es/admin.ts @@ -76,7 +76,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Enlace de invitación eliminado', 'admin.invite.createError': 'Error al crear el enlace', 'admin.invite.deleteError': 'Error al eliminar el enlace', - 'admin.tabs.settings': 'Ajustes', 'admin.tabs.security': 'Seguridad', 'admin.tabs.services': 'Servicios', 'admin.allowRegistration': 'Permitir el registro', @@ -96,7 +95,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Los ajustes del inicio de sesión con contraseña se controlan con la variable de entorno OIDC_ONLY y no se pueden cambiar aquí.', 'admin.lockoutWarning': 'Debe quedar activado al menos un método de inicio de sesión', - 'admin.requireMfa': 'Exigir autenticación en dos factores (2FA)', + 'admin.requireMfa': 'Exigir 2FA', 'admin.requireMfaHint': 'Los usuarios sin 2FA deben completar la configuración en Ajustes antes de usar la aplicación.', 'admin.apiKeys': 'Claves API', diff --git a/shared/src/i18n/et/admin.ts b/shared/src/i18n/et/admin.ts index 1048a533b..b6e07ccc1 100644 --- a/shared/src/i18n/et/admin.ts +++ b/shared/src/i18n/et/admin.ts @@ -129,7 +129,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Kutselink kustutatud', 'admin.invite.createError': 'Kutselingi loomine ebaõnnestus', 'admin.invite.deleteError': 'Kutselingi kustutamine ebaõnnestus', - 'admin.tabs.settings': 'Seaded', 'admin.tabs.security': 'Turvalisus', 'admin.tabs.services': 'Teenused', 'admin.allowRegistration': 'Luba registreerumine', @@ -149,7 +148,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Parooliga sisselogimise seadeid juhib keskkonnamuutuja OIDC_ONLY ja neid ei saa siin muuta.', 'admin.lockoutWarning': 'Vähemalt üks sisselogimisviis peab jääma lubatuks', - 'admin.requireMfa': 'Nõua kaheastmelist autentimist (2FA)', + 'admin.requireMfa': 'Nõua 2FA-d', 'admin.requireMfaHint': 'Ilma 2FA-ta kasutajad peavad enne rakenduse kasutamist selle seadetes seadistama.', 'admin.apiKeys': 'API-võtmed', 'admin.apiKeysHint': diff --git a/shared/src/i18n/fr/admin.ts b/shared/src/i18n/fr/admin.ts index 8beeae1a7..a2d1d69f8 100644 --- a/shared/src/i18n/fr/admin.ts +++ b/shared/src/i18n/fr/admin.ts @@ -75,7 +75,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': "Lien d'invitation supprimé", 'admin.invite.createError': 'Erreur lors de la création du lien', 'admin.invite.deleteError': 'Erreur lors de la suppression du lien', - 'admin.tabs.settings': 'Paramètres', 'admin.tabs.security': 'Sécurité', 'admin.tabs.services': 'Services', // same-as-en 'admin.allowRegistration': 'Autoriser les inscriptions', @@ -96,7 +95,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': "Les réglages de connexion par mot de passe sont contrôlés par la variable d'environnement OIDC_ONLY et ne peuvent pas être modifiés ici.", 'admin.lockoutWarning': 'Au moins une méthode de connexion doit rester activée', - 'admin.requireMfa': "Exiger l'authentification à deux facteurs (2FA)", + 'admin.requireMfa': 'Exiger la 2FA', 'admin.requireMfaHint': "Les utilisateurs sans 2FA doivent terminer la configuration dans Paramètres avant d'utiliser l'application.", 'admin.apiKeys': 'Clés API', diff --git a/shared/src/i18n/gr/admin.ts b/shared/src/i18n/gr/admin.ts index 40417b9ee..536f61399 100644 --- a/shared/src/i18n/gr/admin.ts +++ b/shared/src/i18n/gr/admin.ts @@ -131,7 +131,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Ο σύνδεσμος πρόσκλησης διαγράφηκε', 'admin.invite.createError': 'Αποτυχία δημιουργίας συνδέσμου πρόσκλησης', 'admin.invite.deleteError': 'Αποτυχία διαγραφής συνδέσμου πρόσκλησης', - 'admin.tabs.settings': 'Ρυθμίσεις', 'admin.tabs.security': 'Ασφάλεια', 'admin.tabs.services': 'Υπηρεσίες', 'admin.allowRegistration': 'Να επιτρέπονται οι εγγραφές', @@ -151,7 +150,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Οι ρυθμίσεις σύνδεσης με κωδικό ελέγχονται από τη μεταβλητή περιβάλλοντος OIDC_ONLY και δεν μπορούν να αλλάξουν εδώ.', 'admin.lockoutWarning': 'Πρέπει να παραμείνει ενεργοποιημένη τουλάχιστον μία μέθοδος σύνδεσης', - 'admin.requireMfa': 'Απαίτηση ελέγχου ταυτότητας δύο παραγόντων (2FA)', + 'admin.requireMfa': 'Απαίτηση 2FA', 'admin.requireMfaHint': 'Οι χρήστες χωρίς 2FA πρέπει να ολοκληρώσουν τη ρύθμιση στις Ρυθμίσεις πριν χρησιμοποιήσουν την εφαρμογή.', 'admin.apiKeys': 'Κλειδιά API', diff --git a/shared/src/i18n/he/admin.ts b/shared/src/i18n/he/admin.ts index d57e78d04..dd2f0a95b 100644 --- a/shared/src/i18n/he/admin.ts +++ b/shared/src/i18n/he/admin.ts @@ -129,7 +129,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'קישור ההזמנה נמחק', 'admin.invite.createError': 'יצירת קישור ההזמנה נכשלה', 'admin.invite.deleteError': 'מחיקת קישור ההזמנה נכשלה', - 'admin.tabs.settings': 'הגדרות', 'admin.tabs.security': 'אבטחה', 'admin.tabs.services': 'שירותים', 'admin.allowRegistration': 'אפשור הרשמה', @@ -148,7 +147,7 @@ const admin: TranslationStrings = { 'כשהתחברות עם סיסמה כבויה, המבקרים מועברים מיד לספק הזהות. כבו את האפשרות כדי להציג קודם את דף ההתחברות עם כפתור ה-SSO.', 'admin.envOverrideHint': 'הגדרות ההתחברות בסיסמה נשלטות על ידי משתנה הסביבה OIDC_ONLY ולא ניתן לשנות אותן כאן.', 'admin.lockoutWarning': 'לפחות שיטת התחברות אחת חייבת להישאר מופעלת', - 'admin.requireMfa': 'חיוב אימות דו-שלבי (2FA)', + 'admin.requireMfa': 'חיוב 2FA', 'admin.requireMfaHint': 'משתמשים ללא 2FA יצטרכו להשלים הגדרה בהגדרות לפני שימוש באפליקציה.', 'admin.apiKeys': 'מפתחות API', 'admin.apiKeysHint': 'מאיפה מגיעים נתוני המקומות. אינדקס TREK לא דורש מפתח; שני הספקים למטה אופציונליים.', diff --git a/shared/src/i18n/hu/admin.ts b/shared/src/i18n/hu/admin.ts index dc16a47a0..a53d6c365 100644 --- a/shared/src/i18n/hu/admin.ts +++ b/shared/src/i18n/hu/admin.ts @@ -75,7 +75,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Meghívó link törölve', 'admin.invite.createError': 'Nem sikerült létrehozni a meghívó linket', 'admin.invite.deleteError': 'Nem sikerült törölni a meghívó linket', - 'admin.tabs.settings': 'Beállítások', 'admin.tabs.security': 'Biztonság', 'admin.tabs.services': 'Szolgáltatások', 'admin.allowRegistration': 'Regisztráció engedélyezése', @@ -95,7 +94,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'A jelszavas bejelentkezés beállításait az OIDC_ONLY környezeti változó vezérli, itt nem módosíthatók.', 'admin.lockoutWarning': 'Legalább egy bejelentkezési módnak engedélyezve kell maradnia', - 'admin.requireMfa': 'Kétlépcsős hitelesítés (2FA) kötelezővé tétele', + 'admin.requireMfa': '2FA kötelezővé tétele', 'admin.requireMfaHint': 'A 2FA nélküli felhasználóknak a Beállításokban kell befejezniük a beállítást az alkalmazás használata előtt.', 'admin.apiKeys': 'API kulcsok', diff --git a/shared/src/i18n/id/admin.ts b/shared/src/i18n/id/admin.ts index 56049354b..6d031a00d 100644 --- a/shared/src/i18n/id/admin.ts +++ b/shared/src/i18n/id/admin.ts @@ -123,7 +123,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Tautan undangan dihapus', 'admin.invite.createError': 'Gagal membuat tautan undangan', 'admin.invite.deleteError': 'Gagal menghapus tautan undangan', - 'admin.tabs.settings': 'Pengaturan', 'admin.tabs.security': 'Keamanan', 'admin.tabs.services': 'Layanan', 'admin.allowRegistration': 'Izinkan Pendaftaran', @@ -143,7 +142,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Pengaturan login kata sandi dikendalikan oleh variabel lingkungan OIDC_ONLY dan tidak dapat diubah di sini.', 'admin.lockoutWarning': 'Minimal satu metode login harus tetap aktif', - 'admin.requireMfa': 'Wajibkan autentikasi dua faktor (2FA)', + 'admin.requireMfa': 'Wajibkan 2FA', 'admin.requireMfaHint': 'Pengguna tanpa 2FA harus menyelesaikan pengaturan di Pengaturan sebelum menggunakan aplikasi.', 'admin.apiKeys': 'Kunci API', diff --git a/shared/src/i18n/it/admin.ts b/shared/src/i18n/it/admin.ts index c089c6815..2eb190907 100644 --- a/shared/src/i18n/it/admin.ts +++ b/shared/src/i18n/it/admin.ts @@ -75,7 +75,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Link di invito eliminato', 'admin.invite.createError': 'Impossibile creare il link di invito', 'admin.invite.deleteError': 'Impossibile eliminare il link di invito', - 'admin.tabs.settings': 'Impostazioni', 'admin.tabs.security': 'Sicurezza', 'admin.tabs.services': 'Servizi', 'admin.allowRegistration': 'Consenti Registrazione', @@ -95,7 +94,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': "Le impostazioni di accesso con password sono controllate dalla variabile d'ambiente OIDC_ONLY e non possono essere modificate qui.", 'admin.lockoutWarning': 'Deve restare attivo almeno un metodo di accesso', - 'admin.requireMfa': 'Richiedi autenticazione a due fattori (2FA)', + 'admin.requireMfa': 'Richiedi 2FA', 'admin.requireMfaHint': "Gli utenti senza 2FA devono completare la configurazione in Impostazioni prima di usare l'app.", 'admin.apiKeys': 'Chiavi API', diff --git a/shared/src/i18n/ja/admin.ts b/shared/src/i18n/ja/admin.ts index e28871e3e..d12a0d8e0 100644 --- a/shared/src/i18n/ja/admin.ts +++ b/shared/src/i18n/ja/admin.ts @@ -117,7 +117,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': '招待リンクを削除しました', 'admin.invite.createError': '招待リンクの作成に失敗しました', 'admin.invite.deleteError': '招待リンクの削除に失敗しました', - 'admin.tabs.settings': '設定', 'admin.tabs.security': 'セキュリティ', 'admin.tabs.services': 'サービス', 'admin.allowRegistration': '登録を許可', @@ -136,7 +135,7 @@ const admin: TranslationStrings = { 'パスワードログインがオフのとき、訪問者はすぐに ID プロバイダーへ移動します。オフにすると、先に SSO ボタン付きのログインページを表示します。', 'admin.envOverrideHint': 'パスワードログイン設定は OIDC_ONLY 環境変数で制御されています。', 'admin.lockoutWarning': '少なくとも1つのログイン方法を有効にしてください', - 'admin.requireMfa': '二要素認証(2FA)を必須にする', + 'admin.requireMfa': '2FAを必須にする', 'admin.requireMfaHint': '2FA未設定のユーザーは、利用前に設定が必要です。', 'admin.apiKeys': 'APIキー', 'admin.apiKeysHint': '場所データの出どころ。TREK のインデックスにキーは不要で、下の二つの提供元は任意です。', diff --git a/shared/src/i18n/ko/admin.ts b/shared/src/i18n/ko/admin.ts index 4b44ecb5b..2d70f20f3 100644 --- a/shared/src/i18n/ko/admin.ts +++ b/shared/src/i18n/ko/admin.ts @@ -122,7 +122,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': '초대 링크가 삭제되었습니다', 'admin.invite.createError': '초대 링크 생성 실패', 'admin.invite.deleteError': '초대 링크 삭제 실패', - 'admin.tabs.settings': '설정', 'admin.tabs.security': '보안', 'admin.tabs.services': '서비스', 'admin.allowRegistration': '회원가입 허용', @@ -141,7 +140,7 @@ const admin: TranslationStrings = { '비밀번호 로그인이 꺼져 있으면 방문자는 바로 ID 공급자로 이동합니다. 끄면 SSO 버튼이 있는 로그인 페이지를 먼저 보여 줍니다.', 'admin.envOverrideHint': '비밀번호 로그인 설정은 OIDC_ONLY 환경 변수로 제어되며 여기서 변경할 수 없습니다.', 'admin.lockoutWarning': '최소 하나의 로그인 방법이 활성화되어 있어야 합니다', - 'admin.requireMfa': '2단계 인증 (2FA) 요구', + 'admin.requireMfa': '2FA 요구', 'admin.requireMfaHint': '2FA가 없는 사용자는 앱을 사용하기 전에 설정에서 설정을 완료해야 합니다.', 'admin.apiKeys': 'API 키', 'admin.apiKeysHint': '장소 데이터의 출처. TREK 색인에는 키가 필요 없으며, 아래 두 제공자는 선택 사항입니다.', diff --git a/shared/src/i18n/nl/admin.ts b/shared/src/i18n/nl/admin.ts index aca234b84..d17712d66 100644 --- a/shared/src/i18n/nl/admin.ts +++ b/shared/src/i18n/nl/admin.ts @@ -76,7 +76,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Uitnodigingslink verwijderd', 'admin.invite.createError': 'Fout bij aanmaken van link', 'admin.invite.deleteError': 'Fout bij verwijderen van link', - 'admin.tabs.settings': 'Instellingen', 'admin.tabs.security': 'Beveiliging', 'admin.tabs.services': 'Diensten', 'admin.allowRegistration': 'Registratie toestaan', @@ -96,7 +95,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'De instellingen voor inloggen met wachtwoord worden beheerd via de omgevingsvariabele OIDC_ONLY en kunnen hier niet worden gewijzigd.', 'admin.lockoutWarning': 'Er moet minstens één inlogmethode ingeschakeld blijven', - 'admin.requireMfa': 'Tweestapsverificatie (2FA) verplichten', + 'admin.requireMfa': '2FA verplichten', 'admin.requireMfaHint': 'Gebruikers zonder 2FA moeten de installatie in Instellingen voltooien voordat ze de app kunnen gebruiken.', 'admin.apiKeys': 'API-sleutels', diff --git a/shared/src/i18n/pl/admin.ts b/shared/src/i18n/pl/admin.ts index 3b6bdcf3f..59e90b492 100644 --- a/shared/src/i18n/pl/admin.ts +++ b/shared/src/i18n/pl/admin.ts @@ -72,7 +72,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Link zaproszenia został usunięty', 'admin.invite.createError': 'Nie udało się utworzyć linku zaproszenia', 'admin.invite.deleteError': 'Nie udało się usunąć linku zaproszenia', - 'admin.tabs.settings': 'Ustawienia', 'admin.tabs.security': 'Bezpieczeństwo', 'admin.tabs.services': 'Usługi', 'admin.allowRegistration': 'Zezwól na rejestrację', @@ -92,7 +91,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Ustawienia logowania hasłem są kontrolowane przez zmienną środowiskową OIDC_ONLY i nie można ich tu zmienić.', 'admin.lockoutWarning': 'Co najmniej jedna metoda logowania musi pozostać włączona', - 'admin.requireMfa': 'Wymagaj uwierzytelniania dwuskładnikowego (2FA)', + 'admin.requireMfa': 'Wymagaj 2FA', 'admin.requireMfaHint': 'Użytkownicy bez 2FA muszą ukończyć konfigurację w Ustawieniach zanim zaczną korzystać z aplikacji.', 'admin.apiKeys': 'Klucze API', diff --git a/shared/src/i18n/ru/admin.ts b/shared/src/i18n/ru/admin.ts index 519bfb541..ff23f4182 100644 --- a/shared/src/i18n/ru/admin.ts +++ b/shared/src/i18n/ru/admin.ts @@ -84,7 +84,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Ссылка-приглашение удалена', 'admin.invite.createError': 'Ошибка при создании ссылки', 'admin.invite.deleteError': 'Ошибка при удалении ссылки', - 'admin.tabs.settings': 'Настройки', 'admin.tabs.security': 'Безопасность', 'admin.tabs.services': 'Сервисы', 'admin.allowRegistration': 'Разрешить регистрацию', @@ -104,7 +103,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Настройки входа по паролю управляются переменной окружения OIDC_ONLY и не могут быть изменены здесь.', 'admin.lockoutWarning': 'Должен оставаться включённым хотя бы один способ входа', - 'admin.requireMfa': 'Требовать двухфакторную аутентификацию (2FA)', + 'admin.requireMfa': 'Требовать 2FA', 'admin.requireMfaHint': 'Пользователи без 2FA должны завершить настройку в разделе «Настройки» перед использованием приложения.', 'admin.apiKeys': 'API-ключи', diff --git a/shared/src/i18n/sk/admin.ts b/shared/src/i18n/sk/admin.ts index d8b8f12eb..b9c6a084f 100644 --- a/shared/src/i18n/sk/admin.ts +++ b/shared/src/i18n/sk/admin.ts @@ -131,7 +131,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Pozývací odkaz odstránený', 'admin.invite.createError': 'Nepodarilo sa vytvoriť pozývací odkaz', 'admin.invite.deleteError': 'Nepodarilo sa odstrániť pozývací odkaz', - 'admin.tabs.settings': 'Nastavenia', 'admin.tabs.security': 'Zabezpečenie', 'admin.tabs.services': 'Služby', 'admin.allowRegistration': 'Povoliť registráciu', @@ -150,7 +149,7 @@ const admin: TranslationStrings = { 'Keď je prihlásenie heslom vypnuté, návštevníci sú hneď presmerovaní k poskytovateľovi identity. Vypnite to, aby sa najprv zobrazila prihlasovacia stránka s tlačidlom SSO.', 'admin.envOverrideHint': 'Nastavenia prihlásenia heslom riadi premenná prostredia OIDC_ONLY a nedajú sa tu zmeniť.', 'admin.lockoutWarning': 'Aspoň jedna metóda prihlásenia musí zostať zapnutá', - 'admin.requireMfa': 'Vyžadovať dvojfaktorové overenie (2FA)', + 'admin.requireMfa': 'Vyžadovať 2FA', 'admin.requireMfaHint': 'Používatelia bez 2FA musia pred použitím aplikácie dokončiť nastavenie v Nastaveniach.', 'admin.apiKeys': 'API kľúče', 'admin.apiKeysHint': diff --git a/shared/src/i18n/sv/admin.ts b/shared/src/i18n/sv/admin.ts index fd5042852..934caa4fa 100644 --- a/shared/src/i18n/sv/admin.ts +++ b/shared/src/i18n/sv/admin.ts @@ -128,7 +128,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Inbjudningslänken har tagits bort', 'admin.invite.createError': 'Det gick inte att skapa en inbjudningslänk', 'admin.invite.deleteError': 'Det gick inte att ta bort inbjudningslänken', - 'admin.tabs.settings': 'Inställningar', 'admin.tabs.security': 'Säkerhet', 'admin.tabs.services': 'Tjänster', 'admin.allowRegistration': 'Tillåt registrering', @@ -148,7 +147,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Inställningarna för inloggning med lösenord styrs av miljövariabeln OIDC_ONLY och kan inte ändras här.', 'admin.lockoutWarning': 'Minst en inloggningsmetod måste vara aktiverad', - 'admin.requireMfa': 'Kräv tvåfaktorsautentisering (2FA)', + 'admin.requireMfa': 'Kräv 2FA', 'admin.requireMfaHint': 'Användare som inte har tvåfaktorsautentisering måste slutföra inställningarna under inställningar innan de använder appen.', 'admin.apiKeys': 'API Nycklar', diff --git a/shared/src/i18n/th/admin.ts b/shared/src/i18n/th/admin.ts index ba25e7054..6f88daf9d 100644 --- a/shared/src/i18n/th/admin.ts +++ b/shared/src/i18n/th/admin.ts @@ -123,7 +123,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'ลบลิงก์คำเชิญแล้ว', 'admin.invite.createError': 'ไม่สามารถสร้างลิงก์คำเชิญได้', 'admin.invite.deleteError': 'ลบลิงก์คำเชิญไม่สำเร็จ', - 'admin.tabs.settings': 'การตั้งค่า', 'admin.tabs.security': 'ความปลอดภัย', 'admin.tabs.services': 'บริการ', 'admin.allowRegistration': 'อนุญาตให้ลงทะเบียน', @@ -143,7 +142,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'การตั้งค่าการเข้าสู่ระบบด้วยรหัสผ่านได้รับการควบคุมโดยตัวแปรสภาพแวดล้อม OIDC_ONLY และไม่สามารถเปลี่ยนแปลงได้ที่นี่', 'admin.lockoutWarning': 'ต้องเปิดใช้งานวิธีการเข้าสู่ระบบอย่างน้อยหนึ่งวิธี', - 'admin.requireMfa': 'ต้องมีการรับรองความถูกต้องด้วยสองปัจจัย (2FA)', + 'admin.requireMfa': 'บังคับใช้ 2FA', 'admin.requireMfaHint': 'ผู้ใช้ที่ไม่มี 2FA ต้องตั้งค่าในการตั้งค่าให้เสร็จสิ้นก่อนจึงจะใช้แอปได้', 'admin.apiKeys': 'คีย์ API', 'admin.apiKeysHint': 'ไม่จำเป็น เปิดใช้งานข้อมูลสถานที่แบบขยาย เช่น รูปภาพและสภาพอากาศ', diff --git a/shared/src/i18n/tr/admin.ts b/shared/src/i18n/tr/admin.ts index 65168ff5b..6d023b2a9 100644 --- a/shared/src/i18n/tr/admin.ts +++ b/shared/src/i18n/tr/admin.ts @@ -128,7 +128,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Davet bağlantısı silindi', 'admin.invite.createError': 'Davet bağlantısı oluşturulamadı', 'admin.invite.deleteError': 'Davet bağlantısı silinemedi', - 'admin.tabs.settings': 'Ayarlar', 'admin.tabs.security': 'Güvenlik', 'admin.tabs.services': 'Hizmetler', 'admin.allowRegistration': 'Kayda İzin Ver', @@ -148,7 +147,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Şifre oturum açma ayarları OIDC_ONLY ortam değişkeni tarafından kontrol edilir ve burada değiştirilemez.', 'admin.lockoutWarning': 'En az bir oturum açma yöntemi etkin kalmalıdır', - 'admin.requireMfa': 'İki faktörlü kimlik doğrulama (2FA) gerektir', + 'admin.requireMfa': '2FA gerektir', 'admin.requireMfaHint': "2FA'sı olmayan kullanıcıların uygulamayı kullanmadan önce Ayarlar'da kurulumu tamamlaması gerekir.", 'admin.apiKeys': 'API Anahtarları', diff --git a/shared/src/i18n/uk/admin.ts b/shared/src/i18n/uk/admin.ts index f4b317b6b..873b6cccc 100644 --- a/shared/src/i18n/uk/admin.ts +++ b/shared/src/i18n/uk/admin.ts @@ -84,7 +84,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Посилання-запрошення видалено', 'admin.invite.createError': 'Помилка створення посилання', 'admin.invite.deleteError': 'Помилка видалення посилання', - 'admin.tabs.settings': 'Налаштування', 'admin.tabs.security': 'Безпека', 'admin.tabs.services': 'Сервіси', 'admin.allowRegistration': 'Дозволити реєстрацію', @@ -104,7 +103,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Налаштування входу за паролем контролюються змінною середовища OIDC_ONLY і не можуть бути змінені тут.', 'admin.lockoutWarning': 'Потрібно залишити увімкненим принаймні один метод входу', - 'admin.requireMfa': 'Вимагати двофакторну автентифікацію (2FA)', + 'admin.requireMfa': 'Вимагати 2FA', 'admin.requireMfaHint': 'Користувачі без 2FA повинні завершити налаштування в розділі «Налаштування» перед використанням програми.', 'admin.apiKeys': 'API-ключі', diff --git a/shared/src/i18n/vi/admin.ts b/shared/src/i18n/vi/admin.ts index 4228edb0e..9a5ac5e8e 100644 --- a/shared/src/i18n/vi/admin.ts +++ b/shared/src/i18n/vi/admin.ts @@ -124,7 +124,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': 'Đã xóa liên kết mời', 'admin.invite.createError': 'Không tạo được liên kết mời', 'admin.invite.deleteError': 'Không xóa được liên kết mời', - 'admin.tabs.settings': 'Cài đặt', 'admin.tabs.security': 'Bảo mật', 'admin.tabs.services': 'Dịch vụ', 'admin.allowRegistration': 'Cho phép đăng ký', @@ -144,7 +143,7 @@ const admin: TranslationStrings = { 'admin.envOverrideHint': 'Cài đặt đăng nhập mật khẩu được kiểm soát bởi biến môi trường OIDC_ONLY và không thể thay đổi tại đây.', 'admin.lockoutWarning': 'Ít nhất một phương thức đăng nhập phải được bật', - 'admin.requireMfa': 'Yêu cầu xác thực hai yếu tố (2FA)', + 'admin.requireMfa': 'Yêu cầu 2FA', 'admin.requireMfaHint': 'Người dùng không có 2FA phải hoàn tất thiết lập trong Cài đặt trước khi sử dụng ứng dụng.', 'admin.apiKeys': 'API Key', 'admin.apiKeysHint': diff --git a/shared/src/i18n/zh-TW/admin.ts b/shared/src/i18n/zh-TW/admin.ts index 2aa5e7d7b..fdf8d575c 100644 --- a/shared/src/i18n/zh-TW/admin.ts +++ b/shared/src/i18n/zh-TW/admin.ts @@ -120,7 +120,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': '邀請連結已刪除', 'admin.invite.createError': '建立連結失敗', 'admin.invite.deleteError': '刪除連結失敗', - 'admin.tabs.settings': '設定', 'admin.tabs.security': '安全性', 'admin.tabs.services': '服務', 'admin.allowRegistration': '允許註冊', @@ -138,7 +137,7 @@ const admin: TranslationStrings = { 'admin.oidcAutoRedirectHint': '關閉密碼登入後,訪客會被直接帶到身分提供者。關閉此項可先顯示含有 SSO 按鈕的登入頁面。', 'admin.envOverrideHint': '密碼登入設定由環境變數 OIDC_ONLY 控制,無法在此變更。', 'admin.lockoutWarning': '至少須保留一種登入方式', - 'admin.requireMfa': '要求雙因素身份驗證(2FA)', + 'admin.requireMfa': '要求 2FA', 'admin.requireMfaHint': '未啟用 2FA 的使用者必須先完成設定中的配置才能使用應用。', 'admin.apiKeys': 'API 金鑰', 'admin.apiKeysHint': '地點資料從哪裡來。TREK 索引不需要金鑰,下面兩個提供者是選用的。', diff --git a/shared/src/i18n/zh/admin.ts b/shared/src/i18n/zh/admin.ts index ebbe660b4..022824244 100644 --- a/shared/src/i18n/zh/admin.ts +++ b/shared/src/i18n/zh/admin.ts @@ -72,7 +72,6 @@ const admin: TranslationStrings = { 'admin.invite.deleted': '邀请链接已删除', 'admin.invite.createError': '创建链接失败', 'admin.invite.deleteError': '删除链接失败', - 'admin.tabs.settings': '设置', 'admin.tabs.security': '安全', 'admin.tabs.services': '服务', 'admin.allowRegistration': '允许注册', @@ -90,7 +89,7 @@ const admin: TranslationStrings = { 'admin.oidcAutoRedirectHint': '关闭密码登录后,访客会被直接带到身份提供商。关闭此项可先显示带有 SSO 按钮的登录页。', 'admin.envOverrideHint': '密码登录设置由 OIDC_ONLY 环境变量控制,无法在此处修改。', 'admin.lockoutWarning': '至少需要保留一种登录方式', - 'admin.requireMfa': '要求双因素身份验证(2FA)', + 'admin.requireMfa': '要求 2FA', 'admin.requireMfaHint': '未启用 2FA 的用户必须先完成设置中的配置才能使用应用。', 'admin.apiKeys': 'API 密钥', 'admin.apiKeysHint': '地点数据从哪里来。TREK 索引不需要密钥,下面两个提供方是可选的。',