mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 22:27:32 +00:00
feat(demo): lock the demo account's settings under a striped demo overlay
The demo account can look at its Account tab, API keys, MCP configuration, own AI connection and language, but not change them, and the server already refuses each of those writes. DemoLock renders such a section dimmed and out of reach under diagonal stripes in theme tokens, with a small Demo mode badge and one line saying why; useDemoAccountLock decides, on the desktop settings and the phone screens alike (a new pair in feature-pairs.json). Locked: the whole Account tab (profile, password, 2FA, passkeys, deletion), API keys, the MCP card with its tokens and connected apps, connecting an own AI model and the language picker, which shows English. The admin of a demo instance sees everything unlocked, 2FA included, so the old instance wide "Not available in demo mode" line under 2FA and its key are gone from all locales.
This commit is contained in:
@@ -661,6 +661,22 @@
|
||||
"desktop": ["src/components/Roadtrip/RoadtripStayModal.tsx"],
|
||||
"mobile": ["src/mobile/screens/trip/roadtrip/MRtStaySheet.tsx"]
|
||||
},
|
||||
{
|
||||
"feature": "Settings / Demo account locks",
|
||||
"hooks": ["src/components/Demo/useDemoLock.ts"],
|
||||
"desktop": [
|
||||
"src/components/Settings/AccountTab.tsx",
|
||||
"src/components/Settings/DisplaySettingsTab.tsx",
|
||||
"src/components/Settings/IntegrationsTab.tsx",
|
||||
"src/components/Settings/ai/AiConnectionSection.tsx"
|
||||
],
|
||||
"mobile": [
|
||||
"src/mobile/screens/settings/MAiConnectionSection.tsx",
|
||||
"src/mobile/screens/settings/MSettingsAccount.tsx",
|
||||
"src/mobile/screens/settings/MSettingsGeneral.tsx",
|
||||
"src/mobile/screens/settings/MSettingsMcp.tsx"
|
||||
]
|
||||
},
|
||||
{
|
||||
"feature": "Settings / Account",
|
||||
"hooks": ["src/components/Settings/useAccountSettings.ts"],
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
"mobile/screens/settings/MSetPickerSheet.tsx": 2,
|
||||
"mobile/screens/settings/MSettings.tsx": 2,
|
||||
"mobile/screens/settings/MSettingsAbout.tsx": 5,
|
||||
"mobile/screens/settings/MSettingsAccount.tsx": 21,
|
||||
"mobile/screens/settings/MSettingsAccount.tsx": 20,
|
||||
"mobile/screens/settings/MSettingsAppearance.tsx": 12,
|
||||
"mobile/screens/settings/MSettingsMap.tsx": 5,
|
||||
"mobile/screens/settings/MSettingsMcp.tsx": 30,
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { render, screen } from '../../../tests/helpers/render';
|
||||
import DemoLock from './DemoLock';
|
||||
|
||||
describe('DemoLock', () => {
|
||||
it('FE-COMP-DEMOLOCK-001: unlocked, the section is the section and nothing more', () => {
|
||||
const { container } = render(
|
||||
<DemoLock locked={false} reason="Not here.">
|
||||
<button type="button">Create key</button>
|
||||
</DemoLock>
|
||||
);
|
||||
expect(screen.getByRole('button', { name: 'Create key' })).toBeEnabled();
|
||||
expect(screen.queryByRole('note')).not.toBeInTheDocument();
|
||||
expect(container.querySelector('[data-demo-lock]')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-COMP-DEMOLOCK-002: locked, the section stays visible but out of reach, under the badge and the reason', () => {
|
||||
const { container } = render(
|
||||
<DemoLock locked reason="API keys cannot be created in the demo.">
|
||||
<button type="button">Create key</button>
|
||||
</DemoLock>
|
||||
);
|
||||
const note = screen.getByRole('note');
|
||||
expect(note).toHaveTextContent('Demo mode');
|
||||
expect(note).toHaveTextContent('API keys cannot be created in the demo.');
|
||||
expect(screen.queryByRole('button', { name: 'Create key' })).not.toBeInTheDocument();
|
||||
const veiled = container.querySelector('[data-demo-lock] > [inert]');
|
||||
expect(veiled).toHaveAttribute('aria-hidden', 'true');
|
||||
expect(veiled).toContainElement(screen.getByRole('button', { hidden: true, name: 'Create key' }));
|
||||
expect(note.getAttribute('style')).toContain('repeating-linear-gradient');
|
||||
expect(note.getAttribute('style')).toContain('var(--text-primary)');
|
||||
});
|
||||
|
||||
it('FE-COMP-DEMOLOCK-003: a single row puts the note in its middle, a section at its top', () => {
|
||||
const { rerender } = render(
|
||||
<DemoLock locked reason="r" size="row">
|
||||
<span>row</span>
|
||||
</DemoLock>
|
||||
);
|
||||
expect(screen.getByRole('note').className).toContain('items-center');
|
||||
rerender(
|
||||
<DemoLock locked reason="r">
|
||||
<span>section</span>
|
||||
</DemoLock>
|
||||
);
|
||||
expect(screen.getByRole('note').className).toContain('items-start');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
import { Lock } from 'lucide-react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useTranslation } from '../../i18n';
|
||||
import { fs } from '../shared/DialogShell';
|
||||
|
||||
interface DemoLockProps {
|
||||
/** From useDemoAccountLock: false renders the children untouched. */
|
||||
locked: boolean;
|
||||
/** One line saying what the demo does not allow here. */
|
||||
reason: string;
|
||||
children: ReactNode;
|
||||
/** `row` for a single settings row: the note sits in the middle instead of at the top. */
|
||||
size?: 'section' | 'row';
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/** Thin diagonal stripes in the theme's own ink, so they read in light and dark alike. */
|
||||
const STRIPES =
|
||||
'repeating-linear-gradient(135deg, color-mix(in srgb, var(--text-primary) 8%, transparent) 0 9px, transparent 9px 18px)';
|
||||
|
||||
/**
|
||||
* A section the shared demo account may look at but not change: dimmed,
|
||||
* out of reach for pointer and keyboard, under a striped veil that carries a
|
||||
* small "Demo mode" badge and the reason. Used on the desktop settings and on
|
||||
* the phone screens alike.
|
||||
*/
|
||||
export default function DemoLock({ locked, reason, children, size = 'section', className = '' }: DemoLockProps) {
|
||||
const { t } = useTranslation();
|
||||
if (!locked) return <>{children}</>;
|
||||
return (
|
||||
<div className={`relative ${className}`} data-demo-lock="">
|
||||
<div inert aria-hidden="true" className="pointer-events-none select-none opacity-40 saturate-50">
|
||||
{children}
|
||||
</div>
|
||||
<div
|
||||
role="note"
|
||||
className={`absolute inset-0 flex justify-center rounded-2xl border border-dashed border-edge-secondary ${
|
||||
size === 'row' ? 'items-center p-1' : 'items-start p-3'
|
||||
}`}
|
||||
style={{ background: STRIPES }}
|
||||
>
|
||||
<div className="sticky top-3 flex max-w-full flex-wrap items-center justify-center gap-x-2.5 gap-y-1 rounded-2xl bg-surface-card px-3 py-2 text-center shadow-md ring-1 ring-edge-faint">
|
||||
<span
|
||||
className="inline-flex flex-none items-center gap-1 rounded-full bg-accent px-2 py-0.5 font-semibold uppercase tracking-[.06em] text-accent-text"
|
||||
style={fs(10)}
|
||||
>
|
||||
<Lock size={11} strokeWidth={2.4} aria-hidden />
|
||||
{t('demo.lock.badge')}
|
||||
</span>
|
||||
<span className="min-w-0 text-content-secondary" style={fs(12.5, 'body')}>
|
||||
{reason}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { buildUser } from '../../../tests/helpers/factories';
|
||||
import { resetAllStores, seedStore } from '../../../tests/helpers/store';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { useDemoAccountLock } from './useDemoLock';
|
||||
|
||||
beforeEach(() => resetAllStores());
|
||||
|
||||
describe('useDemoAccountLock', () => {
|
||||
it('FE-HOOK-DEMOLOCK-001: locks the demo account on a demo instance', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'demo@trek.app' }) });
|
||||
expect(renderHook(() => useDemoAccountLock()).result.current).toBe(true);
|
||||
});
|
||||
|
||||
it('FE-HOOK-DEMOLOCK-002: knows the address the demo account had before the rename', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'demo@nomad.app' }) });
|
||||
expect(renderHook(() => useDemoAccountLock()).result.current).toBe(true);
|
||||
});
|
||||
|
||||
it('FE-HOOK-DEMOLOCK-003: leaves the admin of a demo instance alone', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'admin@trek.app', role: 'admin' }) });
|
||||
expect(renderHook(() => useDemoAccountLock()).result.current).toBe(false);
|
||||
});
|
||||
|
||||
it('FE-HOOK-DEMOLOCK-004: leaves the demo address alone on an instance that is not a demo', () => {
|
||||
seedStore(useAuthStore, { demoMode: false, user: buildUser({ email: 'demo@trek.app' }) });
|
||||
expect(renderHook(() => useDemoAccountLock()).result.current).toBe(false);
|
||||
});
|
||||
|
||||
it('FE-HOOK-DEMOLOCK-005: is off while nobody is signed in', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: null });
|
||||
expect(renderHook(() => useDemoAccountLock()).result.current).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
import { isDemoAccountEmail } from '@trek/shared';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
|
||||
/**
|
||||
* Whether the account signed in here is the shared demo account of a demo
|
||||
* instance. Every visitor signs in as that one account, so its Account tab,
|
||||
* API keys, MCP configuration, own AI connection and language sit under a
|
||||
* DemoLock; the server refuses the same writes (`demo-write.ts`). The admin
|
||||
* of a demo instance, and every account of a real one, see the sections as
|
||||
* they are.
|
||||
*/
|
||||
export function useDemoAccountLock(): boolean {
|
||||
const demoMode = useAuthStore((s) => s.demoMode);
|
||||
const email = useAuthStore((s) => s.user?.email);
|
||||
return demoMode && isDemoAccountEmail(email);
|
||||
}
|
||||
@@ -395,10 +395,20 @@ describe('AccountTab – MFA', () => {
|
||||
expect(screen.getByText(/requires two-factor authentication/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-COMP-ACCOUNT-036: MFA section shows demoBlocked message in demo mode', () => {
|
||||
seedStore(useAuthStore, { demoMode: true });
|
||||
it('FE-COMP-ACCOUNT-036: the shared demo account sees the whole tab under the demo lock', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'demo@trek.app', mfa_enabled: false }) });
|
||||
const { container } = render(<AccountTab />);
|
||||
expect(screen.getByRole('note')).toHaveTextContent('The shared demo account cannot be changed.');
|
||||
expect(container.querySelector('[data-demo-lock] [inert]')).toContainElement(
|
||||
screen.getByRole('button', { hidden: true, name: /Set up authenticator/ }),
|
||||
);
|
||||
});
|
||||
|
||||
it('FE-COMP-ACCOUNT-036b: the admin of a demo instance keeps the tab unlocked, 2FA included', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'admin@trek.app', role: 'admin', mfa_enabled: false }) });
|
||||
render(<AccountTab />);
|
||||
expect(screen.getByText('Not available in demo mode')).toBeInTheDocument();
|
||||
expect(screen.queryByRole('note')).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /Set up authenticator/ })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import {
|
||||
SETTINGS_BUTTON, SETTINGS_BUTTON_DANGER, SETTINGS_BUTTON_PRIMARY, SettingRow, SettingRows, SettingsHint, StatusPill,
|
||||
} from './settingsKit'
|
||||
import { stripTrailingSlashes, useAccountSettings } from './useAccountSettings'
|
||||
import DemoLock from '../Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../Demo/useDemoLock'
|
||||
|
||||
/** The small turning ring a button shows while its request is on the way. */
|
||||
const SPINNER = 'h-3.5 w-3.5 flex-none animate-spin rounded-full border-2 border-current border-t-transparent'
|
||||
@@ -22,6 +24,7 @@ const EYEBROW = 'm-0 font-geist font-bold uppercase tracking-[.08em] text-conten
|
||||
export default function AccountTab(): React.ReactElement {
|
||||
const { t } = useTranslation()
|
||||
const blockedLabelId = useId()
|
||||
const demoLocked = useDemoAccountLock()
|
||||
const {
|
||||
user,
|
||||
demoMode,
|
||||
@@ -71,6 +74,8 @@ export default function AccountTab(): React.ReactElement {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* The shared demo account: everything here is shown, nothing can be changed. */}
|
||||
<DemoLock locked={demoLocked} reason={t('demo.lock.account')}>
|
||||
<Section title={t('settings.account')} icon={User}>
|
||||
{/* Who is signed in: the picture with its two actions, the role and the SSO link. */}
|
||||
<div className="flex items-center gap-4 rounded-[14px] border border-edge-faint bg-surface-card px-4 py-3.5">
|
||||
@@ -221,10 +226,7 @@ export default function AccountTab(): React.ReactElement {
|
||||
</div>
|
||||
)}
|
||||
<SettingsHint>{t('settings.mfa.description')}</SettingsHint>
|
||||
{demoMode ? (
|
||||
<p className="m-0 font-medium text-warning" style={fs(12.5, 'body')}>{t('settings.mfa.demoBlocked')}</p>
|
||||
) : (
|
||||
<>
|
||||
<>
|
||||
<SettingRows>
|
||||
<SettingRow
|
||||
label={user?.mfa_enabled ? t('settings.mfa.enabled') : t('settings.mfa.disabled')}
|
||||
@@ -357,12 +359,12 @@ export default function AccountTab(): React.ReactElement {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
</Section>
|
||||
|
||||
{/* Passkeys */}
|
||||
<PasskeysSection demoMode={demoMode} />
|
||||
</DemoLock>
|
||||
|
||||
{/* Delete Account Blocked */}
|
||||
<DialogShell
|
||||
|
||||
@@ -483,3 +483,18 @@ describe('DisplaySettingsTab week start (#2029)', () => {
|
||||
expect(await screen.findByText('Save failed')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('DisplaySettingsTab – the demo account', () => {
|
||||
it('FE-COMP-DISPLAY-DEMO-001: the shared demo account sees English under the demo lock', () => {
|
||||
seedStore(useAuthStore, { user: buildUser({ email: 'demo@trek.app' }), isAuthenticated: true, demoMode: true });
|
||||
seedStore(useSettingsStore, { settings: buildSettings({ language: 'en' }), isLoaded: true });
|
||||
render(<DisplaySettingsTab />);
|
||||
expect(screen.getByRole('note')).toHaveTextContent('The demo always runs in English.');
|
||||
});
|
||||
|
||||
it('FE-COMP-DISPLAY-DEMO-002: any other account of a demo instance picks its language freely', () => {
|
||||
seedStore(useAuthStore, { user: buildUser({ email: 'admin@trek.app' }), isAuthenticated: true, demoMode: true });
|
||||
render(<DisplaySettingsTab />);
|
||||
expect(screen.queryByRole('note')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,6 +18,8 @@ import { DEFAULT_START_PAGE, DEFAULT_START_TRIP_TAB } from '../../utils/startDes
|
||||
import type { DistanceUnit } from '../../types'
|
||||
import { DEFAULT_WEEK_START } from '@trek/shared'
|
||||
import { weekStartOptions } from '../../utils/calendarWeek'
|
||||
import DemoLock from '../Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../Demo/useDemoLock'
|
||||
|
||||
/** A select on the right of a row: wide enough for a currency or a weekday, never wider than the row. */
|
||||
const SELECT_BOX = 'w-[260px] max-w-full'
|
||||
@@ -25,6 +27,7 @@ const SELECT_BOX = 'w-[260px] max-w-full'
|
||||
export default function DisplaySettingsTab(): React.ReactElement {
|
||||
const { settings, save } = useSettingSaver()
|
||||
const { t, locale } = useTranslation()
|
||||
const demoLocked = useDemoAccountLock()
|
||||
const [tempUnit, setTempUnit] = useState<string>(settings.temperature_unit || DEFAULT_SETTINGS.temperature_unit)
|
||||
const [distanceUnit, setDistanceUnit] = useState<DistanceUnit>(settings.distance_unit || DEFAULT_SETTINGS.distance_unit)
|
||||
const [langOpen, setLangOpen] = useState(false)
|
||||
@@ -123,7 +126,9 @@ export default function DisplaySettingsTab(): React.ReactElement {
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Language: every option at a glance on a wide window, a compact list on a narrow one */}
|
||||
{/* Language: every option at a glance on a wide window, a compact list on a narrow one.
|
||||
The shared demo account always runs in English. */}
|
||||
<DemoLock locked={demoLocked} reason={t('demo.lock.language')} size="row">
|
||||
<SettingRow label={t('settings.language')} stacked>
|
||||
<div className="hidden sm:block">
|
||||
<ChoiceChips
|
||||
@@ -162,6 +167,7 @@ export default function DisplaySettingsTab(): React.ReactElement {
|
||||
)}
|
||||
</div>
|
||||
</SettingRow>
|
||||
</DemoLock>
|
||||
|
||||
{/* Place names (#1799): searches can answer in another language than the app. */}
|
||||
<SettingRow
|
||||
|
||||
@@ -18,10 +18,13 @@ import { SETTINGS_BUTTON, SETTINGS_BUTTON_PRIMARY, SETTINGS_ICON_BUTTON, Setting
|
||||
import { OAUTH_PRESETS, useMcpIntegration, type OAuthClient } from './useMcpIntegration'
|
||||
import { useIntegrationGates } from './useIntegrationGates'
|
||||
import WandererConnectionSection from './WandererConnectionSection'
|
||||
import DemoLock from '../Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../Demo/useDemoLock'
|
||||
|
||||
export default function IntegrationsTab(): React.ReactElement {
|
||||
const S = useIntegrations()
|
||||
const managed = S.managed
|
||||
const demoLocked = useDemoAccountLock()
|
||||
return (
|
||||
<>
|
||||
{/* Immich, Synology Photos and AirTrail all connect to a server the reader
|
||||
@@ -42,9 +45,15 @@ export default function IntegrationsTab(): React.ReactElement {
|
||||
{S.llmEnabled && S.ownParsing && !managed && <LlmConnectionSection />}
|
||||
{/* Above MCP on purpose: an API key needs no addon, and someone looking for
|
||||
one should not have to read past a section about AI assistants. */}
|
||||
<ApiKeysSection />
|
||||
<DemoLock locked={demoLocked} reason={S.t('demo.lock.apiKeys')}>
|
||||
<ApiKeysSection />
|
||||
</DemoLock>
|
||||
{/* TREK inside Claude rides on the MCP server, so it follows that addon. */}
|
||||
{S.mcpEnabled && <IntegrationsMcpSection S={S} />}
|
||||
{S.mcpEnabled && (
|
||||
<DemoLock locked={demoLocked} reason={S.t('demo.lock.mcp')}>
|
||||
<IntegrationsMcpSection S={S} />
|
||||
</DemoLock>
|
||||
)}
|
||||
<McpTokenModals S={S} />
|
||||
<OAuthClientModals S={S} />
|
||||
</>
|
||||
|
||||
@@ -140,4 +140,13 @@ describe('AiConnectionSection', () => {
|
||||
const { container } = render(<AiConnectionSection />);
|
||||
await waitFor(() => expect(container).toBeEmptyDOMElement());
|
||||
});
|
||||
|
||||
it('FE-COMP-AI-CONNECTION-008: the shared demo account sees its own connection locked, and no admin hint', async () => {
|
||||
seedStore(useAuthStore, { user: buildUser({ email: 'demo@trek.app' }), isAuthenticated: true, demoMode: true });
|
||||
repo.status.mockResolvedValue(status({ canConnectOwn: false }));
|
||||
render(<AiConnectionSection />);
|
||||
expect(await screen.findByRole('note')).toHaveTextContent('Your own AI connection cannot be added in the demo.');
|
||||
expect(screen.queryByText('Your admin sets this up.')).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { hidden: true, name: 'Connect your own provider' })).toBeDisabled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Loader2, LogOut, MessageCircle, Sparkles, Unplug } from 'lucide-react';
|
||||
import React from 'react';
|
||||
import { useTranslation } from '../../../i18n';
|
||||
import { useAssistantCostEstimates, useAssistantMapFollow } from '../../Assistant/useAssistantMapFollow';
|
||||
import DemoLock from '../../Demo/DemoLock';
|
||||
import { useDemoAccountLock } from '../../Demo/useDemoLock';
|
||||
import ConfirmDialog from '../../shared/ConfirmDialog';
|
||||
import CustomSelect from '../../shared/CustomSelect';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
@@ -202,6 +204,25 @@ function AssistantBehaviour() {
|
||||
);
|
||||
}
|
||||
|
||||
/** Where the shared demo account would connect a provider of its own: shown, and locked. */
|
||||
function LockedOwnConnection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<DemoLock locked reason={t('demo.lock.ai')} size="row">
|
||||
<SettingRows>
|
||||
<SettingRow
|
||||
label={t('demo.lock.aiTitle')}
|
||||
control={
|
||||
<button type="button" disabled className={SETTINGS_BUTTON} style={fs(13, 'body')}>
|
||||
{t('assistant.errorAction.connectOwn')}
|
||||
</button>
|
||||
}
|
||||
/>
|
||||
</SettingRows>
|
||||
</DemoLock>
|
||||
);
|
||||
}
|
||||
|
||||
/** The connect panel, opened on purpose or because nothing is connected yet. */
|
||||
function ConnectPanel({ S }: { S: AiConnections }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -254,6 +275,7 @@ export default function AiConnectionSection({
|
||||
}): React.ReactElement | null {
|
||||
const { t } = useTranslation();
|
||||
const S = useAiConnections();
|
||||
const demoLocked = useDemoAccountLock();
|
||||
const text = aiSectionText(assistant, parsing);
|
||||
if (S.view === 'hidden') return null;
|
||||
const own = S.own;
|
||||
@@ -277,7 +299,8 @@ export default function AiConnectionSection({
|
||||
{S.view === 'own' && own && <OwnConnection S={S} own={own} />}
|
||||
{S.view === 'instance' && <InstanceConnection S={S} />}
|
||||
{assistant && (S.view === 'own' || S.view === 'instance') && <AssistantBehaviour />}
|
||||
{S.view === 'adminOnly' && <SettingsHint>{t('assistant.setup.adminOnly')}</SettingsHint>}
|
||||
{S.view === 'adminOnly' && !demoLocked && <SettingsHint>{t('assistant.setup.adminOnly')}</SettingsHint>}
|
||||
{demoLocked && S.view !== 'loading' && <LockedOwnConnection />}
|
||||
|
||||
{S.panel && <ConnectPanel S={S} />}
|
||||
<SectionFooter S={S} />
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import type { AiConnectionView, AiStatusResponse } from '@trek/shared';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { buildUser } from '../../../../tests/helpers/factories';
|
||||
import { render, screen, waitFor } from '../../../../tests/helpers/render';
|
||||
import { seedStore } from '../../../../tests/helpers/store';
|
||||
import { useAssistantStore } from '../../../store/assistantStore';
|
||||
import { useAuthStore } from '../../../store/authStore';
|
||||
|
||||
const repo = vi.hoisted(() => ({
|
||||
status: vi.fn(),
|
||||
@@ -83,4 +86,20 @@ describe('MAiConnectionSection', () => {
|
||||
expect(await screen.findByText('What would you like to chat with?')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /Paste an API key/ })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-AI-DEMO-001: the shared demo account sees the place for its own connection locked', async () => {
|
||||
seedStore(useAuthStore, { user: buildUser({ email: 'demo@trek.app' }), isAuthenticated: true, demoMode: true });
|
||||
repo.status.mockResolvedValue(status({ canConnectOwn: false }));
|
||||
render(<MAiConnectionSection />);
|
||||
expect(await screen.findByRole('note')).toHaveTextContent('Your own AI connection cannot be added in the demo.');
|
||||
expect(screen.queryByText('Your admin sets this up.')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-AI-DEMO-002: any other account keeps the admin hint', async () => {
|
||||
seedStore(useAuthStore, { user: buildUser({ email: 'admin@trek.app' }), isAuthenticated: true, demoMode: true });
|
||||
repo.status.mockResolvedValue(status({ canConnectOwn: false }));
|
||||
render(<MAiConnectionSection />);
|
||||
expect(await screen.findByText('Your admin sets this up.')).toBeInTheDocument();
|
||||
expect(screen.queryByRole('note')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@ import type { AiConnectionView } from '@trek/shared';
|
||||
import { ChevronDown, Loader2, LogOut, MessageCircle, Sparkles, Unplug } from 'lucide-react';
|
||||
import React, { useState } from 'react';
|
||||
import { useAssistantCostEstimates, useAssistantMapFollow } from '../../../components/Assistant/useAssistantMapFollow';
|
||||
import DemoLock from '../../../components/Demo/DemoLock';
|
||||
import { useDemoAccountLock } from '../../../components/Demo/useDemoLock';
|
||||
import AiConnectPanel from '../../../components/Settings/ai/AiConnectPanel';
|
||||
import { aiSectionText, CONNECTION_STATUS } from '../../../components/Settings/ai/aiConnectModel';
|
||||
import { useAiConnections } from '../../../components/Settings/ai/useAiConnections';
|
||||
@@ -117,6 +119,30 @@ function MInstanceConnection({ S }: { S: AiConnections }) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Under the connection: the hint that only the admin connects one, or, for the
|
||||
* shared demo account, the locked place where its own would go.
|
||||
*/
|
||||
function MOwnConnectionNote({ view }: { view: AiConnections['view'] }) {
|
||||
const { t } = useTranslation();
|
||||
const demoLocked = useDemoAccountLock();
|
||||
if (view === 'loading') return null;
|
||||
if (!demoLocked) return view === 'adminOnly' ? <MSetHint>{t('assistant.setup.adminOnly')}</MSetHint> : null;
|
||||
return (
|
||||
<DemoLock locked reason={t('demo.lock.ai')} size="row" className="mt-3">
|
||||
<MSetRow
|
||||
first
|
||||
label={t('demo.lock.aiTitle')}
|
||||
trailing={
|
||||
<MSetButton variant="ghost" disabled>
|
||||
{t('assistant.errorAction.connectOwn')}
|
||||
</MSetButton>
|
||||
}
|
||||
/>
|
||||
</DemoLock>
|
||||
);
|
||||
}
|
||||
|
||||
/** Whether the trip map follows the assistant, the phone's row for the shared switch. */
|
||||
function MAssistantBehaviour() {
|
||||
const { t } = useTranslation();
|
||||
@@ -180,7 +206,7 @@ export default function MAiConnectionSection({
|
||||
{S.view === 'own' && S.own && <MOwnConnection S={S} own={S.own} />}
|
||||
{S.view === 'instance' && <MInstanceConnection S={S} />}
|
||||
{assistant && (S.view === 'own' || S.view === 'instance') && <MAssistantBehaviour />}
|
||||
{S.view === 'adminOnly' && <MSetHint>{t('assistant.setup.adminOnly')}</MSetHint>}
|
||||
<MOwnConnectionNote view={S.view} />
|
||||
|
||||
{S.panel && (
|
||||
<div
|
||||
|
||||
@@ -22,6 +22,8 @@ import MConfirmSheet from './MConfirmSheet'
|
||||
import PasswordChecklist from '../../../components/shared/PasswordChecklist'
|
||||
import { fmtDate, usePasskeys } from '../../../components/Settings/usePasskeys'
|
||||
import { stripTrailingSlashes, useAccountSettings } from '../../../components/Settings/useAccountSettings'
|
||||
import DemoLock from '../../../components/Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../../../components/Demo/useDemoLock'
|
||||
|
||||
/**
|
||||
* "Account" section — AccountTab parity: profile + avatar, password change,
|
||||
@@ -29,6 +31,7 @@ import { stripTrailingSlashes, useAccountSettings } from '../../../components/Se
|
||||
*/
|
||||
export default function MSettingsAccount() {
|
||||
const { t } = useTranslation()
|
||||
const demoLocked = useDemoAccountLock()
|
||||
const {
|
||||
user,
|
||||
demoMode,
|
||||
@@ -78,6 +81,8 @@ export default function MSettingsAccount() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* The shared demo account: everything here is shown, nothing can be changed. */}
|
||||
<DemoLock locked={demoLocked} reason={t('demo.lock.account')}>
|
||||
{/* ── Profile ─────────────────────────────────────────────── */}
|
||||
<MSetCard title={t('settings.account')} icon={User}>
|
||||
<div className="mb-4 flex items-center gap-4">
|
||||
@@ -185,10 +190,7 @@ export default function MSettingsAccount() {
|
||||
)}
|
||||
<p className="text-[0.75rem] leading-relaxed text-m-muted">{t('settings.mfa.description')}</p>
|
||||
|
||||
{demoMode ? (
|
||||
<p className="mt-2 text-[0.75rem] font-semibold text-[color:var(--m-st-pending)]">{t('settings.mfa.demoBlocked')}</p>
|
||||
) : (
|
||||
<>
|
||||
<>
|
||||
<p className="mt-2 text-[0.78125rem] font-bold text-m-ink">
|
||||
{user?.mfa_enabled ? t('settings.mfa.enabled') : t('settings.mfa.disabled')}
|
||||
</p>
|
||||
@@ -287,11 +289,11 @@ export default function MSettingsAccount() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
</MSetCard>
|
||||
|
||||
<MPasskeysCard demoMode={demoMode} />
|
||||
</DemoLock>
|
||||
|
||||
<MConfirmSheet
|
||||
open={showDeleteConfirm === 'blocked'}
|
||||
|
||||
@@ -12,6 +12,8 @@ import { MSetCard, MSetEyebrow, MSetHint, MSetSelectRow, MSetSegments, MSetRow }
|
||||
import MToggle from '../../components/MToggle'
|
||||
import MSetPickerSheet from './MSetPickerSheet'
|
||||
import { preferredNavAppOptions } from '../../../components/Planner/placeNavigation'
|
||||
import DemoLock from '../../../components/Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../../../components/Demo/useDemoLock'
|
||||
|
||||
/**
|
||||
* "General" settings section — the demo's Language & region and Travel & map
|
||||
@@ -20,6 +22,7 @@ import { preferredNavAppOptions } from '../../../components/Planner/placeNavigat
|
||||
export default function MSettingsGeneral() {
|
||||
const { t, locale } = useTranslation()
|
||||
const { settings, save } = useSettingSaver()
|
||||
const demoLocked = useDemoAccountLock()
|
||||
const [currencyOpen, setCurrencyOpen] = useState(false)
|
||||
const [langOpen, setLangOpen] = useState(false)
|
||||
const [startTabOpen, setStartTabOpen] = useState(false)
|
||||
@@ -121,8 +124,11 @@ export default function MSettingsGeneral() {
|
||||
<MSetEyebrow className="mb-[5px]">{t('settings.currency')}</MSetEyebrow>
|
||||
<MSetSelectRow label={currencyLabel} trailing={chevron} onClick={() => setCurrencyOpen(true)} />
|
||||
|
||||
<MSetEyebrow className="mb-[5px] mt-[14px]">{t('settings.language')}</MSetEyebrow>
|
||||
<MSetSelectRow label={language.label} trailing={chevron} onClick={() => setLangOpen(true)} />
|
||||
{/* The shared demo account always runs in English. */}
|
||||
<DemoLock locked={demoLocked} reason={t('demo.lock.language')} size="row">
|
||||
<MSetEyebrow className="mb-[5px] mt-[14px]">{t('settings.language')}</MSetEyebrow>
|
||||
<MSetSelectRow label={language.label} trailing={chevron} onClick={() => setLangOpen(true)} />
|
||||
</DemoLock>
|
||||
|
||||
<MSetEyebrow className="mb-[6px] mt-[14px]">{t('settings.temperature')}</MSetEyebrow>
|
||||
<MSetSegments
|
||||
|
||||
@@ -8,6 +8,8 @@ import MChip from '../../components/MChip'
|
||||
import { MSetCard, MSetEyebrow, MSetInput, MSetTextarea, MSetButton, MSetHint, MSetRow } from './MSettingsUi'
|
||||
import MConfirmSheet from './MConfirmSheet'
|
||||
import MSegmented from '../../components/MSegmented'
|
||||
import DemoLock from '../../../components/Demo/DemoLock'
|
||||
import { useDemoAccountLock } from '../../../components/Demo/useDemoLock'
|
||||
|
||||
function CopyButton({ text, copied, onCopy }: { text: string; copied: boolean; onCopy: (text: string) => void }) {
|
||||
return (
|
||||
@@ -37,6 +39,7 @@ function CodeBlock({ children }: { children: string }) {
|
||||
*/
|
||||
export default function MSettingsMcp() {
|
||||
const { t, locale } = useTranslation()
|
||||
const demoLocked = useDemoAccountLock()
|
||||
const {
|
||||
activeMcpTab: activeTab,
|
||||
setActiveMcpTab: setActiveTab,
|
||||
@@ -119,6 +122,7 @@ export default function MSettingsMcp() {
|
||||
)
|
||||
|
||||
return (
|
||||
<DemoLock locked={demoLocked} reason={t('demo.lock.mcp')}>
|
||||
<MSetCard title={t('settings.mcp.title')} icon={Terminal} className="mt-3">
|
||||
<MSetEyebrow className="mb-[5px]">{t('settings.mcp.endpoint')}</MSetEyebrow>
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -518,5 +522,6 @@ export default function MSettingsMcp() {
|
||||
onConfirm={() => tokenDeleteId !== null && deleteToken(tokenDeleteId)}
|
||||
/>
|
||||
</MSetCard>
|
||||
</DemoLock>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -385,12 +385,13 @@ describe('MSettingsAccount – MFA', () => {
|
||||
await screen.findByText('JBSWY3DPEHPK3PXP');
|
||||
}
|
||||
|
||||
it('FE-MOB-SETACC-023: demo mode replaces the controls with the demo notice', () => {
|
||||
seedStore(useAuthStore, { demoMode: true });
|
||||
it('FE-MOB-SETACC-023: the shared demo account sees the controls under the demo lock', () => {
|
||||
seedStore(useAuthStore, { demoMode: true, user: buildUser({ email: 'demo@trek.app', mfa_enabled: false }) });
|
||||
renderAccount();
|
||||
|
||||
expect(screen.getByText('Not available in demo mode')).toBeInTheDocument();
|
||||
expect(screen.getByRole('note')).toHaveTextContent('The shared demo account cannot be changed.');
|
||||
expect(screen.queryByRole('button', { name: 'Set up authenticator' })).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { hidden: true, name: 'Set up authenticator' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-SETACC-024: the ?mfa=required entry shows the policy banner', () => {
|
||||
|
||||
@@ -302,7 +302,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'تعطيل 2FA',
|
||||
'settings.mfa.toastEnabled': 'تم تفعيل المصادقة الثنائية',
|
||||
'settings.mfa.toastDisabled': 'تم تعطيل المصادقة الثنائية',
|
||||
'settings.mfa.demoBlocked': 'غير متاح في الوضع التجريبي',
|
||||
'settings.tabs.offline': 'دون اتصال',
|
||||
'settings.notificationPreferences.email': 'البريد الإلكتروني',
|
||||
'settings.notificationPreferences.webhook': 'Webhook',
|
||||
|
||||
@@ -396,7 +396,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FA-nı deaktiv et',
|
||||
'settings.mfa.toastEnabled': 'İki mərhələli autentifikasiya aktivləşdirildi',
|
||||
'settings.mfa.toastDisabled': 'İki mərhələli autentifikasiya deaktiv edildi',
|
||||
'settings.mfa.demoBlocked': 'Demo rejimində əlçatan deyil',
|
||||
|
||||
'settings.currency': 'Göstərilən valyuta',
|
||||
'settings.currencyHint':
|
||||
|
||||
@@ -209,7 +209,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Desativar 2FA',
|
||||
'settings.mfa.toastEnabled': 'Autenticação em duas etapas ativada',
|
||||
'settings.mfa.toastDisabled': 'Autenticação em duas etapas desativada',
|
||||
'settings.mfa.demoBlocked': 'Indisponível no modo demonstração',
|
||||
'settings.mcp.title': 'Configuração MCP',
|
||||
'settings.mcp.endpoint': 'Endpoint MCP',
|
||||
'settings.mcp.clientConfig': 'Configuração do cliente',
|
||||
|
||||
@@ -259,7 +259,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Desactiva el 2FA',
|
||||
'settings.mfa.toastEnabled': 'Autenticació de dos factors activada',
|
||||
'settings.mfa.toastDisabled': 'Autenticació de dos factors desactivada',
|
||||
'settings.mfa.demoBlocked': 'No disponible en mode de demostració',
|
||||
'settings.toast.mapSaved': 'Configuració del mapa desada',
|
||||
'settings.toast.keysSaved': 'Claus API desades',
|
||||
'settings.toast.displaySaved': 'Configuració de visualització desada',
|
||||
|
||||
@@ -289,7 +289,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Vypnout 2FA',
|
||||
'settings.mfa.toastEnabled': 'Dvoufaktorové ověření bylo zapnuto',
|
||||
'settings.mfa.toastDisabled': 'Dvoufaktorové ověření bylo vypnuto',
|
||||
'settings.mfa.demoBlocked': 'Není k dispozici v demo režimu',
|
||||
'settings.bookingLabels': 'Popisky tras rezervací',
|
||||
'settings.bookingLabelsHint': 'Zobrazuje názvy stanic / letišť na mapě. Pokud je vypnuto, zobrazí se pouze ikona.',
|
||||
'settings.mustChangePassword': 'Před pokračováním musíte změnit heslo.',
|
||||
|
||||
@@ -299,7 +299,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FA deaktivieren',
|
||||
'settings.mfa.toastEnabled': 'Zwei-Faktor-Authentifizierung aktiviert',
|
||||
'settings.mfa.toastDisabled': 'Zwei-Faktor-Authentifizierung deaktiviert',
|
||||
'settings.mfa.demoBlocked': 'In der Demo nicht verfügbar',
|
||||
'settings.notifyVersionAvailable': 'Neue Version verfügbar',
|
||||
'settings.notifyReplicaFailure': 'Speicher-Replik-Fehler',
|
||||
'settings.notifyPaddleRegionRequested': 'Paddel-Region angefragt',
|
||||
|
||||
@@ -356,7 +356,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Disable 2FA',
|
||||
'settings.mfa.toastEnabled': 'Two-factor authentication enabled',
|
||||
'settings.mfa.toastDisabled': 'Two-factor authentication disabled',
|
||||
'settings.mfa.demoBlocked': 'Not available in demo mode',
|
||||
'settings.currency': 'Display currency',
|
||||
'settings.currencyHint':
|
||||
'Amounts in Costs are shown converted to this currency for display only; the original amounts are unchanged.',
|
||||
|
||||
@@ -277,7 +277,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Desactivar 2FA',
|
||||
'settings.mfa.toastEnabled': 'Autenticación de dos factores activada',
|
||||
'settings.mfa.toastDisabled': 'Autenticación de dos factores desactivada',
|
||||
'settings.mfa.demoBlocked': 'No disponible en modo demo',
|
||||
'settings.toast.mapSaved': 'Ajustes del mapa guardados',
|
||||
'settings.toast.keysSaved': 'Claves API guardadas',
|
||||
'settings.toast.displaySaved': 'Ajustes de visualización guardados',
|
||||
|
||||
@@ -361,7 +361,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Keela 2FA',
|
||||
'settings.mfa.toastEnabled': 'Kaheastmeline autentimine lubatud',
|
||||
'settings.mfa.toastDisabled': 'Kaheastmeline autentimine keelatud',
|
||||
'settings.mfa.demoBlocked': 'Demorežiimis pole saadaval',
|
||||
'settings.currency': 'Kuvamisvaluuta',
|
||||
'settings.currencyHint': 'Kulude summad teisendatakse sellesse valuutasse ainult kuvamiseks; algsummad ei muutu.',
|
||||
'settings.currencyTrip': 'Reisi valuuta',
|
||||
|
||||
@@ -291,7 +291,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Désactiver 2FA',
|
||||
'settings.mfa.toastEnabled': 'Authentification à deux facteurs activée',
|
||||
'settings.mfa.toastDisabled': 'Authentification à deux facteurs désactivée',
|
||||
'settings.mfa.demoBlocked': 'Non disponible en mode démo',
|
||||
'settings.toast.mapSaved': 'Paramètres de carte enregistrés',
|
||||
'settings.toast.keysSaved': 'Clés API enregistrées',
|
||||
'settings.toast.displaySaved': "Paramètres d'affichage enregistrés",
|
||||
|
||||
@@ -361,7 +361,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Απενεργοποίηση 2FA',
|
||||
'settings.mfa.toastEnabled': 'Ο έλεγχος ταυτότητας δύο παραγόντων ενεργοποιήθηκε',
|
||||
'settings.mfa.toastDisabled': 'Ο έλεγχος ταυτότητας δύο παραγόντων απενεργοποιήθηκε',
|
||||
'settings.mfa.demoBlocked': 'Δεν είναι διαθέσιμο σε λειτουργία demo',
|
||||
'settings.currency': 'Νόμισμα εμφάνισης',
|
||||
'settings.currencyHint':
|
||||
'Τα ποσά στα Κόστη εμφανίζονται σε αυτό το νόμισμα μόνο για λόγους προβολής, τα αρχικά ποσά δεν αλλάζουν.',
|
||||
|
||||
@@ -295,7 +295,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FA kikapcsolása',
|
||||
'settings.mfa.toastEnabled': 'Kétfaktoros hitelesítés engedélyezve',
|
||||
'settings.mfa.toastDisabled': 'Kétfaktoros hitelesítés kikapcsolva',
|
||||
'settings.mfa.demoBlocked': 'Demo módban nem érhető el',
|
||||
'settings.mustChangePassword':
|
||||
'A folytatás előtt meg kell változtatnod a jelszavad. Kérjük, adj meg egy új jelszót alább.',
|
||||
'settings.bookingLabels': 'Útvonal-címkék a foglalásokhoz',
|
||||
|
||||
@@ -347,7 +347,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Nonaktifkan 2FA',
|
||||
'settings.mfa.toastEnabled': 'Autentikasi dua faktor diaktifkan',
|
||||
'settings.mfa.toastDisabled': 'Autentikasi dua faktor dinonaktifkan',
|
||||
'settings.mfa.demoBlocked': 'Tidak tersedia dalam mode demo',
|
||||
'settings.bookingLabels': 'Label rute pemesanan',
|
||||
'settings.bookingLabelsHint': 'Menampilkan nama stasiun / bandara di peta. Jika mati, hanya ikon ditampilkan.',
|
||||
'settings.currency': 'Mata uang tampilan',
|
||||
|
||||
@@ -294,7 +294,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Disabilita 2FA',
|
||||
'settings.mfa.toastEnabled': 'Autenticazione a due fattori abilitata',
|
||||
'settings.mfa.toastDisabled': 'Autenticazione a due fattori disabilitata',
|
||||
'settings.mfa.demoBlocked': 'Non disponibile in modalità demo',
|
||||
'settings.mustChangePassword': 'Devi cambiare la password prima di continuare. Imposta una nuova password qui sotto.',
|
||||
'settings.bookingLabels': 'Etichette percorsi prenotati',
|
||||
'settings.bookingLabelsHint':
|
||||
|
||||
@@ -321,7 +321,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FAを無効化',
|
||||
'settings.mfa.toastEnabled': '2FAを有効にしました',
|
||||
'settings.mfa.toastDisabled': '2FAを無効にしました',
|
||||
'settings.mfa.demoBlocked': 'デモモードでは利用できません',
|
||||
'settings.oauth.modal.machineClient': 'マシンクライアント(ブラウザログインなし)',
|
||||
'settings.oauth.modal.machineClientHint':
|
||||
'client_credentials グラントを使用します — リダイレクト URI は不要です。トークンは client_id + client_secret を介して直接発行され、選択したスコープ内であなたとして動作します。',
|
||||
|
||||
@@ -336,7 +336,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FA 비활성화',
|
||||
'settings.mfa.toastEnabled': '2단계 인증이 활성화되었습니다',
|
||||
'settings.mfa.toastDisabled': '2단계 인증이 비활성화되었습니다',
|
||||
'settings.mfa.demoBlocked': '데모 모드에서는 사용할 수 없습니다',
|
||||
'settings.oauth.modal.machineClient': '머신 클라이언트(브라우저 로그인 없음)',
|
||||
'settings.oauth.modal.machineClientHint':
|
||||
'client_credentials 권한 부여를 사용합니다 — 리디렉션 URI가 필요하지 않습니다. 토큰은 client_id + client_secret을 통해 직접 발급되며 선택한 범위 내에서 사용자로 작동합니다.',
|
||||
|
||||
@@ -287,7 +287,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '2FA uitschakelen',
|
||||
'settings.mfa.toastEnabled': 'Tweefactorauthenticatie ingeschakeld',
|
||||
'settings.mfa.toastDisabled': 'Tweefactorauthenticatie uitgeschakeld',
|
||||
'settings.mfa.demoBlocked': 'Niet beschikbaar in demomodus',
|
||||
'settings.toast.mapSaved': 'Kaartinstellingen opgeslagen',
|
||||
'settings.toast.keysSaved': 'API-sleutels opgeslagen',
|
||||
'settings.toast.displaySaved': 'Weergave-instellingen opgeslagen',
|
||||
|
||||
@@ -292,7 +292,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Wyłącz 2FA',
|
||||
'settings.mfa.toastEnabled': 'Uwierzytelnianie dwuskładnikowe zostało włączone',
|
||||
'settings.mfa.toastDisabled': 'Uwierzytelnianie dwuskładnikowe zostało wyłączone',
|
||||
'settings.mfa.demoBlocked': 'Niedostępne w trybie demonstracyjnym',
|
||||
'settings.bookingLabels': 'Etykiety tras rezerwacji',
|
||||
'settings.bookingLabelsHint':
|
||||
'Pokazuje nazwy stacji / lotnisk na mapie. Gdy wyłączone, wyświetlana jest tylko ikona.',
|
||||
|
||||
@@ -286,7 +286,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Отключить 2FA',
|
||||
'settings.mfa.toastEnabled': 'Двухфакторная аутентификация включена',
|
||||
'settings.mfa.toastDisabled': 'Двухфакторная аутентификация отключена',
|
||||
'settings.mfa.demoBlocked': 'Недоступно в демо-режиме',
|
||||
'settings.toast.mapSaved': 'Настройки карты сохранены',
|
||||
'settings.toast.keysSaved': 'API-ключи сохранены',
|
||||
'settings.toast.displaySaved': 'Настройки отображения сохранены',
|
||||
|
||||
@@ -359,7 +359,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Vypnúť 2FA',
|
||||
'settings.mfa.toastEnabled': 'Dvojfaktorové overenie zapnuté',
|
||||
'settings.mfa.toastDisabled': 'Dvojfaktorové overenie vypnuté',
|
||||
'settings.mfa.demoBlocked': 'Nie je k dispozícii v demo režime',
|
||||
'settings.currency': 'Zobrazovaná mena',
|
||||
'settings.currencyHint':
|
||||
'Sumy v Nákladoch sa do tejto meny prepočítavajú iba pre zobrazenie; pôvodné sumy zostávajú nezmenené.',
|
||||
|
||||
@@ -353,7 +353,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Inaktivera 2FA',
|
||||
'settings.mfa.toastEnabled': 'Tvåfaktorsautentisering är aktiverad',
|
||||
'settings.mfa.toastDisabled': 'Tvåfaktorsautentisering är inaktiverad',
|
||||
'settings.mfa.demoBlocked': 'Finns inte i demoläge',
|
||||
'settings.currency': 'Visningsvaluta',
|
||||
'settings.currencyHint':
|
||||
'Belopp under Kostnader visas omräknade till denna valuta endast för visning; de ursprungliga beloppen ändras inte.',
|
||||
|
||||
@@ -344,7 +344,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'ปิดการใช้งาน 2FA',
|
||||
'settings.mfa.toastEnabled': 'เปิดใช้งานการรับรองความถูกต้องด้วยสองปัจจัย',
|
||||
'settings.mfa.toastDisabled': 'การรับรองความถูกต้องด้วยสองปัจจัยถูกปิดใช้งาน',
|
||||
'settings.mfa.demoBlocked': 'ไม่สามารถใช้ได้ในโหมดสาธิต',
|
||||
'settings.currency': 'แสดงสกุลเงิน',
|
||||
'settings.currencyHint':
|
||||
'จำนวนเงินในต้นทุนจะแสดงแปลงเป็นสกุลเงินนี้เพื่อแสดงเท่านั้น; จำนวนเงินเดิมไม่มีการเปลี่ยนแปลง',
|
||||
|
||||
@@ -343,7 +343,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': "2FA'yı devre dışı bırak",
|
||||
'settings.mfa.toastEnabled': 'İki faktörlü kimlik doğrulama etkin',
|
||||
'settings.mfa.toastDisabled': 'İki faktörlü kimlik doğrulama devre dışı',
|
||||
'settings.mfa.demoBlocked': 'Demo modunda kullanılamaz',
|
||||
'settings.oauth.modal.machineClient': 'Makine istemcisi (tarayıcıda oturum açma yok)',
|
||||
'settings.oauth.modal.machineClientHint':
|
||||
"client_credentials iznini kullanın — yönlendirme URI'lerine gerek yoktur. Belirteç doğrudan client_id + client_secret ile verilir ve seçilen kapsamlar dahilinde sizin adınıza hareket eder.",
|
||||
|
||||
@@ -282,7 +282,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Вимкнути 2FA',
|
||||
'settings.mfa.toastEnabled': 'Двофакторна автентифікація увімкнена',
|
||||
'settings.mfa.toastDisabled': 'Двофакторна автентифікація вимкнена',
|
||||
'settings.mfa.demoBlocked': 'Недоступно в демо-режимі',
|
||||
'settings.toast.mapSaved': 'Налаштування карти збережено',
|
||||
'settings.toast.keysSaved': 'API-ключі збережено',
|
||||
'settings.toast.displaySaved': 'Налаштування відображення збережено',
|
||||
|
||||
@@ -355,7 +355,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': 'Tắt 2FA',
|
||||
'settings.mfa.toastEnabled': 'Đã bật xác thực hai yếu tố',
|
||||
'settings.mfa.toastDisabled': 'Xác thực hai yếu tố bị vô hiệu hóa',
|
||||
'settings.mfa.demoBlocked': 'Không có sẵn ở chế độ demo',
|
||||
'settings.currency': 'Tiền tệ hiển thị',
|
||||
'settings.currencyHint':
|
||||
'Số tiền trong Chi phí chỉ được quy đổi sang loại tiền tệ này để hiển thị; số tiền gốc không thay đổi.',
|
||||
|
||||
@@ -318,7 +318,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '停用 2FA',
|
||||
'settings.mfa.toastEnabled': '雙因素認證已啟用',
|
||||
'settings.mfa.toastDisabled': '雙因素認證已停用',
|
||||
'settings.mfa.demoBlocked': '演示模式下不可用',
|
||||
'settings.toast.mapSaved': '地圖設定已儲存',
|
||||
'settings.toast.keysSaved': 'API 金鑰已儲存',
|
||||
'settings.toast.displaySaved': '顯示設定已儲存',
|
||||
|
||||
@@ -269,7 +269,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mfa.disable': '停用 2FA',
|
||||
'settings.mfa.toastEnabled': '双因素认证已启用',
|
||||
'settings.mfa.toastDisabled': '双因素认证已停用',
|
||||
'settings.mfa.demoBlocked': '演示模式下不可用',
|
||||
'settings.toast.mapSaved': '地图设置已保存',
|
||||
'settings.toast.keysSaved': 'API 密钥已保存',
|
||||
'settings.toast.displaySaved': '显示设置已保存',
|
||||
|
||||
Reference in New Issue
Block a user