feat(manager): UI review pass 3 (fees tabs, products panes, floor editor, permissions search, pricing heads)
- Online orders → Settings: the fee tabs breathe (inset strip); a rule's buttons and switch centred together. - Products: categories and list as panes that scroll on their own, headers and footers stay; the list sunken with white rows; the category search is the shared SearchInput. Product editor: "Make main" text instead of a star, the left tabs share the width. - Floor editor: no "+" next to a corner; − / fit width / whole plan / +; "Edit the floor's shape" → "Save shape" (saves the shape and size at once); sizes in grid cells by half cells (steppers; typing snapped every keystroke before), resize handles on every unrotated table and thing, half-cell snapping. - MediaField: the picture's name under the buttons, Remove red on hover. - Staff permissions: a search box at the top. - Prep zone name hint fixed. Offers & pricing: title first, then tabs; every tab has its head with the New button at the top right. - Tests: floor cells, e2e (cell steppers, no + near a corner, Save shape, permission search, products panes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import * as api from './pricingApi'
|
||||
import { ACTIONS, ROUNDINGS, blankRule, levelOf, roundingKey, ruleBody, ruleProblems, ruleToForm } from './channelPricing'
|
||||
import { useCatalog } from './useCatalog'
|
||||
import { useActionText } from './useActionText'
|
||||
import { TabHead } from './PricingParts'
|
||||
|
||||
const LEVEL_TONE = { product: 'accent', category: 'info', channel: 'neutral' }
|
||||
|
||||
@@ -48,11 +49,9 @@ export default function ChannelPricesTab() {
|
||||
const list = [...(rules ?? [])].sort((a, b) => order[levelOf(a)] - order[levelOf(b)] || b.id - a.id)
|
||||
|
||||
return (
|
||||
<div className="grid gap-4" data-testid="channel-prices">
|
||||
<div className="flex flex-wrap items-start gap-3">
|
||||
<p className="flex-1 min-w-64 text-body text-ink-2 max-w-3xl">{t('pricing.channels.intro')}</p>
|
||||
<Button icon={<Plus size={16} />} onClick={() => setEdit(blankRule())} data-testid="channel-price-new">{t('pricing.channels.new')}</Button>
|
||||
</div>
|
||||
<section className="grid gap-4" data-testid="channel-prices">
|
||||
<TabHead title={t('pricing.tabs.channels')} intro={t('pricing.channels.intro')}
|
||||
action={<Button icon={<Plus size={16} />} onClick={() => setEdit(blankRule())} data-testid="channel-price-new">{t('pricing.channels.new')}</Button>} />
|
||||
{isPending ? <div className="py-10 flex justify-center"><Spinner /></div>
|
||||
: !list.length ? <EmptyState title={t('pricing.channels.none')} description={t('pricing.channels.noneHint')} />
|
||||
: (
|
||||
@@ -91,7 +90,7 @@ export default function ChannelPricesTab() {
|
||||
<p className="text-body text-ink-2">{t('pricing.channels.removeBody')}</p>
|
||||
</Dialog>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ const UNIT = { max_discount_percent: '%', max_discount_amount: '€', max_total_
|
||||
export default function DiscountsTab() {
|
||||
const { t } = useTranslation('manager')
|
||||
return (
|
||||
<section className="grid gap-5" data-testid="pricing-discounts">
|
||||
<section className="grid gap-4" data-testid="pricing-discounts">
|
||||
<TabHead title={t('pricing.discounts.title')} intro={t('pricing.discounts.intro')} />
|
||||
<VenueLimits />
|
||||
<PersonLimits />
|
||||
@@ -73,7 +73,7 @@ function VenueForm({ data, onSaved, t }) {
|
||||
} catch (err) { toast.error(errorMessage(err, t)) } finally { setBusy(false) }
|
||||
}
|
||||
return (
|
||||
<div className="grid gap-4 p-5 rounded-card border border-line bg-surface shadow-raised" data-testid="pricing-venue-limits">
|
||||
<div className="grid gap-4 p-card rounded-card border border-line bg-surface shadow-raised" data-testid="pricing-venue-limits">
|
||||
<header className="grid gap-0.5">
|
||||
<h3 className="text-body font-semibold text-ink">{t('pricing.discounts.venue')}</h3>
|
||||
<p className="text-label text-ink-2">{t('pricing.discounts.venueHint')}</p>
|
||||
@@ -95,7 +95,7 @@ function PersonLimits() {
|
||||
const id = chosen ?? people[0]?.id ?? null
|
||||
const { data } = useLiveQuery({ queryKey: ['pricing', 'person-limits', id], queryFn: () => api.waiterLimits(id), enabled: !!id, events: api.PRICING_EVENTS })
|
||||
return (
|
||||
<div className="grid gap-4 p-5 rounded-card border border-line bg-surface shadow-raised" data-testid="pricing-person-limits">
|
||||
<div className="grid gap-4 p-card rounded-card border border-line bg-surface shadow-raised" data-testid="pricing-person-limits">
|
||||
<header className="grid gap-0.5">
|
||||
<h3 className="text-body font-semibold text-ink">{t('pricing.discounts.person')}</h3>
|
||||
<p className="text-label text-ink-2">{t('pricing.discounts.personHint')}</p>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// limits and (2026-11-20) order channel prices, one tab each. Changes reach the counter, the phones
|
||||
// and the tablets at once: new prices apply to what is added to orders from then on (lines already
|
||||
// on an order keep their price). The tab is in the address (?tab=).
|
||||
// 2026-11-21: the page's title and description first, then the tabs; each tab has its own head
|
||||
// (title, description, its "New" button at the top right).
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { Page, PageHeader, Tabs } from '@xenia/ui'
|
||||
@@ -19,10 +21,9 @@ export default function PricingPage() {
|
||||
const tab = TABS.includes(params.get('tab')) ? params.get('tab') : 'rules'
|
||||
const setTab = v => setParams(p => { const n = new URLSearchParams(p); n.set('tab', v); return n }, { replace: true })
|
||||
return (
|
||||
<Page testId="pricing-page"
|
||||
<Page testId="pricing-page" header={<PageHeader title={t('pricing.pageTitle')} subtitle={t('pricing.intro')} />}
|
||||
top={<Tabs size="lg" value={tab} onChange={setTab} aria-label={t('pricing.pageTitle')}
|
||||
tabs={TABS.map(k => ({ id: k, label: t(`pricing.tabs.${k}`), testId: `pricing-tab-${k}` }))} />}>
|
||||
<PageHeader title={t('pricing.pageTitle')} subtitle={t('pricing.intro')} />
|
||||
{tab === 'rules' && <ModifiersTab />}
|
||||
{tab === 'channels' && <ChannelPricesTab />}
|
||||
{tab === 'groups' && <PriceGroupsTab />}
|
||||
|
||||
@@ -271,12 +271,12 @@ export function RuleCard({ colour, name, active, badges, summary, description, o
|
||||
/** The tab's head: what it is, and its "New" button. */
|
||||
export function TabHead({ title, intro, action }) {
|
||||
return (
|
||||
<header className="flex flex-wrap items-start justify-between gap-3">
|
||||
<div className="grid gap-1 max-w-3xl">
|
||||
<header className="flex flex-wrap items-start gap-3">
|
||||
<div className="flex-1 min-w-64 grid gap-1">
|
||||
<h2 className="text-body-lg font-semibold text-ink">{title}</h2>
|
||||
<p className="text-label text-ink-2">{intro}</p>
|
||||
<p className="text-label text-ink-2 max-w-3xl">{intro}</p>
|
||||
</div>
|
||||
{action}
|
||||
{action && <div className="shrink-0 ml-auto">{action}</div>}
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user