feat(manager): the setup wizard and the shell on v2; all of src on the v2 rules (platform-v2 step 6.14b)
- setup wizard (src/pages/setup): welcome (pick the language: the wizard switches at once), the owner's account, the venue (kind, name, staff language, time zone), an optional lock-screen PIN, finish -> sign in; English and Greek - shell (src/shell): AppLayout (license banner in both languages, header, lock button, idle lock / sign-out), Sidebar on a new 'nav' token set in @xenia/ui (light + dark), ProfileDialog (name, username, password, 4-6 digit PIN), licenseContext; App.jsx loads the session and the setup state with react-query (no setState in effects); the header's dead search box gone - Management -> Tables -> List (src/pages/tables, was TablesConfigTab): zones as tabs (drag to reorder), zone name / prefix / colour, add many numbered on, a table's name (6 chars) / zone / seats, twice-used names flagged, off / on / delete, pick several to move, rename in a series or delete (says how many failed) - the old src/ui kit, layouts/, components/Sidebar + EditProfileModal, the 'primary' palette and the .btn/.card/.input classes deleted; NotificationBell / UserMenuButton on tokens; @xenia/ui: nav tokens, 'scrim' in the Tailwind preset - v2.json paths = src (the guards cover all of it); npm run lint = eslint src; argsIgnorePattern for components in JSX - tests: shell.test.mjs (3), e2e setup.mjs (new: a fresh install through the wizard in Greek to the overview, in run-all), manager.mjs 'tables list' (zone, 3 tables, rename series, profile PIN, rail tokens) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -770,6 +770,46 @@ try {
|
||||
await page.getByTestId('user-menu').click()
|
||||
await page.getByRole('menuitemradio', { name: 'English' }).click()
|
||||
|
||||
// ── 6.14b: the tables list, the profile, the shell on v2 ──────────────────────
|
||||
const tl = 'tables list:'
|
||||
await page.goto(`${APP}/management/tables`)
|
||||
await page.getByTestId('zone-new').click()
|
||||
await page.getByTestId('zone-save').click()
|
||||
r.check(`${tl} a zone needs a name`, (await page.getByTestId('zone-dialog').textContent()).includes('Enter a name'))
|
||||
await page.getByTestId('zone-name').fill('E2E Zone')
|
||||
await page.getByTestId('zone-prefix').fill('EZ')
|
||||
await page.getByTestId('zone-save').click()
|
||||
const zoneTab = page.locator('[data-testid="zone-tab"]', { hasText: 'E2E Zone' })
|
||||
await zoneTab.waitFor({ timeout: 8000 }).catch(() => {})
|
||||
await zoneTab.click()
|
||||
await page.getByTestId('tables-batch').click()
|
||||
await page.getByTestId('batch-count').fill('3')
|
||||
r.check(`${tl} adding many: the button says the series (EZ-1 … EZ-3)`, (await page.getByTestId('batch-save').textContent()).includes('EZ-1') && (await page.getByTestId('batch-save').textContent()).includes('EZ-3'))
|
||||
await page.getByTestId('batch-save').click()
|
||||
await page.locator('[data-testid="table-row"][data-name="EZ-3"]').waitFor({ timeout: 8000 }).catch(() => {})
|
||||
const ezZone = (await api('GET', '/api/tables/groups', { token: boss })).find(g => g.name === 'E2E Zone')
|
||||
let ezTables = (await api('GET', '/api/tables/', { token: boss })).filter(x => x.group_id === ezZone?.id)
|
||||
r.check(`${tl} a zone with 3 tables EZ-1..EZ-3`, ezTables.map(x => x.label).sort().join() === 'EZ-1,EZ-2,EZ-3', JSON.stringify(ezTables.map(x => x.label)))
|
||||
await page.getByTestId('tables-pick').click()
|
||||
for (const row of await page.getByTestId('table-row').all()) await row.locator('input[type=checkbox]').check()
|
||||
await page.getByTestId('tables-rename').click()
|
||||
await page.getByTestId('rename-prefix').fill('Q')
|
||||
await page.getByTestId('rename-save').click()
|
||||
await page.locator('[data-testid="table-row"][data-name="Q3"]').waitFor({ timeout: 8000 }).catch(() => {})
|
||||
ezTables = (await api('GET', '/api/tables/', { token: boss })).filter(x => x.group_id === ezZone?.id)
|
||||
r.check(`${tl} the 3 picked tables renamed in a series (Q1..Q3)`, ezTables.map(x => x.label).sort().join() === 'Q1,Q2,Q3', JSON.stringify(ezTables.map(x => x.label)))
|
||||
await page.screenshot({ path: path.join(OUT, 'manager-tables-list.png'), fullPage: true })
|
||||
for (const x of ezTables) await api('DELETE', `/api/tables/${x.id}?hard=true`, { token: boss }).catch(() => {})
|
||||
if (ezZone) await api('DELETE', `/api/tables/groups/${ezZone.id}`, { token: boss }).catch(() => {})
|
||||
await page.getByTestId('user-menu').click()
|
||||
await page.getByRole('menuitem', { name: 'Edit profile' }).click()
|
||||
await page.getByTestId('profile-pin').fill('12')
|
||||
await page.getByTestId('profile-pin2').fill('12')
|
||||
await page.getByTestId('profile-save').click()
|
||||
r.check(`${tl} the profile: a PIN of 2 digits is refused before saving`, (await page.getByTestId('profile-dialog').textContent()).includes('4 to 6 digits'))
|
||||
await page.keyboard.press('Escape')
|
||||
r.check(`${tl} the side rail is drawn with the nav tokens`, await page.getByTestId('sidebar').evaluate(el => getComputedStyle(el).backgroundColor) === 'rgb(17, 94, 89)')
|
||||
|
||||
await page.goto(`${APP}/reports/technical`)
|
||||
await page.getByText('Log files', { exact: true }).click()
|
||||
const today = new Date().toISOString().slice(0, 10)
|
||||
|
||||
Reference in New Issue
Block a user