feat(manager): the signage editor: playlists, the timeline, slides with a live preview, templates (platform-v2 step 5.6a)
Management → Signage: playlists (name, landscape / portrait, default transition, duplicate, delete with the screens it plays on); the timeline (drag or arrows to reorder, duplicate, remove, on / off, time and when it shows at a glance, a round's total time); a slide's settings (name, seconds or a video to its end, transition, days / hours / dates, the picture or video, fit, text, alignment, font, colour, size, background colour or photo with darkening; a menu board's title, columns and colours) with a live preview drawn by @xenia/signage at 1920 × 1080 and scaled down; new slides empty or from templates (promotion, announcement, happy hour 17-19, welcome, menu board, video); a warning on the slide and its card when a picture or video doesn't fit the playlist's shape. Unit tests (4), e2e signage.mjs builds a playlist in the manager and the TV plays it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// A menu board's settings (plan steps 5.6a, 5.6b): its title, look and background. Which products
|
||||
// it lists and in what order: step 5.6b.
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { Field, Input, Select } from '@xenia/ui'
|
||||
import { BackgroundField, ColourField } from './SignageFields'
|
||||
import { TextLook } from './SlideEditor'
|
||||
|
||||
export default function MenuEditor({ slide, onChange, media, onMedia, misfit = [] }) {
|
||||
const { t } = useTranslation('manager')
|
||||
const c = slide.content || {}
|
||||
const setC = patch => onChange({ ...slide, content: { ...c, ...patch } })
|
||||
return (
|
||||
<div className="grid gap-3" data-testid="signage-menu-editor">
|
||||
<Field label={t('signage.title')}><Input value={c.title || ''} maxLength={120} onChange={e => setC({ title: e.target.value })} data-testid="signage-menu-title" /></Field>
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<Field label={t('signage.columns')}>
|
||||
<Select value={String(c.columns || 2)} onChange={e => setC({ columns: Number(e.target.value) })}
|
||||
options={[1, 2, 3].map(n => ({ value: String(n), label: String(n) }))} data-testid="signage-columns" />
|
||||
</Field>
|
||||
<ColourField label={t('signage.accent')} value={c.accent_colour || '#f59e0b'} onChange={v => setC({ accent_colour: v })} testid="signage-accent" />
|
||||
</div>
|
||||
<TextLook c={c} setC={setC} align={false} />
|
||||
<BackgroundField value={c.background} onChange={background => setC({ background })} media={media} onMedia={onMedia}
|
||||
misfit={misfit.includes(c.background?.media_id)} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user