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
+37
View File
@@ -108,6 +108,43 @@ try {
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)
// ── 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 ─
await page.goto(`${APP}/dashboard`)
await sleep(1500)