feat(signage): venue badges, widgets' own look, widgets placed inside stacks, Save and leave, shared controls (owner review 5)
- Badges: the venue's list (setting signage.badges: names el/en, colours, an icon from a food and drink set) edited under Signage -> "Message & settings"; sent with the venue to screens and previews; several badges per product (MenuList.badges lists, a single one still read) in the shared multiple Dropdown; a board's badge colour / text colour override them (None = each own). - Widgets: colour, background plate, font, bold / italic / underline, text size, QR colours; widgets in a stack's part get every setting, vertical alignment, and a custom box inside their place, picked (stack, then widget) and dragged on the preview (selection by path "2.1.0"). - Menu slides: vertical alignment of the list (board_valign); "Where the list sits" is now "Horizontal alignment". - Message of the day: one component in the settings tab, on the Overview and from its widget. - Leaving a slide with changes: "Save and leave" (ConfirmDialog altLabel). - @xenia/ui: ColourField (with colour.js helpers), FieldRow (framed only while wrapped), Slider, IconPicker, Segmented multiple; native selects on the Overview and signage replaced by Dropdown, the device settings' colour input by ColourField. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -202,7 +202,7 @@ try {
|
||||
r.check('devices: the kitchen screen settings come in sections, prep zone "All zones" by default (3.2a)',
|
||||
await dlg.locator('[data-config-group]').count() >= 4
|
||||
&& (await dlg.getByLabel('Prep zone').locator('option:checked').textContent()) === 'All zones'
|
||||
&& await dlg.locator('input[type="color"]').count() === 4)
|
||||
&& await dlg.locator('button[data-testid^="config-colour"][data-testid$="-open"]').count() === 4) // the shared colour field (owner review 5)
|
||||
await dlg.getByLabel('Text size').fill('110')
|
||||
await dlg.getByRole('button', { name: 'Pair a device' }).click()
|
||||
await page.waitForFunction(() => document.querySelectorAll('[data-testid^="device-"][data-status]').length === 1, null, { timeout: 8000 }).catch(() => {})
|
||||
@@ -933,7 +933,8 @@ try {
|
||||
r.check(`${ov} "Open the day" opens it`, await dayState() === 'true' && !!(await api('GET', '/api/business-day/current', { token: boss })))
|
||||
const ovWaiter = (await api('GET', '/api/waiters/', { token: boss })).find(w => w.username === 'demo_maria')
|
||||
await page.getByTestId('shift-start').click()
|
||||
await page.getByTestId('shift-start-waiter').selectOption(String(ovWaiter.id))
|
||||
await page.getByTestId('shift-start-waiter').click()
|
||||
await page.getByRole('option', { name: ovWaiter.full_name || ovWaiter.username }).click()
|
||||
await page.getByRole('dialog').getByLabel('Starting cash').fill('20,5')
|
||||
await page.getByTestId('shift-start-confirm').click()
|
||||
const ovRow = page.getByTestId('shift-row').filter({ hasText: ovWaiter.full_name })
|
||||
|
||||
+42
-4
@@ -282,14 +282,18 @@ try {
|
||||
const firstRow = mgr.getByTestId('signage-menu-row').first()
|
||||
await sleep(700)
|
||||
const badgeId = Number(await firstRow.getAttribute('data-id'))
|
||||
await firstRow.getByTestId('signage-menu-badge').selectOption('offer')
|
||||
// owner review 5: several badges, from the venue's list, in the shared dropdown
|
||||
await firstRow.getByTestId('signage-menu-badge').click()
|
||||
await mgr.getByRole('option', { name: 'Offer' }).click()
|
||||
await mgr.getByRole('option', { name: 'Spicy' }).click()
|
||||
await mgr.keyboard.press('Escape')
|
||||
const hideRow = mgr.getByTestId('signage-menu-row').nth(1)
|
||||
const hiddenId = Number(await hideRow.getAttribute('data-id'))
|
||||
await hideRow.getByTestId('signage-item-hide').click()
|
||||
await mgr.getByTestId('signage-widget-add-clock').click()
|
||||
await sleep(900)
|
||||
r.check('5.6b: the preview shows the board with its badge',
|
||||
await waitFor(async () => (await mgr.getByTestId('signage-preview').getByTestId('signage-badge').count()) > 0, 8000, 300) === true)
|
||||
r.check('5.6b: the preview shows the board with its badges (two, with their icons)',
|
||||
await waitFor(async () => (await mgr.getByTestId('signage-preview').locator('[data-testid="signage-badge"] svg').count()) >= 2, 8000, 300) === true)
|
||||
await mgr.getByTestId('signage-slide-save').click()
|
||||
await sleep(1000)
|
||||
const op = (await api('GET', '/api/signage/playlists', { token: boss })).find(x => x.name === 'Opening')
|
||||
@@ -297,7 +301,7 @@ try {
|
||||
const mc = menuSlide?.content || {}
|
||||
r.check('5.6b: saved: the categories, the single product, the hidden one, the board\'s own order, the badge, the clock',
|
||||
mc.select === 'custom' && mc.category_ids?.includes(catA.id) && mc.category_ids?.includes(catB.id) && mc.product_ids?.includes(extra.id)
|
||||
&& mc.exclude_ids?.includes(hiddenId) && mc.category_order?.[0] === catB.id && mc.badges?.[String(badgeId)] === 'offer'
|
||||
&& mc.exclude_ids?.includes(hiddenId) && mc.category_order?.[0] === catB.id && mc.badges?.[String(badgeId)]?.join() === 'offer,spicy'
|
||||
&& (mc.widgets || []).some(w => w.kind === 'clock')
|
||||
&& !menuSlide.menu.groups.flatMap(g => g.items).some(i => i.id === hiddenId && !i.hidden) && menuSlide.menu.groups[0].category?.id === catB.id,
|
||||
JSON.stringify({ select: mc.select, cats: mc.category_ids, prods: mc.product_ids, ex: mc.exclude_ids, order: mc.category_order, badges: mc.badges }))
|
||||
@@ -349,6 +353,20 @@ try {
|
||||
await stackCard.getByTestId('signage-stack-cell-editor').nth(1).locator('[data-testid="signage-stack-part-widget"][data-kind="date"]').getByTestId('signage-stack-part-remove').click()
|
||||
r.check('2026-11-21 (4): …and one of them removed',
|
||||
await waitFor(async () => (await part2().getByTestId('signage-stack-place').count()) === 1 && (await part2().getByTestId('signage-w-date').count()) === 0, 6000, 300) === true)
|
||||
// owner review 5: a widget in a part aligned to the bottom, in italics, in a colour of its own
|
||||
const textInPart = stackCard.getByTestId('signage-stack-cell-editor').nth(1).locator('[data-testid="signage-stack-part-widget"][data-kind="text"]')
|
||||
await textInPart.getByTestId('signage-cell-vertical-bottom').click()
|
||||
await textInPart.getByTestId('signage-widget-look-toggle').click()
|
||||
await textInPart.getByTestId('signage-widget-italic').click()
|
||||
await textInPart.getByTestId('signage-widget-colour-open').click()
|
||||
await mgr.getByTestId('signage-widget-colour-preset').nth(7).click()
|
||||
r.check('2026-11-21 (5): a widget in a part: at the bottom of its place, in italics, its own colour',
|
||||
await waitFor(async () => {
|
||||
const place = part2().getByTestId('signage-stack-place').first()
|
||||
const css = await place.evaluate(el => ({ align: getComputedStyle(el).alignItems, italic: getComputedStyle(el.querySelector('[data-testid="signage-w-text"]')).fontStyle,
|
||||
colour: getComputedStyle(el.querySelector('[data-widget]')).color }))
|
||||
return css.align === 'flex-end' && css.italic === 'italic' && css.colour === 'rgb(239, 68, 68)'
|
||||
}, 6000, 300) === true)
|
||||
// Delete removes the picked widget (picked on its card)
|
||||
await stackCard.locator('span', { hasText: 'Horizontal stack' }).first().click()
|
||||
await mgr.keyboard.press('Delete')
|
||||
@@ -409,6 +427,15 @@ try {
|
||||
const mc3 = (await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.find(x => x.kind === 'menu').content
|
||||
r.check('2026-11-21 (3): saved with a name for this board and the names aligned right',
|
||||
Object.values(mc3.names || {}).includes('Signature dish') && mc3.item_style?.align === 'right', JSON.stringify({ names: mc3.names, item: mc3.item_style }))
|
||||
// owner review 5: leaving a slide with changes: "Save and leave"
|
||||
await mgr.getByTestId('signage-menu-title').fill('Saved on the way out')
|
||||
await mgr.locator('[data-testid="signage-slide-card"]:not([data-kind="menu"])').first().click()
|
||||
await mgr.getByTestId('signage-discard-alt').click()
|
||||
await sleep(1000)
|
||||
r.check('2026-11-21 (5): "Save and leave" saves the slide before going to the next one',
|
||||
(await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.find(x => x.kind === 'menu').content.title === 'Saved on the way out')
|
||||
await mgr.locator('[data-testid="signage-slide-card"][data-kind="menu"]').first().click()
|
||||
await sleep(800)
|
||||
await mgr.getByTestId('signage-keep-slide').click()
|
||||
await mgr.getByTestId('signage-keep-name').fill('Board to keep')
|
||||
await mgr.getByTestId('signage-keep-confirm').click()
|
||||
@@ -436,6 +463,17 @@ try {
|
||||
await mgr.getByTestId('signage-message-save').click()
|
||||
await sleep(700)
|
||||
r.check('5.6c: the message of the day is saved from the manager', (await api('GET', '/api/signage/message', { token: boss })).text === 'Kalimera from the manager')
|
||||
// owner review 5: the venue's badges: one added with its name, colours and icon
|
||||
await mgr.getByTestId('signage-badge-add').click()
|
||||
const newRow = mgr.getByTestId('signage-badge-row').last()
|
||||
await newRow.getByTestId('signage-badge-name-en').fill('Gluten free')
|
||||
await newRow.getByTestId('signage-badge-icon-open').click()
|
||||
await mgr.getByTestId('signage-badge-icon-wheat-off').click()
|
||||
await mgr.getByTestId('signage-badges-save').click()
|
||||
await sleep(700)
|
||||
const mine = (await api('GET', '/api/signage/badges', { token: boss })).badges.at(-1)
|
||||
r.check('2026-11-21 (5): a badge of the venue saved with its name and icon', mine?.names?.en === 'Gluten free' && mine?.icon === 'wheat-off', JSON.stringify(mine))
|
||||
r.check('2026-11-21 (5): the tab is "Message & settings"', (await mgr.getByTestId('signage-tab-settings').textContent()).includes('settings'))
|
||||
r.check('5.6c: the weather section says what it needs (no town yet)', await shown(mgr, 'signage-weather', 5000)
|
||||
&& (await mgr.getByTestId('signage-weather').textContent()).includes('internet'))
|
||||
await mgr.getByTestId('signage-tab-screens').click()
|
||||
|
||||
Reference in New Issue
Block a user