feat(manager): notification bell, sign-in/venue/print settings, log download (platform-v2 2.6f)
- Bell in the header: /api/platform/notifications with unread count, live via
the new LiveProvider (one createLiveClient connection) on platform_notification
and reconnect; mark read / all; warning+critical pop a toast.
- Settings: Sign-in card (manager/waiter/device modes, require username, one
session per manager/waiter, username autofill) replaces the dead v1
security.login_method card; new "Venue & language" tab (language, time zone);
print alert threshold in Printing. Tab labels are i18n keys.
- Technical > Log files: list + download of the daily logs (owner-level).
Backend: GET /api/system/logs, /api/system/logs/{date} (core.settings.manage),
error system.log_not_found.
- Setup wizard asks staff language and time zone (setup/init stores them).
- @xenia/ui theme helpers (applyTheme, getStoredTheme); the manager stays light
until phase 6 converts the older pages (owner decision 2026-11-14).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// Venue language and time zone (plan step 2.6f, D-11, D-12): venue.language is the
|
||||
// language of staff without their own choice and of printed tickets/reports; venue.timezone
|
||||
// is the zone every time is shown in (applies at once). Both reload bootstrap after saving.
|
||||
import { useId, useMemo } from 'react'
|
||||
import { useAccess } from '@xenia/access'
|
||||
import { LANGUAGE_NAMES, useTranslation, useFormat } from '@xenia/i18n'
|
||||
import { Select, Spinner } from '@xenia/ui'
|
||||
import { SettingRow, SettingsCard } from './SettingsCard'
|
||||
import { useSettings } from './useSettings'
|
||||
import { timeZones } from './timeZones'
|
||||
|
||||
export default function VenueSettings() {
|
||||
const { t } = useTranslation('manager')
|
||||
const f = useFormat()
|
||||
const { languages } = useAccess()
|
||||
const s = useSettings()
|
||||
const langId = useId()
|
||||
const tzId = useId()
|
||||
const tz = s.get('venue.timezone', 'Europe/Athens')
|
||||
const zones = useMemo(() => timeZones(tz), [tz])
|
||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||
|
||||
return (
|
||||
<SettingsCard title={t('settings.venue.title')} testId="settings-venue">
|
||||
<SettingRow label={t('settings.venue.language')} htmlFor={langId} hint={t('settings.venue.languageHint')}>
|
||||
<Select id={langId} value={s.get('venue.language', 'en')} disabled={s.saving} data-testid="setting-venue.language"
|
||||
onChange={e => s.save('venue.language', e.target.value)}
|
||||
options={(languages || ['en', 'el']).map(l => ({ value: l, label: LANGUAGE_NAMES[l] || l }))} />
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.venue.timezone')} htmlFor={tzId}
|
||||
hint={t('settings.venue.timezoneHint', { time: f.formatTime(new Date()) })}>
|
||||
<Select id={tzId} value={tz} disabled={s.saving} data-testid="setting-venue.timezone"
|
||||
onChange={e => s.save('venue.timezone', e.target.value)}
|
||||
options={zones.map(z => ({ value: z, label: z.replace(/_/g, ' ') }))} />
|
||||
</SettingRow>
|
||||
</SettingsCard>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user