feat(waiter): table bookings on the phone; shared ReasonPicker (platform-v2 step 4.8c)
- Waiter: Bookings (side drawer, for whoever has connect_orders.manage or reservations.manage, with the online-orders app on): requests made online are confirmed or declined with a reason the guest sees; confirmed ones are seated at a free table (its seats shown, a warning mark when the party is bigger) or cancelled / marked as a no-show; the food ordered ahead and its kitchen time; live updates. - Backend: the bookings routes take reservations.manage too (require_any). - @xenia/ui ReasonPicker + reasonText (gallery, unit test), first piece moved from the terminal (4.6 → 4.8): the counter's online reject and booking decline dialogs use it; the waiter loads @xenia/ui styles.css (the .x-* components; tokens as before). - Tests: waiter e2e +2 (request listed with the key, confirmed and seated from the phone); terminal.mjs and qr_table.mjs green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import {
|
||||
Button, Dialog, EmptyState, Field, IconButton, InfoTip, Input, PinPad, Select, Sheet,
|
||||
Spinner, Stepper, Switch, Textarea, ToastProvider, useToast,
|
||||
ReasonPicker, Spinner, Stepper, Switch, Textarea, ToastProvider, useToast,
|
||||
} from '../src/index.js'
|
||||
import '../src/styles.css'
|
||||
|
||||
@@ -41,6 +41,8 @@ function Demo() {
|
||||
const [theme, setTheme] = useState('light')
|
||||
const [venue, setVenue] = useState('teal')
|
||||
const [dialog, setDialog] = useState(false)
|
||||
const [reason, setReason] = useState(null)
|
||||
const [reasonOther, setReasonOther] = useState('')
|
||||
const [locked, setLocked] = useState(false)
|
||||
const [sheet, setSheet] = useState(null)
|
||||
const [on, setOn] = useState(true)
|
||||
@@ -139,6 +141,13 @@ function Demo() {
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section title="ReasonPicker">
|
||||
<div style={{ maxWidth: 360 }}>
|
||||
<ReasonPicker ariaLabel="Reason" value={reason} onChange={setReason} other={reasonOther} onOther={setReasonOther}
|
||||
options={[{ value: 'full', label: 'We are fully booked' }, { value: 'closed', label: 'Closed that day' }]} />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section title="Switch + InfoTip">
|
||||
<div style={{ display: 'grid', gap: 'var(--x-space-4)', maxWidth: 520 }}>
|
||||
<Switch checked={on} onChange={setOn} label="Print kitchen tickets" description="Send new items to the kitchen printer." />
|
||||
|
||||
Reference in New Issue
Block a user