feat(manager): Apps, Integrations and License pages on the module catalogue

Platform-v2 step 2.6c:
- Apps (device apps, features, always-included core) and Integrations: module
  cards from GET /api/platform/modules with state (on / off / waiting for a
  dependency / not in your license / always on), dependencies, limits and an
  Open button where the manager has a page; core.modules.manage toggles them
  (PUT /api/platform/modules/{key}), with a confirm listing the modules that
  stop too; bootstrap reloads so the sidebar follows at once
- License page: licensed / free (with the reason) / development, site id,
  validity, last contact, "check the license now" (POST /api/system/sync-license),
  every module's entitlement and limits
- i18n: new `modules` namespace (names, descriptions, limit labels, en + el)
  kept complete against the registry by local_backend/tests/test_module_texts.py
- nav: Integrations and License in the sidebar; old AppsPage removed
- e2e manager.mjs: 43 checks (+ card states, toggle from the card, dependency
  warning, integrations, license page)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 22:33:54 +02:00
co-authored by Claude Opus 5.5
parent 49a412d748
commit 0d0b2d78e1
13 changed files with 757 additions and 47 deletions
+26
View File
@@ -0,0 +1,26 @@
"""Every module (and each of its limits) has a name and description for staff in every
UI language (packages/i18n/locales/<lang>/modules.json, plan step 2.6c). A new module in
a manifest fails here until its texts exist."""
import json
from pathlib import Path
import pytest
from core.modules.registry import registry
LOCALES = Path(__file__).resolve().parents[2] / "packages" / "i18n" / "locales"
@pytest.mark.parametrize("lang", ["en", "el"])
def test_every_module_has_texts(lang):
texts = json.loads((LOCALES / lang / "modules.json").read_text(encoding="utf-8"))
missing = []
for m in registry().values():
t = texts.get(m.key, {})
if not t.get("name") or not t.get("description"):
missing.append(m.key)
for lim in m.limits:
if not t.get("limits", {}).get(lim.key):
missing.append(f"{m.key}.limits.{lim.key}")
assert missing == []
assert set(texts) == set(registry()), "texts for modules that don't exist"
+4 -1
View File
@@ -51,7 +51,8 @@ import TechnicalPage from './pages/reports/TechnicalPage'
import MiscPage from './pages/reports/MiscPage' import MiscPage from './pages/reports/MiscPage'
// Other // Other
import AppsPage from './pages/AppsPage' import { AppsPage, IntegrationsPage } from './pages/platform/ModulesPage'
import LicensePage from './pages/platform/LicensePage'
import PhonePage from './pages/PhonePage' import PhonePage from './pages/PhonePage'
import SettingsPage from './pages/Settings/SettingsPage' import SettingsPage from './pages/Settings/SettingsPage'
import NotesPage from './pages/NotesPage' import NotesPage from './pages/NotesPage'
@@ -178,6 +179,8 @@ export default function App() {
{/* ── Apps & Settings ── */} {/* ── Apps & Settings ── */}
<Route path="apps" element={<AppsPage />} /> <Route path="apps" element={<AppsPage />} />
<Route path="integrations" element={<IntegrationsPage />} />
<Route path="license" element={<LicensePage />} />
<Route path="apps/phone" element={<PhonePage />} /> <Route path="apps/phone" element={<PhonePage />} />
<Route path="settings" element={<SettingsPage />} /> <Route path="settings" element={<SettingsPage />} />
<Route path="notes" element={<NotesPage />} /> <Route path="notes" element={<NotesPage />} />
-38
View File
@@ -1,38 +0,0 @@
import { useNavigate } from 'react-router-dom'
import { ChefHat, Phone } from 'lucide-react'
export default function AppsPage() {
const navigate = useNavigate()
return (
<div className="p-8">
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4 max-w-2xl">
<button
onClick={() => navigate('/kds')}
className="flex flex-col items-center gap-3 p-6 bg-white border border-slate-200 rounded-xl shadow-sm hover:border-sky-300 hover:shadow-md transition-all text-center group"
>
<div className="flex h-12 w-12 items-center justify-center rounded-xl bg-sky-50 text-sky-600 group-hover:bg-sky-100 transition-colors">
<ChefHat size={24} />
</div>
<div>
<p className="text-[13px] font-semibold text-slate-800">KDS</p>
<p className="text-[11px] text-slate-400 mt-0.5">Kitchen Display</p>
</div>
</button>
<button
onClick={() => navigate('/apps/phone')}
className="flex flex-col items-center gap-3 p-6 bg-white border border-slate-200 rounded-xl shadow-sm hover:border-emerald-300 hover:shadow-md transition-all text-center group"
>
<div className="flex h-12 w-12 items-center justify-center rounded-xl bg-emerald-50 text-emerald-600 group-hover:bg-emerald-100 transition-colors">
<Phone size={24} />
</div>
<div>
<p className="text-[13px] font-semibold text-slate-800">Τηλέφωνο</p>
<p className="text-[11px] text-slate-400 mt-0.5">Caller ID</p>
</div>
</button>
</div>
</div>
)
}
@@ -0,0 +1,134 @@
// License page (plan step 2.6c, APPS_PLATFORM §5): what this venue's license includes,
// until when, with which limits, and when the site last reached the license server.
// Sources: bootstrap `license` (mode/reason), GET /api/system/status (expiry, last sync,
// site id), GET /api/platform/modules (per-module entitlement and limits).
// "Check the license now" = POST /api/system/sync-license (needs the internet).
import { useCallback, useEffect, useState } from 'react'
import toast from 'react-hot-toast'
import { errorMessage } from '@xenia/api'
import { useAccess } from '@xenia/access'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, EmptyState, Spinner } from '@xenia/ui'
import client from '../../api/client'
export default function LicensePage() {
const { t } = useTranslation('manager')
const f = useFormat()
const { license, refresh } = useAccess()
const [status, setStatus] = useState(null)
const [modules, setModules] = useState(null)
const [error, setError] = useState(null)
const [syncing, setSyncing] = useState(false)
const load = useCallback(async () => {
try {
const [s, m] = await Promise.all([client.get('/api/system/status'), client.get('/api/platform/modules')])
setStatus(s.data)
setModules(m.data.modules)
setError(null)
} catch (err) {
setError(errorMessage(err, t))
}
}, [t])
useEffect(() => { load() }, [load])
async function syncNow() {
setSyncing(true)
try {
const { data } = await client.post('/api/system/sync-license')
await Promise.all([load(), refresh()])
if (data?.sync_failed) toast.error(t('licensePage.syncFailed'))
else toast.success(t('licensePage.synced'))
} catch (err) {
toast.error(errorMessage(err, t))
} finally {
setSyncing(false)
}
}
if (error) return <div className="p-8"><EmptyState title={error} action={<Button variant="secondary" onClick={load}>{t('common:actions.retry')}</Button>} /></div>
if (!status || !modules) return <div className="p-8 flex justify-center"><Spinner /></div>
const mode = license?.mode
const statusText = mode === 'dev' ? t('licensePage.statusDev')
: mode === 'licensed' ? t('licensePage.statusLicensed')
: t('licensePage.statusFree')
const statusTone = mode === 'licensed' ? 'bg-success-soft text-success-ink' : mode === 'dev' ? 'bg-info-soft text-info-ink' : 'bg-warning-soft text-warning-ink'
const reason = mode === 'free' && license?.reason ? t(`license.${license.reason}`, { defaultValue: '' }) : ''
const entitlement = m => {
if (!m.entitled) return t('licensePage.notIncluded')
const src = m.entitlement?.source
if (src === 'core') return t('licensePage.included')
if (src === 'dev') return t('licensePage.dev')
if (src === 'free') return t('licensePage.free')
return m.entitlement?.exp ? t('licensePage.inLicenseUntil', { date: f.formatDate(m.entitlement.exp) }) : t('licensePage.inLicense')
}
const sorted = [...modules].sort((a, b) => t(`modules:${a.key}.name`).localeCompare(t(`modules:${b.key}.name`)))
return (
<div className="p-6 lg:p-8 max-w-5xl grid gap-6">
<section className="bg-surface border border-line rounded-card shadow-raised p-6 grid gap-4" data-testid="license-status">
<div className="flex flex-wrap items-center gap-3 justify-between">
<div>
<div className="text-label text-ink-3">{t('licensePage.status')}</div>
<span className={`inline-block mt-1 rounded-full px-3 py-1 text-body font-semibold ${statusTone}`} data-testid="license-mode">{statusText}</span>
</div>
<Button variant="secondary" loading={syncing} onClick={syncNow}>{t('licensePage.syncNow')}</Button>
</div>
{reason && <p className="text-body text-warning-ink">{reason}</p>}
<dl className="grid gap-3 sm:grid-cols-3 text-body">
<div>
<dt className="text-label text-ink-3">{t('licensePage.siteId')}</dt>
<dd className="font-mono text-ink" data-testid="license-site">{status.site_id || '—'}</dd>
</div>
<div>
<dt className="text-label text-ink-3">{t('licensePage.expires')}</dt>
<dd className="text-ink">
{status.expires_at ? f.formatDate(status.expires_at, 'dateMedium') : '—'}
{status.days_until_expiry != null && status.days_until_expiry >= 0 && (
<span className="text-ink-3"> · {t('licensePage.daysLeft', { count: status.days_until_expiry })}</span>
)}
</dd>
</div>
<div>
<dt className="text-label text-ink-3">{t('licensePage.lastSync')}</dt>
<dd className="text-ink">{status.last_sync ? f.formatRelative(status.last_sync) : t('licensePage.never')}</dd>
</div>
</dl>
{status.sync_failed && status.offline_days > 0 && (
<p className="text-label text-warning-ink">{t('licensePage.offline', { count: status.offline_days })}</p>
)}
</section>
<section className="bg-surface border border-line rounded-card shadow-raised overflow-hidden">
<h2 className="px-6 pt-5 pb-3 text-body-lg font-semibold text-ink">{t('licensePage.modules')}</h2>
<table className="w-full text-body" data-testid="license-modules">
<thead>
<tr className="text-left text-label text-ink-3 border-b border-line">
<th className="px-6 py-2 font-medium">{t('licensePage.module')}</th>
<th className="px-6 py-2 font-medium">{t('licensePage.status')}</th>
<th className="px-6 py-2 font-medium">{t('licensePage.limits')}</th>
</tr>
</thead>
<tbody>
{sorted.map(m => (
<tr key={m.key} className="border-b border-line last:border-0" data-testid={`license-row-${m.key}`}>
<td className="px-6 py-2.5 text-ink">{t(`modules:${m.key}.name`)}</td>
<td className={`px-6 py-2.5 ${m.entitled ? 'text-ink-2' : 'text-ink-3'}`}>{entitlement(m)}</td>
<td className="px-6 py-2.5 text-ink-2">
{m.limits.map(l => (
<div key={l.key}>
{t(`modules:${m.key}.limits.${l.key}`)}: <span className="text-ink font-medium">{l.value == null ? t('modules.unlimited') : l.value}</span>
</div>
))}
</td>
</tr>
))}
</tbody>
</table>
</section>
</div>
)
}
@@ -0,0 +1,169 @@
// Apps and Integrations pages (plan step 2.6c, APPS_PLATFORM §4, D-3, D-19): the module
// catalogue from GET /api/platform/modules as cards. A manager with core.modules.manage
// turns modules on/off (PUT /api/platform/modules/{key}); everyone else sees the state.
// Turning one off warns first which modules depending on it stop too. After a change the
// platform bootstrap is reloaded, so the sidebar and every guard follow at once.
import { useCallback, useEffect, useMemo, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import toast from 'react-hot-toast'
import { errorMessage } from '@xenia/api'
import { useAccess, useCan } from '@xenia/access'
import { useTranslation } from '@xenia/i18n'
import { Button, Dialog, EmptyState, Spinner, Switch } from '@xenia/ui'
import client from '../../api/client'
import { moduleState, stoppedBy } from './modulesLogic'
// Modules with a page in the manager: the card gets an "Open" button
const OPEN_PATH = { kds: '/kds', caller_id: '/apps/phone' }
export function AppsPage() {
const { t } = useTranslation('manager')
return <ModulesPage kinds={['app', 'feature', 'core']} intro={t('modules.appsIntro')} />
}
export function IntegrationsPage() {
const { t } = useTranslation('manager')
return <ModulesPage kinds={['integration']} intro={t('modules.integrationsIntro')} />
}
function ModulesPage({ kinds, intro }) {
const { t } = useTranslation('manager')
const { refresh } = useAccess()
const canManage = useCan('core.modules.manage')
const [modules, setModules] = useState(null)
const [error, setError] = useState(null)
const [confirm, setConfirm] = useState(null) // { module, stopped }
const [busy, setBusy] = useState(null) // key being saved
const load = useCallback(async () => {
try {
const { data } = await client.get('/api/platform/modules')
setModules(data.modules)
setError(null)
} catch (err) {
setError(errorMessage(err, t))
}
}, [t])
useEffect(() => { load() }, [load])
async function save(m, enabled) {
setBusy(m.key)
try {
await client.put(`/api/platform/modules/${m.key}`, { enabled })
await Promise.all([load(), refresh()])
toast.success(t('modules.changed', { name: t(`modules:${m.key}.name`), state: enabled ? t('modules.on') : t('modules.off') }))
} catch (err) {
toast.error(errorMessage(err, t))
} finally {
setBusy(null)
}
}
function toggle(m, enabled) {
const stopped = enabled ? [] : stoppedBy(m.key, modules)
if (stopped.length) setConfirm({ module: m, stopped })
else save(m, enabled)
}
const sections = useMemo(() => {
if (!modules) return []
const byName = (a, b) => t(`modules:${a.key}.name`).localeCompare(t(`modules:${b.key}.name`))
return kinds
.map(kind => ({ kind, items: modules.filter(m => m.kind === kind).sort(byName) }))
.filter(s => s.items.length)
}, [modules, kinds, t])
if (error) return <div className="p-8"><EmptyState title={error} action={<Button variant="secondary" onClick={load}>{t('common:actions.retry')}</Button>} /></div>
if (!modules) return <div className="p-8 flex justify-center"><Spinner /></div>
return (
<div className="p-6 lg:p-8 max-w-6xl grid gap-8">
<div>
<p className="text-body text-ink-2 max-w-2xl">{intro}</p>
{!canManage && <p className="text-label text-ink-3 mt-1">{t('modules.readOnly')}</p>}
</div>
{sections.map(({ kind, items }) => (
<section key={kind} className="grid gap-3">
{kinds.length > 1 && <h2 className="text-label font-semibold uppercase tracking-wide text-ink-3">{t(`modules.sections.${kind}`)}</h2>}
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
{items.map(m => (
<ModuleCard key={m.key} m={m} modules={modules} canManage={canManage} busy={busy === m.key} onToggle={toggle} />
))}
</div>
</section>
))}
<Dialog
open={!!confirm}
onClose={() => setConfirm(null)}
size="sm"
title={confirm ? t('modules.confirmOffTitle', { name: t(`modules:${confirm.module.key}.name`) }) : ''}
footer={confirm && (
<>
<Button variant="secondary" onClick={() => setConfirm(null)}>{t('common:actions.cancel')}</Button>
<Button variant="danger" onClick={() => { const m = confirm.module; setConfirm(null); save(m, false) }}>{t('modules.turnOff')}</Button>
</>
)}
>
{confirm && (
<span data-testid="confirm-stopped">
{t('modules.confirmOffBody', { list: confirm.stopped.map(s => t(`modules:${s.key}.name`)).join(', ') })}
</span>
)}
</Dialog>
</div>
)
}
function ModuleCard({ m, modules, canManage, busy, onToggle }) {
const { t } = useTranslation('manager')
const navigate = useNavigate()
const name = t(`modules:${m.key}.name`)
const state = moduleState(m)
const label = key => t(`modules:${key}.name`)
const waitingFor = m.depends.filter(d => !modules.find(x => x.key === d)?.effective)
const chip = {
always: ['bg-surface-2 text-ink-2', t('modules.alwaysOn')],
not_licensed: ['bg-warning-soft text-warning-ink', t('modules.notLicensed')],
on: ['bg-success-soft text-success-ink', t('modules.on')],
waiting: ['bg-warning-soft text-warning-ink', t('modules.waiting', { list: waitingFor.map(label).join(', ') })],
off: ['bg-surface-2 text-ink-3', t('modules.off')],
}[state]
return (
<div className="bg-surface border border-line rounded-card shadow-raised p-5 flex flex-col gap-3" data-testid={`module-${m.key}`} data-state={state}>
<div className="flex items-start gap-3">
<div className="flex-1 min-w-0">
<div className="text-body-lg font-semibold text-ink">{name}</div>
<span className={`inline-block mt-1 rounded-full px-2 py-0.5 text-caption font-medium ${chip[0]}`}>{chip[1]}</span>
</div>
{m.can_disable && state !== 'not_licensed' && (
<Switch
checked={m.enabled}
disabled={!canManage || busy}
onChange={on => onToggle(m, on)}
aria-label={t('modules.toggleLabel', { name })}
/>
)}
</div>
<p className="text-label text-ink-2 flex-1">{t(`modules:${m.key}.description`)}</p>
{m.depends.length > 0 && state !== 'waiting' && (
<p className="text-caption text-ink-3">{t('modules.needs', { list: m.depends.map(label).join(', ') })}</p>
)}
{m.limits.length > 0 && (
<dl className="grid gap-1 text-caption">
{m.limits.map(l => (
<div key={l.key} className="flex justify-between gap-3">
<dt className="text-ink-3">{t(`modules:${m.key}.limits.${l.key}`)}</dt>
<dd className="text-ink font-medium">{l.value == null ? t('modules.unlimited') : l.value}</dd>
</div>
))}
</dl>
)}
{OPEN_PATH[m.key] && state === 'on' && (
<div><Button size="sm" variant="secondary" onClick={() => navigate(OPEN_PATH[m.key])}>{t('modules.open')}</Button></div>
)}
</div>
)
}
@@ -0,0 +1,28 @@
// Pure helpers for the Apps/Integrations pages (plan step 2.6c).
/** Modules that stop working if `key` is off (they depend on it, directly or not), currently on. */
export function stoppedBy(key, modules) {
const out = []
const seen = new Set([key])
let frontier = [key]
while (frontier.length) {
const next = []
for (const m of modules) {
if (seen.has(m.key) || !m.depends.some(d => frontier.includes(d))) continue
seen.add(m.key)
next.push(m.key)
if (m.effective) out.push(m)
}
frontier = next
}
return out
}
/** The card's state: always | not_licensed | on | waiting | off */
export function moduleState(m) {
if (!m.can_disable) return 'always'
if (!m.entitled) return 'not_licensed'
if (m.enabled && m.effective) return 'on'
if (m.enabled) return 'waiting'
return 'off'
}
+4 -2
View File
@@ -16,7 +16,7 @@ import {
BookUser, Users, Receipt, CreditCard, BookUser, Users, Receipt, CreditCard,
Package, TableProperties, UserCog, CalendarDays, Trash2, Boxes, Package, TableProperties, UserCog, CalendarDays, Trash2, Boxes,
BarChart2, TrendingUp, Users2, ShoppingCart, Tag, Activity, Printer, ConciergeBell, FileText, BarChart2, TrendingUp, Users2, ShoppingCart, Tag, Activity, Printer, ConciergeBell, FileText,
AppWindow, Settings, CookingPot, StickyNote, Percent, AppWindow, Settings, CookingPot, StickyNote, Percent, Plug, BadgeCheck,
} from 'lucide-react' } from 'lucide-react'
const DASH = 'core.dashboard.access' const DASH = 'core.dashboard.access'
@@ -95,12 +95,14 @@ export const NAV = [
export const NAV_BOTTOM = [ export const NAV_BOTTOM = [
{ to: '/apps', icon: AppWindow, label: 'nav.apps', module: 'core', perm: DASH }, { to: '/apps', icon: AppWindow, label: 'nav.apps', module: 'core', perm: DASH },
{ to: '/integrations', icon: Plug, label: 'nav.integrations', module: 'core', perm: DASH },
{ to: '/license', icon: BadgeCheck, label: 'nav.license', module: 'core', perm: DASH },
{ to: '/settings', icon: Settings, label: 'nav.settings', module: 'core', perm: 'core.settings.manage' }, { to: '/settings', icon: Settings, label: 'nav.settings', module: 'core', perm: 'core.settings.manage' },
] ]
// Pages that aren't in the sidebar but still have a title and a guard // Pages that aren't in the sidebar but still have a title and a guard
const EXTRA = [ const EXTRA = [
{ to: '/apps/phone', label: 'nav.phone', parent: 'nav.apps', module: 'caller_id', perm: DASH }, { to: '/apps/phone', label: 'nav.phone', parent: 'nav.integrations', module: 'caller_id', perm: DASH },
{ to: '/kds', label: 'nav.kds', module: 'kds', perm: DASH }, { to: '/kds', label: 'nav.kds', module: 'kds', perm: DASH },
{ prefix: '/orders/', label: 'nav.order', module: 'ordering', perm: DASH }, { prefix: '/orders/', label: 'nav.order', module: 'ordering', perm: DASH },
] ]
+51 -1
View File
@@ -40,7 +40,9 @@
"settings": "Ρυθμίσεις", "settings": "Ρυθμίσεις",
"order": "Παραγγελία", "order": "Παραγγελία",
"kds": "Οθόνη κουζίνας", "kds": "Οθόνη κουζίνας",
"soon": "σύντομα" "soon": "σύντομα",
"integrations": "Συνδέσεις",
"license": "Άδεια"
}, },
"profile": { "profile": {
"edit": "Επεξεργασία προφίλ", "edit": "Επεξεργασία προφίλ",
@@ -77,5 +79,53 @@
"lock": { "lock": {
"title": "Κλειδωμένο", "title": "Κλειδωμένο",
"signOutInstead": "Αποσύνδεση" "signOutInstead": "Αποσύνδεση"
},
"modules": {
"appsIntro": "Ενεργοποιήστε ή απενεργοποιήστε μέρη του συστήματος για αυτό το κατάστημα. Ό,τι είναι κλειστό εξαφανίζεται από όλες τις οθόνες και τα δεδομένα του μένουν ασφαλή.",
"integrationsIntro": "Συνδέσεις με άλλο εξοπλισμό και υπηρεσίες.",
"sections": {
"app": "Εφαρμογές συσκευών",
"feature": "Λειτουργίες",
"core": "Περιλαμβάνονται πάντα"
},
"on": "Ενεργό",
"off": "Ανενεργό",
"alwaysOn": "Πάντα ενεργό",
"notLicensed": "Δεν περιλαμβάνεται στην άδεια",
"waiting": "Περιμένει: {{list}}",
"needs": "Χρειάζεται: {{list}}",
"open": "Άνοιγμα",
"unlimited": "Απεριόριστο",
"toggleLabel": "{{name}} ενεργό ή ανενεργό",
"confirmOffTitle": "Απενεργοποίηση: {{name}};",
"confirmOffBody": "Όσο είναι κλειστό, σταματούν να λειτουργούν και: {{list}}.",
"turnOff": "Απενεργοποίηση",
"changed": "{{name}}: {{state}}",
"readOnly": "Μόνο όποιος έχει δικαίωμα διαχείρισης εφαρμογών μπορεί να τα αλλάξει."
},
"licensePage": {
"status": "Κατάσταση",
"statusDev": "Λειτουργία ανάπτυξης (όλες οι λειτουργίες, χωρίς όρια)",
"statusLicensed": "Με άδεια",
"statusFree": "Δωρεάν έκδοση",
"siteId": "Κωδικός καταστήματος",
"expires": "Ισχύει μέχρι",
"daysLeft_one": "Απομένει {{count}} ημέρα",
"daysLeft_other": "Απομένουν {{count}} ημέρες",
"lastSync": "Τελευταία επικοινωνία με τον server αδειών",
"never": "ποτέ",
"syncNow": "Έλεγχος άδειας τώρα",
"synced": "Η άδεια ελέγχθηκε",
"syncFailed": "Δεν υπάρχει σύνδεση με τον server αδειών",
"offline": "Καμία επικοινωνία με τον server αδειών εδώ και {{count}} ημέρες. Το κατάστημα συνεχίζει να λειτουργεί μέχρι να λήξει η άδεια.",
"modules": "Λειτουργίες",
"module": "Λειτουργία",
"included": "Περιλαμβάνεται",
"inLicense": "Στην άδειά σας",
"inLicenseUntil": "Στην άδειά σας μέχρι {{date}}",
"free": "Δωρεάν έκδοση",
"dev": "Ανάπτυξη",
"notIncluded": "Δεν περιλαμβάνεται",
"limits": "Όρια"
} }
} }
+123
View File
@@ -0,0 +1,123 @@
{
"caller_id": {
"name": "Αναγνώριση κλήσης",
"description": "Εισερχόμενες κλήσεις από το τηλεφωνικό κέντρο του καταστήματος (Grandstream UCM)."
},
"catalog": {
"name": "Κατάλογος",
"description": "Προϊόντα, κατηγορίες, επιλογές, τραπέζια και ζώνες ετοιμασίας."
},
"chat": {
"name": "Συνομιλία προσωπικού",
"description": "Συνομιλία του προσωπικού και μηνύματα του υπευθύνου προς το προσωπικό."
},
"connect_menu": {
"name": "QR μενού",
"description": "Το online μενού με QR, συγχρονισμένο με τον κατάλογο."
},
"connect_orders": {
"name": "Online παραγγελίες",
"description": "Παραγγελίες από το QR μενού, που έρχονται από το cloud."
},
"connect_remote": {
"name": "Απομακρυσμένη διαχείριση",
"description": "Ζωντανά στοιχεία για την εφαρμογή απομακρυσμένης διαχείρισης του ιδιοκτήτη."
},
"core": {
"name": "Βασικό σύστημα",
"description": "Σύνδεση, προσωπικό, ρυθμίσεις, άδεια, σύστημα και ζωντανές ενημερώσεις. Πάντα ενεργό."
},
"crm": {
"name": "Πελάτες",
"description": "Αρχείο πελατών."
},
"customer_display": {
"name": "Οθόνη πελάτη",
"description": "Οθόνη προς τον πελάτη δίπλα σε ταμείο πάγκου (έρχεται σύντομα).",
"limits": {
"devices": "Οθόνες πελάτη"
}
},
"expenses": {
"name": "Έξοδα",
"description": "Έξοδα, πληρωμές και βιβλίο προμηθευτών."
},
"fiscal": {
"name": "Φορολογικός μηχανισμός",
"description": "Αποστολή αποδείξεων στον φορολογικό μηχανισμό (ΦΗΜ) μέσω του φακέλου γέφυρας."
},
"history": {
"name": "Ιστορικό παραγγελιών",
"description": "Παλιές παραγγελίες και σύνοψη εργάσιμων ημερών (μόνο προβολή). Δωρεάν, με σύντομο ιστορικό.",
"limits": {
"history_days": "Ημέρες ιστορικού για προβολή"
}
},
"inventory": {
"name": "Αποθήκη",
"description": "Καταγραφή απορριμμάτων και κόστος προϊόντων."
},
"kds": {
"name": "Οθόνη κουζίνας",
"description": "Οθόνες στην κουζίνα ή στο μπαρ με τις παραγγελίες προς ετοιμασία.",
"limits": {
"devices": "Οθόνες κουζίνας"
}
},
"menu_tablet": {
"name": "Tablet μενού",
"description": "Κατάλογος αυτοεξυπηρέτησης σε tablet (έρχεται σύντομα).",
"limits": {
"devices": "Tablet μενού"
}
},
"notes": {
"name": "Σημειώσεις",
"description": "Σημειώσεις και εργασίες του καταστήματος."
},
"ordering": {
"name": "Παραγγελίες",
"description": "Παραγγελίες, πληρωμές, εργάσιμη ημέρα, βάρδιες, ταμείο και εκτύπωση κουζίνας."
},
"pos_counter": {
"name": "Ταμείο πάγκου",
"description": "Τερματικό στον πάγκο για γρήγορες παραγγελίες (έρχεται σύντομα).",
"limits": {
"devices": "Τερματικά πάγκου"
}
},
"pricing": {
"name": "Τιμολόγηση",
"description": "Ομάδες τιμών, happy hour, τροποποιητές, προσφορές και εκπτώσεις σερβιτόρων."
},
"reports": {
"name": "Αναφορές",
"description": "Πλήρεις αναφορές πωλήσεων, προϊόντων, προσωπικού και εκτυπωτών, εξαγωγή CSV και εκτυπωμένες αναφορές.",
"limits": {
"history_days": "Ημέρες που καλύπτουν οι αναφορές"
}
},
"reservations": {
"name": "Κρατήσεις",
"description": "Κρατήσεις τραπεζιών."
},
"signage": {
"name": "Ψηφιακή σήμανση",
"description": "Μενού και προσφορές σε τηλεοράσεις (έρχεται σύντομα).",
"limits": {
"devices": "Οθόνες σήμανσης"
}
},
"staff_planning": {
"name": "Προγραμματισμός προσωπικού",
"description": "Πρόγραμμα βαρδιών και μισθοδοσία."
},
"tabs": {
"name": "Καρτέλες",
"description": "Καρτέλες πληρωμής αργότερα για τακτικούς πελάτες."
},
"waiter_app": {
"name": "Εφαρμογή σερβιτόρων",
"description": "Λήψη παραγγελιών από τα κινητά των σερβιτόρων (web και εφαρμογή Android)."
}
}
+51 -1
View File
@@ -40,7 +40,9 @@
"settings": "Settings", "settings": "Settings",
"order": "Order", "order": "Order",
"kds": "Kitchen display", "kds": "Kitchen display",
"soon": "soon" "soon": "soon",
"integrations": "Integrations",
"license": "License"
}, },
"profile": { "profile": {
"edit": "Edit profile", "edit": "Edit profile",
@@ -77,5 +79,53 @@
"lock": { "lock": {
"title": "Locked", "title": "Locked",
"signOutInstead": "Sign out instead" "signOutInstead": "Sign out instead"
},
"modules": {
"appsIntro": "Turn parts of the system on or off for this venue. What's off disappears from every screen and its data stays safe.",
"integrationsIntro": "Connections to other equipment and services.",
"sections": {
"app": "Device apps",
"feature": "Features",
"core": "Always included"
},
"on": "On",
"off": "Off",
"alwaysOn": "Always on",
"notLicensed": "Not in your license",
"waiting": "Waiting for {{list}}",
"needs": "Needs {{list}}",
"open": "Open",
"unlimited": "Unlimited",
"toggleLabel": "{{name}} on or off",
"confirmOffTitle": "Turn off {{name}}?",
"confirmOffBody": "These stop working too while it's off: {{list}}.",
"turnOff": "Turn off",
"changed": "{{name}} is now {{state}}",
"readOnly": "Only someone with permission to manage apps can change these."
},
"licensePage": {
"status": "Status",
"statusDev": "Development mode (every module, no limits)",
"statusLicensed": "Licensed",
"statusFree": "Free version",
"siteId": "Site ID",
"expires": "Valid until",
"daysLeft_one": "{{count}} day left",
"daysLeft_other": "{{count}} days left",
"lastSync": "Last contact with the license server",
"never": "never",
"syncNow": "Check the license now",
"synced": "License checked",
"syncFailed": "Couldn't reach the license server",
"offline": "No contact with the license server for {{count}} days. The venue keeps working until the license expires.",
"modules": "Modules",
"module": "Module",
"included": "Included",
"inLicense": "In your license",
"inLicenseUntil": "In your license until {{date}}",
"free": "Free version",
"dev": "Development",
"notIncluded": "Not included",
"limits": "Limits"
} }
} }
+123
View File
@@ -0,0 +1,123 @@
{
"caller_id": {
"name": "Caller ID",
"description": "Incoming phone calls from the venue's phone system (Grandstream UCM)."
},
"catalog": {
"name": "Catalogue",
"description": "Products, categories, options, tables and prep zones."
},
"chat": {
"name": "Staff chat",
"description": "Staff chat and manager messages to staff."
},
"connect_menu": {
"name": "QR menu",
"description": "The online QR menu, kept in sync with the catalogue."
},
"connect_orders": {
"name": "Online orders",
"description": "Orders placed from the QR menu, brought in from the cloud."
},
"connect_remote": {
"name": "Remote manager",
"description": "Live figures for the owner's remote manager app."
},
"core": {
"name": "Core",
"description": "Sign-in, staff, settings, license, system and live updates. Always on."
},
"crm": {
"name": "Customers",
"description": "Customer records."
},
"customer_display": {
"name": "Customer display",
"description": "A screen facing the customer at a counter POS (coming soon).",
"limits": {
"devices": "Customer displays"
}
},
"expenses": {
"name": "Expenses",
"description": "Expenses, payments and the supplier book."
},
"fiscal": {
"name": "Fiscal device",
"description": "Sends receipts to the fiscal device (ΦΗΜ) through its folder bridge."
},
"history": {
"name": "Order history",
"description": "Past orders and business-day summaries (read only). Free, with a short history.",
"limits": {
"history_days": "Days of history you can view"
}
},
"inventory": {
"name": "Inventory",
"description": "Waste log and product costs."
},
"kds": {
"name": "Kitchen display",
"description": "Screens in the kitchen or bar showing the orders to prepare.",
"limits": {
"devices": "Kitchen screens"
}
},
"menu_tablet": {
"name": "Menu tablet",
"description": "A self-service catalogue on a tablet (coming soon).",
"limits": {
"devices": "Menu tablets"
}
},
"notes": {
"name": "Notes",
"description": "Venue notes and to-dos."
},
"ordering": {
"name": "Ordering",
"description": "Orders, payments, business day, shifts, cash and kitchen printing."
},
"pos_counter": {
"name": "Counter POS",
"description": "A counter terminal for quick orders (coming soon).",
"limits": {
"devices": "Counter terminals"
}
},
"pricing": {
"name": "Pricing",
"description": "Price groups, happy hours, modifiers, deals and waiter discounts."
},
"reports": {
"name": "Reports",
"description": "Full sales, product, staff and printer reports, CSV export and printed reports.",
"limits": {
"history_days": "Days of history reports can cover"
}
},
"reservations": {
"name": "Reservations",
"description": "Table reservations."
},
"signage": {
"name": "Digital signage",
"description": "Menus and promotions on TVs (coming soon).",
"limits": {
"devices": "Signage screens"
}
},
"staff_planning": {
"name": "Staff planning",
"description": "Shift schedule and payroll."
},
"tabs": {
"name": "Tabs",
"description": "Pay-later tabs for regular customers."
},
"waiter_app": {
"name": "Waiter app",
"description": "Order taking on the waiters' phones (web and Android app)."
}
}
+7 -4
View File
@@ -1,20 +1,23 @@
// Every locale file, bundled (they're small; no loading step, no flash of keys). // Every locale file, bundled (they're small; no loading step, no flash of keys).
// Layout (APPS_PLATFORM §8): locales/<lang>/<namespace>.json. English is the source. // Layout (APPS_PLATFORM §8): locales/<lang>/<namespace>.json. English is the source.
// Namespaces: common (shared words, component labels), errors (backend error codes, // Namespaces: common (shared words, component labels), errors (backend error codes,
// local_backend/core/errors.py; tests/errors.test.mjs keeps them complete), manager (the manager shell, 2.6), // local_backend/core/errors.py; tests/errors.test.mjs keeps them complete), manager (the manager shell, 2.6), modules (module
// names/descriptions/limits for staff; local_backend/tests/test_module_texts.py keeps them complete),
// dev (sample screens). Apps add theirs here as they're converted: waiter, terminal, modules. // dev (sample screens). Apps add theirs here as they're converted: waiter, terminal, modules.
import elCommon from '../locales/el/common.json' import elCommon from '../locales/el/common.json'
import elDev from '../locales/el/dev.json' import elDev from '../locales/el/dev.json'
import elErrors from '../locales/el/errors.json' import elErrors from '../locales/el/errors.json'
import elManager from '../locales/el/manager.json' import elManager from '../locales/el/manager.json'
import elModules from '../locales/el/modules.json'
import enCommon from '../locales/en/common.json' import enCommon from '../locales/en/common.json'
import enDev from '../locales/en/dev.json' import enDev from '../locales/en/dev.json'
import enErrors from '../locales/en/errors.json' import enErrors from '../locales/en/errors.json'
import enManager from '../locales/en/manager.json' import enManager from '../locales/en/manager.json'
import enModules from '../locales/en/modules.json'
export const NAMESPACES = ['common', 'errors', 'manager', 'dev'] export const NAMESPACES = ['common', 'errors', 'manager', 'modules', 'dev']
export const resources = { export const resources = {
en: { common: enCommon, errors: enErrors, manager: enManager, dev: enDev }, en: { common: enCommon, errors: enErrors, manager: enManager, modules: enModules, dev: enDev },
el: { common: elCommon, errors: elErrors, manager: elManager, dev: elDev }, el: { common: elCommon, errors: elErrors, manager: elManager, modules: elModules, dev: elDev },
} }
+37
View File
@@ -108,6 +108,43 @@ try {
await page.waitForFunction(() => document.querySelector('[data-testid="sidebar"]')?.innerText.includes('Management'), null, { timeout: 5000 }).catch(() => {}) await page.waitForFunction(() => document.querySelector('[data-testid="sidebar"]')?.innerText.includes('Management'), null, { timeout: 5000 }).catch(() => {})
r.check('language → English again', await sidebar.getByText('Management').count() > 0) r.check('language → English again', await sidebar.getByText('Management').count() > 0)
// ── 2.6c: Apps page: module cards, toggles, dependency warning ─────────────
await page.goto(`${APP}/apps`)
await page.getByTestId('module-notes').waitFor({ timeout: 15_000 })
const card = key => page.getByTestId(`module-${key}`)
r.check('apps: cards for device apps, features and core', await card('kds').count() === 1 && await card('notes').count() === 1 && await card('core').count() === 1)
r.check('apps: core is "Always on" with no switch', await card('core').getAttribute('data-state') === 'always' && await card('core').getByRole('switch').count() === 0)
await card('notes').getByRole('switch').click()
await page.waitForFunction(() => document.querySelector('[data-testid="module-notes"]')?.dataset.state === 'off', null, { timeout: 8000 }).catch(() => {})
await sidebar.getByText('Management').click().catch(() => {})
r.check('apps: notes switched off from its card → state off, gone from the sidebar',
await card('notes').getAttribute('data-state') === 'off' && await sidebar.getByText('Notes', { exact: true }).count() === 0)
await card('notes').getByRole('switch').click()
await page.waitForFunction(() => document.querySelector('[data-testid="module-notes"]')?.dataset.state === 'on', null, { timeout: 8000 }).catch(() => {})
r.check('apps: notes back on', await card('notes').getAttribute('data-state') === 'on' && await sidebar.getByText('Notes', { exact: true }).count() === 1)
await card('ordering').getByRole('switch').click()
const stopped = await page.getByTestId('confirm-stopped').textContent({ timeout: 5000 }).catch(() => '')
r.check('apps: turning off Ordering first lists what stops with it', ['Kitchen display', 'Waiter app', 'Pricing'].every(n => stopped.includes(n)), stopped)
await page.getByRole('dialog').getByRole('button', { name: 'Cancel' }).click()
r.check('apps: Cancel leaves Ordering on', await card('ordering').getAttribute('data-state') === 'on')
r.check('apps: a card with a page has "Open" (KDS)', await card('kds').getByRole('button', { name: 'Open' }).count() === 1)
// ── 2.6c: Integrations and License ─────────────────────────────────────────
await page.goto(`${APP}/integrations`)
await card('fiscal').waitFor({ timeout: 15_000 })
r.check('integrations: only integrations (fiscal, caller ID)', await card('caller_id').count() === 1 && await card('kds').count() === 0)
await page.goto(`${APP}/license`)
await page.getByTestId('license-status').waitFor({ timeout: 20_000 })
r.check('license: development mode, site id, a row per module',
(await page.getByTestId('license-mode').textContent()).startsWith('Development mode')
&& (await page.getByTestId('license-site').textContent()) === 'test-site-1'
&& await page.locator('[data-testid^="license-row-"]').count() >= 20)
r.check('license: limits are shown (kitchen screens: unlimited in dev)', (await page.getByTestId('license-row-kds').textContent()).includes('Kitchen screens'))
await page.screenshot({ path: path.join(OUT, 'manager-license.png'), fullPage: true })
await page.goto(`${APP}/apps`)
await card('notes').waitFor()
await page.screenshot({ path: path.join(OUT, 'manager-apps.png'), fullPage: true })
// ── Lock screen: a wrong PIN stays locked (no logout), the right one unlocks ─ // ── Lock screen: a wrong PIN stays locked (no logout), the right one unlocks ─
await page.goto(`${APP}/dashboard`) await page.goto(`${APP}/dashboard`)
await sleep(1500) await sleep(1500)