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,17 @@ test('owner review 4: a part\'s widgets (one stored as `widget` too), badges tha
|
||||
assert.equal(readableOn('#1e3a8acc'), '#ffffff')
|
||||
assert.equal(readableOn('#f59e0b'), '#111111')
|
||||
assert.equal(readableOn('#fff'), '#111111')
|
||||
assert.deepEqual(menuLook({ accent_colour: '#1e3a8a' }).badge, { background: '#1e3a8a', color: '#ffffff' })
|
||||
assert.deepEqual(menuLook({ accent_colour: '#1e3a8a', badge_text_colour: '#fde68a' }).badge, { background: '#1e3a8a', color: '#fde68a' })
|
||||
assert.equal(menuLook({ accent_colour: '#123456', heading_style: { colour: '#ff0000' } }).title, '#ff0000')
|
||||
})
|
||||
|
||||
test('owner review 5: the venue badges, several per product; a board with its own badge colours', async () => {
|
||||
const { badgeColours, badgeName, DEFAULT_BADGES, itemBadges } = await import('../src/logic.js')
|
||||
const mine = [{ key: 'gf', names: { en: 'Gluten free' }, colour: '#0ea5e9', text_colour: null, icon: 'wheat-off' }, DEFAULT_BADGES[1]]
|
||||
assert.deepEqual(itemBadges({ badges: ['chef', 'gf', 'gone'] }, mine).map(d => d.key), ['chef', 'gf'])
|
||||
assert.deepEqual(itemBadges({ badge: 'new' }, null).map(d => d.key), ['new']) // stored before: one badge; no list yet: the defaults
|
||||
assert.deepEqual(badgeColours(mine[0]), { background: '#0ea5e9', color: '#111111' })
|
||||
assert.deepEqual(badgeColours(mine[0], { badge_colour: '#1e3a8a' }), { background: '#1e3a8a', color: '#ffffff' })
|
||||
assert.deepEqual(badgeColours(mine[0], { badge_text_colour: '#fde68a' }), { background: '#0ea5e9', color: '#fde68a' })
|
||||
assert.equal(badgeName(mine[0], 'el'), 'Gluten free')
|
||||
assert.equal(badgeName(DEFAULT_BADGES[1], 'el'), 'Πρόταση σεφ')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user