Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Rebuild the transfer and purchase order screens
Damian Legawiec257d488c8781
diff --git a/packages/dashboard/e2e/stock-transfers.spec.ts b/packages/dashboard/e2e/stock-transfers.spec.tsindex 23445ac585..918161771d 100644--- a/packages/dashboard/e2e/stock-transfers.spec.ts+++ b/packages/dashboard/e2e/stock-transfers.spec.ts@@ -37,9 +37,9 @@ test.describe('stock transfers', () => {// Empty until a SKU is added — a draft may open with nothing on it.await expect(page.getByRole('button', { name: /create draft/i })).toBeVisible()- // Nothing can be added until the source is known: the list can only offer+ // Nothing can be added until the source is known: the picker can only offer// what that warehouse is able to send.- await expect(page.getByPlaceholder(/search products/i)).toBeDisabled()+ await expect(page.getByRole('button', { name: /add a product/i })).toBeDisabled()await expect(page.getByText(/choose the warehouse it leaves from first/i)).toBeVisible()})diff --git a/packages/dashboard/src/components/spree/purchase-order-form.tsx b/packages/dashboard/src/components/spree/purchase-order-form.tsxindex 8779c3bf53..fe52948dc0 100644--- a/packages/dashboard/src/components/spree/purchase-order-form.tsx+++ b/packages/dashboard/src/components/spree/purchase-order-form.tsx@@ -1,6 +1,7 @@import type { Supplier } from '@spree/admin-sdk'import {CurrencySelect,+ PageHeader,ResourceCombobox,StoreDatePicker,useStockLocations,@@ -16,6 +17,7 @@ import {FieldGroup,FieldLabel,Input,+ ResourceLayout,Select,SelectContent,SelectItem,@@ -26,6 +28,7 @@ import {import { useState } from 'react'import { useTranslation } from 'react-i18next'import { supplierAutocompleteProps } from '../../hooks/use-suppliers'+import { SupplierSheet } from './supplier-sheet'import { type VariantLine, VariantLineEditor } from './variant-line-editor'export interface PurchaseOrderFormValues {@@ -58,6 +61,8 @@ export const EMPTY_PURCHASE_ORDER: PurchaseOrderFormValues = {*/export function PurchaseOrderForm({initial,+ title,+ backTo,currencyLocked = false,submitLabel,pendingLabel,@@ -66,6 +71,10 @@ export function PurchaseOrderForm({onCancel,}: {initial: PurchaseOrderFormValues+ /** Page title; the form owns the header so its actions sit with the others. */+ title: string+ /** Where the header's back arrow goes — the list, or the order being edited. */+ backTo: string/*** Fix the currency. Every line cost is denominated in it, so changing it on* a saved order would silently reprice the whole document.@@ -80,6 +89,7 @@ export function PurchaseOrderForm({const { t } = useTranslation()const { data: stockLocations } = useStockLocations({ limit: 100 })const locations = stockLocations?.data ?? []+ const locationItems = locations.map((location) => ({ value: location.id, label: location.name }))const [supplierId, setSupplierId] = useState(initial.supplierId)const [destinationId, setDestinationId] = useState(initial.destinationId)@@ -88,6 +98,7 @@ export function PurchaseOrderForm({const [reference, setReference] = useState(initial.reference)const [notes, setNotes] = useState(initial.notes)const [lines, setLines] = useState<VariantLine[]>(initial.lines)+ const [creatingSupplier, setCreatingSupplier] = useState(false)// A cleared cost input is not zero — it is nothing, which the server rejects// field-by-field. `Number('')` is 0 and finite, so the emptiness has to be@@ -102,145 +113,172 @@ export function PurchaseOrderForm({!!destinationId &&lines.every((line) => line.quantity > 0 && hasCost(line.unitCost))- return (- <>- <Card>- <CardHeader>- <CardTitle>{t('admin.purchase_orders.details_title')}</CardTitle>- </CardHeader>- <CardContent>- <FieldGroup>- <Field>- <FieldLabel htmlFor="supplier">- {t('admin.purchase_orders.fields.supplier')}- </FieldLabel>- {/* Searchable rather than a capped list: a wholesaler can hold- more suppliers than one page of a Select would show, and a- Select says nothing about the ones it left out. */}- <ResourceCombobox<Supplier>- {...supplierAutocompleteProps('purchase-order-supplier-picker')}- id="supplier"- value={supplierId}- onChange={(id) => setSupplierId(id ?? '')}- placeholder={t('admin.purchase_orders.fields.supplier_placeholder')}- />- </Field>+ const detailsCard = (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.purchase_orders.details_title')}</CardTitle>+ </CardHeader>+ <CardContent>+ <FieldGroup>+ <Field>+ <FieldLabel htmlFor="supplier">{t('admin.purchase_orders.fields.supplier')}</FieldLabel>+ {/* Searchable rather than a capped list: a wholesaler can hold+ more suppliers than one page of a Select would show, and a+ Select says nothing about the ones it left out. */}+ <ResourceCombobox<Supplier>+ {...supplierAutocompleteProps('purchase-order-supplier-picker')}+ id="supplier"+ value={supplierId}+ onChange={(id) => setSupplierId(id ?? '')}+ placeholder={t('admin.purchase_orders.fields.supplier_placeholder')}+ />+ {/* Buying from someone new is part of raising the order, not a+ detour through settings. */}+ <Button+ type="button"+ variant="link"+ className="h-auto self-start p-0"+ onClick={() => setCreatingSupplier(true)}+ >+ {t('admin.suppliers.new_title')}+ </Button>+ </Field>- <Field>- <FieldLabel htmlFor="destination">- {t('admin.purchase_orders.fields.destination')}- </FieldLabel>- <Select value={destinationId} onValueChange={setDestinationId}>- <SelectTrigger id="destination">- <SelectValue- placeholder={t('admin.purchase_orders.fields.destination_placeholder')}- >- {(value) => locations.find((l) => l.id === value)?.name ?? (value as string)}- </SelectValue>- </SelectTrigger>- <SelectContent>- {locations.map((location) => (- <SelectItem key={location.id} value={location.id}>- {location.name}- </SelectItem>- ))}- </SelectContent>- </Select>- </Field>+ <Field>+ <FieldLabel htmlFor="destination">+ {t('admin.purchase_orders.fields.destination')}+ </FieldLabel>+ {/* `items` rather than a render-prop: Base UI resolves the trigger+ label from it, and a render-prop suppresses the placeholder+ while nothing is chosen. */}+ <Select items={locationItems} value={destinationId} onValueChange={setDestinationId}>+ <SelectTrigger id="destination">+ <SelectValue+ placeholder={t('admin.purchase_orders.fields.destination_placeholder')}+ />+ </SelectTrigger>+ <SelectContent>+ {locations.map((location) => (+ <SelectItem key={location.id} value={location.id}>+ {location.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>- <Field>- <FieldLabel htmlFor="currency">- {t('admin.purchase_orders.fields.currency')}- </FieldLabel>- {/* A foreign-currency purchase order is legitimate; leaving- this alone takes the store's own currency. */}- <CurrencySelect- id="currency"- value={currency}- onChange={setCurrency}- disabled={currencyLocked}- />- {currencyLocked && (- <FieldDescription>- {t('admin.purchase_orders.fields.currency_locked')}- </FieldDescription>- )}- </Field>+ <Field>+ <FieldLabel htmlFor="currency">{t('admin.purchase_orders.fields.currency')}</FieldLabel>+ {/* A foreign-currency purchase order is legitimate; leaving+ this alone takes the store's own currency. */}+ <CurrencySelect+ id="currency"+ value={currency}+ onChange={setCurrency}+ disabled={currencyLocked}+ />+ {currencyLocked && (+ <FieldDescription>+ {t('admin.purchase_orders.fields.currency_locked')}+ </FieldDescription>+ )}+ </Field>- <Field>- <FieldLabel>{t('admin.purchase_orders.fields.expected_at')}</FieldLabel>- {/* A calendar date, not an instant: the day the supplier- promised means the same day in every timezone. */}- <StoreDatePicker- value={expectedAt}- onChange={(value) => setExpectedAt(value ?? undefined)}- placeholder={t('admin.purchase_orders.fields.expected_at_placeholder')}- />- </Field>+ <Field>+ <FieldLabel>{t('admin.purchase_orders.fields.expected_at')}</FieldLabel>+ {/* A calendar date, not an instant: the day the supplier+ promised means the same day in every timezone. */}+ <StoreDatePicker+ value={expectedAt}+ onChange={(value) => setExpectedAt(value ?? undefined)}+ placeholder={t('admin.purchase_orders.fields.expected_at_placeholder')}+ />+ </Field>- <Field>- <FieldLabel htmlFor="reference">- {t('admin.purchase_orders.fields.reference')}- </FieldLabel>- <Input- id="reference"- placeholder={t('admin.purchase_orders.fields.reference_placeholder')}- value={reference}- onChange={(event) => setReference(event.target.value)}- />- </Field>+ <Field>+ <FieldLabel htmlFor="reference">+ {t('admin.purchase_orders.fields.reference')}+ </FieldLabel>+ <Input+ id="reference"+ placeholder={t('admin.purchase_orders.fields.reference_placeholder')}+ value={reference}+ onChange={(event) => setReference(event.target.value)}+ />+ </Field>- <Field>- <FieldLabel htmlFor="notes">{t('admin.purchase_orders.fields.notes')}</FieldLabel>- <Textarea- id="notes"- value={notes}- onChange={(event) => setNotes(event.target.value)}- />- </Field>- </FieldGroup>- </CardContent>- </Card>+ <Field>+ <FieldLabel htmlFor="notes">{t('admin.purchase_orders.fields.notes')}</FieldLabel>+ <Textarea id="notes" value={notes} onChange={(event) => setNotes(event.target.value)} />+ </Field>+ </FieldGroup>+ </CardContent>+ </Card>+ )- <Card>- <CardHeader>- <CardTitle>{t('admin.purchase_orders.items_title')}</CardTitle>- </CardHeader>- <CardContent>- {/* No warehouse filter, unlike a transfer: buying stock in is how a- merchant gets what they do not have. */}- <VariantLineEditor- lines={lines}- onChange={setLines}- currency={currency}- quantityLabel={t('admin.purchase_orders.columns.quantity_ordered')}- withCost+ const itemsCard = (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.purchase_orders.items_title')}</CardTitle>+ </CardHeader>+ <CardContent>+ {/* No warehouse filter, unlike a transfer: buying stock in is how a+ merchant gets what they do not have. */}+ <VariantLineEditor+ lines={lines}+ onChange={setLines}+ currency={currency}+ quantityLabel={t('admin.purchase_orders.columns.quantity_ordered')}+ withCost+ />+ </CardContent>+ </Card>+ )++ return (+ <>+ <ResourceLayout+ header={+ <PageHeader+ title={title}+ backTo={backTo}+ actions={+ <>+ <Button type="button" variant="outline" onClick={onCancel}>+ {t('admin.actions.cancel')}+ </Button>+ <Button+ type="button"+ onClick={() =>+ onSubmit({+ supplierId,+ destinationId,+ currency,+ expectedAt,+ reference,+ notes,+ lines,+ })+ }+ disabled={!canSubmit || pending}+ >+ {pending ? pendingLabel : submitLabel}+ </Button>+ </>+ }/>- </CardContent>- </Card>+ }+ main={itemsCard}+ sidebar={detailsCard}+ />- <div className="flex justify-end gap-2">- <Button type="button" variant="outline" onClick={onCancel}>- {t('admin.actions.cancel')}- </Button>- <Button- type="button"- onClick={() =>- onSubmit({- supplierId,- destinationId,- currency,- expectedAt,- reference,- notes,- lines,- })- }- disabled={!canSubmit || pending}- >- {pending ? pendingLabel : submitLabel}- </Button>- </div>+ {creatingSupplier && (+ <SupplierSheet+ open+ onOpenChange={(open) => !open && setCreatingSupplier(false)}+ onCreated={(supplier) => setSupplierId(supplier.id)}+ />+ )}</>)}diff --git a/packages/dashboard/src/components/spree/stock-transfer-form.tsx b/packages/dashboard/src/components/spree/stock-transfer-form.tsxindex 0764c547a4..cc3b02ffc5 100644--- a/packages/dashboard/src/components/spree/stock-transfer-form.tsx+++ b/packages/dashboard/src/components/spree/stock-transfer-form.tsx@@ -1,4 +1,4 @@-import { useStockLocations } from '@spree/dashboard-core'+import { PageHeader, useStockLocations } from '@spree/dashboard-core'import {Button,Card,@@ -11,6 +11,7 @@ import {FieldGroup,FieldLabel,Input,+ ResourceLayout,Select,SelectContent,SelectItem,@@ -48,6 +49,8 @@ export const EMPTY_STOCK_TRANSFER: StockTransferFormValues = {*/export function StockTransferForm({initial,+ title,+ backTo,submitLabel,pendingLabel,pending,@@ -55,6 +58,10 @@ export function StockTransferForm({onCancel,}: {initial: StockTransferFormValues+ /** Page title; the form owns the header so its actions sit with the others. */+ title: string+ /** Where the header's back arrow goes — the list, or the transfer being edited. */+ backTo: stringsubmitLabel: stringpendingLabel: stringpending: boolean@@ -64,6 +71,7 @@ export function StockTransferForm({const { t } = useTranslation()const { data: stockLocations } = useStockLocations({ limit: 100 })const locations = stockLocations?.data ?? []+ const locationItems = locations.map((location) => ({ value: location.id, label: location.name }))const [sourceId, setSourceId] = useState(initial.sourceId)const [destinationId, setDestinationId] = useState(initial.destinationId)@@ -71,6 +79,9 @@ export function StockTransferForm({const [notes, setNotes] = useState(initial.notes)const [lines, setLines] = useState<VariantLine[]>(initial.lines)+ // Stock cannot move to where it already is.+ const destinationItems = locationItems.filter((item) => item.value !== sourceId)+const sameLocation = !!sourceId && sourceId === destinationId// Lines were picked for the shelf they are leaving, so the source is fixed// once there are any: changing it would silently keep SKUs the new source@@ -80,118 +91,130 @@ export function StockTransferForm({const canSubmit =!!sourceId && !!destinationId && !sameLocation && lines.every((line) => line.quantity > 0)- return (- <>- <Card>- <CardHeader>- <CardTitle>{t('admin.stock_transfers.details_title')}</CardTitle>- </CardHeader>- <CardContent>- <FieldGroup>- <Field>- <FieldLabel htmlFor="source">{t('admin.stock_transfers.fields.source')}</FieldLabel>- <Select value={sourceId} onValueChange={setSourceId} disabled={sourceLocked}>- <SelectTrigger id="source">- <SelectValue placeholder={t('admin.stock_transfers.fields.source_placeholder')}>- {(value) => locations.find((l) => l.id === value)?.name ?? (value as string)}- </SelectValue>- </SelectTrigger>- <SelectContent>- {locations.map((location) => (+ const detailsCard = (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.stock_transfers.details_title')}</CardTitle>+ </CardHeader>+ <CardContent>+ <FieldGroup>+ <Field>+ <FieldLabel htmlFor="source">{t('admin.stock_transfers.fields.source')}</FieldLabel>+ {/* `items` rather than a render-prop: Base UI resolves the trigger+ label from it, and a render-prop suppresses the placeholder+ while nothing is chosen. */}+ <Select+ items={locationItems}+ value={sourceId}+ onValueChange={setSourceId}+ disabled={sourceLocked}+ >+ <SelectTrigger id="source">+ <SelectValue placeholder={t('admin.stock_transfers.fields.source_placeholder')} />+ </SelectTrigger>+ <SelectContent>+ {locations.map((location) => (+ <SelectItem key={location.id} value={location.id}>+ {location.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ {sourceLocked && (+ <FieldDescription>{t('admin.stock_transfers.fields.source_locked')}</FieldDescription>+ )}+ </Field>++ <Field>+ <FieldLabel htmlFor="destination">+ {t('admin.stock_transfers.fields.destination')}+ </FieldLabel>+ <Select items={destinationItems} value={destinationId} onValueChange={setDestinationId}>+ <SelectTrigger id="destination">+ <SelectValue+ placeholder={t('admin.stock_transfers.fields.destination_placeholder')}+ />+ </SelectTrigger>+ <SelectContent>+ {locations+ .filter((location) => location.id !== sourceId)+ .map((location) => (<SelectItem key={location.id} value={location.id}>{location.name}</SelectItem>))}- </SelectContent>- </Select>- {sourceLocked && (- <FieldDescription>- {t('admin.stock_transfers.fields.source_locked')}- </FieldDescription>- )}- </Field>-- <Field>- <FieldLabel htmlFor="destination">- {t('admin.stock_transfers.fields.destination')}- </FieldLabel>- <Select value={destinationId} onValueChange={setDestinationId}>- <SelectTrigger id="destination">- <SelectValue- placeholder={t('admin.stock_transfers.fields.destination_placeholder')}- >- {(value) => locations.find((l) => l.id === value)?.name ?? (value as string)}- </SelectValue>- </SelectTrigger>- <SelectContent>- {locations- .filter((location) => location.id !== sourceId)- .map((location) => (- <SelectItem key={location.id} value={location.id}>- {location.name}- </SelectItem>- ))}- </SelectContent>- </Select>- {sameLocation && (- <FieldError>{t('admin.stock_transfers.errors.same_location')}</FieldError>- )}- </Field>+ </SelectContent>+ </Select>+ {sameLocation && (+ <FieldError>{t('admin.stock_transfers.errors.same_location')}</FieldError>+ )}+ </Field>- <Field>- <FieldLabel htmlFor="reference">- {t('admin.stock_transfers.fields.reference')}- </FieldLabel>- <Input- id="reference"- placeholder={t('admin.stock_transfers.fields.reference_placeholder')}- value={reference}- onChange={(event) => setReference(event.target.value)}- />- </Field>+ <Field>+ <FieldLabel htmlFor="reference">+ {t('admin.stock_transfers.fields.reference')}+ </FieldLabel>+ <Input+ id="reference"+ placeholder={t('admin.stock_transfers.fields.reference_placeholder')}+ value={reference}+ onChange={(event) => setReference(event.target.value)}+ />+ </Field>- <Field>- <FieldLabel htmlFor="notes">{t('admin.stock_transfers.fields.notes')}</FieldLabel>- <Textarea- id="notes"- value={notes}- onChange={(event) => setNotes(event.target.value)}- />- </Field>- </FieldGroup>- </CardContent>- </Card>+ <Field>+ <FieldLabel htmlFor="notes">{t('admin.stock_transfers.fields.notes')}</FieldLabel>+ <Textarea id="notes" value={notes} onChange={(event) => setNotes(event.target.value)} />+ </Field>+ </FieldGroup>+ </CardContent>+ </Card>+ )- <Card>- <CardHeader>- <CardTitle>{t('admin.stock_transfers.items_title')}</CardTitle>- </CardHeader>- <CardContent>- {/* A draft may hold no lines at all and gain them as the merchant+ const itemsCard = (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.stock_transfers.items_title')}</CardTitle>+ </CardHeader>+ <CardContent>+ {/* A draft may hold no lines at all and gain them as the merchantpacks, so there is nothing to enforce here. The picker offers onlywhat the source can send and stays shut until one is chosen. */}- <VariantLineEditor- lines={lines}- onChange={setLines}- quantityLabel={t('admin.stock_transfers.columns.quantity_shipped')}- stockLocationId={sourceId || null}- requireStockLocation- />- </CardContent>- </Card>+ <VariantLineEditor+ lines={lines}+ onChange={setLines}+ quantityLabel={t('admin.stock_transfers.columns.quantity_shipped')}+ stockLocationId={sourceId || null}+ requireStockLocation+ />+ </CardContent>+ </Card>+ )- <div className="flex justify-end gap-2">- <Button type="button" variant="outline" onClick={onCancel}>- {t('admin.actions.cancel')}- </Button>- <Button- type="button"- onClick={() => onSubmit({ sourceId, destinationId, reference, notes, lines })}- disabled={!canSubmit || pending}- >- {pending ? pendingLabel : submitLabel}- </Button>- </div>- </>+ return (+ <ResourceLayout+ header={+ <PageHeader+ title={title}+ backTo={backTo}+ actions={+ <>+ <Button type="button" variant="outline" onClick={onCancel}>+ {t('admin.actions.cancel')}+ </Button>+ <Button+ type="button"+ onClick={() => onSubmit({ sourceId, destinationId, reference, notes, lines })}+ disabled={!canSubmit || pending}+ >+ {pending ? pendingLabel : submitLabel}+ </Button>+ </>+ }+ />+ }+ main={itemsCard}+ sidebar={detailsCard}+ />)}diff --git a/packages/dashboard/src/components/spree/variant-line-editor.tsx b/packages/dashboard/src/components/spree/variant-line-editor.tsxindex 781faaa94c..46401c68fc 100644--- a/packages/dashboard/src/components/spree/variant-line-editor.tsx+++ b/packages/dashboard/src/components/spree/variant-line-editor.tsx@@ -1,10 +1,7 @@import type { Variant } from '@spree/admin-sdk'-import { adminClient, formatPrice, ResourceCombobox } from '@spree/dashboard-core'+import { adminClient, formatPrice, ResourcePickerSheet } from '@spree/dashboard-core'import {Button,- Field,- FieldDescription,- FieldLabel,Input,InputGroup,InputGroupAddon,@@ -17,8 +14,8 @@ import {TableHeader,TableRow,} from '@spree/dashboard-ui'-import { TrashIcon } from '@spree/dashboard-ui/icons'-import { useRef } from 'react'+import { PlusIcon, TrashIcon } from '@spree/dashboard-ui/icons'+import { useState } from 'react'import { useTranslation } from 'react-i18next'import { VariantLink } from './variant-link'@@ -79,9 +76,7 @@ export function VariantLineEditor({// whole catalogue invites a line the warehouse cannot send — which is only// refused later, per line, when the transfer is marked in transit.const locked = !!requireStockLocation && !stockLocationId- // `onChange` hands back only the option id, so keep the records the search- // returned to resolve it. A ref, not state: it is a lookup table.- const variantById = useRef(new Map<string, Variant>())+ const [pickerOpen, setPickerOpen] = useState(false)function addVariant(variant: Variant) {const existing = lines.find((line) => line.variant.id === variant.id)@@ -106,50 +101,52 @@ export function VariantLineEditor({return (<div className="flex flex-col gap-4">- <Field>- <FieldLabel>{t('admin.inventory_lines.add_label')}</FieldLabel>- {/* Combobox rather than a bare input over a list of buttons:- arrow-key navigation, `aria-activedescendant` and Enter-to-pick- come from the primitive. Selecting adds the row and clears the- field, so no value is held. */}- <ResourceCombobox<Variant>- // Keyed by warehouse: the same query means different things at two- // sources, and a cached result would offer the wrong shelf's SKUs.- queryKey={`inventory-line-variant-picker:${stockLocationId ?? 'any'}`}- value=""+ <div className="flex items-center justify-between gap-4">+ {/* Only says anything when there is something to say: the button+ already names the action. */}+ <p className="text-muted-foreground text-sm">+ {locked ? t('admin.inventory_lines.pick_source_first') : null}+ </p>+ <Button+ type="button"+ variant="outline"disabled={locked}- onChange={(id) => {- const variant = id ? variantById.current.get(id) : undefined- if (variant) addVariant(variant)- }}- search={async (query) => {- const res = await adminClient.variants.list({- search: query,- limit: 8,- ...(stockLocationId ? { available_at_stock_location: stockLocationId } : {}),- })- for (const variant of res.data) variantById.current.set(variant.id, variant)- return res- }}- hydrate={async () => ({ data: [] })}- getOptionLabel={(variant) => variant.product_name ?? variant.sku ?? variant.id}- renderOption={(variant) => (- <div className="flex flex-col">- <span className="font-medium">- {variant.product_name ?? variant.sku ?? variant.id}- </span>- <span className="text-xs text-muted-foreground">- {t('admin.inventory_lines.columns.sku')} {variant.sku} ·{' '}- {formatPrice(variant.price)}- </span>- </div>- )}- placeholder={t('admin.inventory_lines.search_placeholder')}- />- {locked && (- <FieldDescription>{t('admin.inventory_lines.pick_source_first')}</FieldDescription>- )}- </Field>+ onClick={() => setPickerOpen(true)}+ >+ <PlusIcon className="size-4" />+ {t('admin.inventory_lines.add_label')}+ </Button>+ </div>++ {/* A sheet rather than a one-at-a-time combobox: a delivery is picked in+ one pass, and the same picker the catalogue screens use already does+ searching, paging and select-all. */}+ <ResourcePickerSheet<Variant>+ open={pickerOpen}+ onOpenChange={setPickerOpen}+ // Keyed by warehouse: the same query means different things at two+ // sources, and a cached result would offer the wrong shelf's SKUs.+ queryKey={`inventory-line-variant-picker:${stockLocationId ?? 'any'}`}+ selectedIds={lines.map((line) => line.variant.id)}+ onConfirm={(_ids, variants) => {+ for (const variant of variants) addVariant(variant)+ }}+ search={async (query, page) =>+ adminClient.variants.list({+ ...(query ? { search: query } : {}),+ limit: 25,+ page,+ ...(stockLocationId ? { available_at_stock_location: stockLocationId } : {}),+ })+ }+ getOptionLabel={(variant) => variant.product_name ?? variant.sku ?? variant.id}+ getOptionImageUrl={(variant) => variant.thumbnail_url}+ getOptionSubtitle={(variant) =>+ `${t('admin.inventory_lines.columns.sku')} ${variant.sku ?? '—'} · ${formatPrice(variant.price)}`+ }+ title={t('admin.inventory_lines.picker_title')}+ searchPlaceholder={t('admin.inventory_lines.search_placeholder')}+ />{lines.length > 0 && (<div className="overflow-x-auto rounded-md border">diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/edit.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/edit.tsxindex dc36845690..836cf12eaa 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/edit.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/edit.tsx@@ -39,7 +39,7 @@ function EditPurchaseOrderPage() {// Reachable by URL even though the header hides the button by then.if (!purchaseOrder.editable) {return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">+ <div className="flex flex-col gap-6"><PageHeadertitle={t('admin.purchase_orders.edit_title', { number: purchaseOrder.number })}backTo={`products/purchase-orders/${purchaseOrderId}`}@@ -74,42 +74,37 @@ function EditPurchaseOrderPage() {}return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">- <PageHeader- title={t('admin.purchase_orders.edit_title', { number: purchaseOrder.number })}- backTo={`products/purchase-orders/${purchaseOrderId}`}- />-- <PurchaseOrderForm- initial={{- supplierId: purchaseOrder.supplier_id ?? '',- destinationId: purchaseOrder.destination_location_id ?? '',- currency: purchaseOrder.currency,- expectedAt: purchaseOrder.expected_at ?? undefined,- reference: purchaseOrder.reference ?? '',- notes: purchaseOrder.notes ?? '',- // The saved lines carry the same facts a search result does, under- // their own names, plus the cost the merchant agreed.- lines: (purchaseOrder.items ?? []).map((item) => ({- variant: {- id: item.variant_id ?? '',- sku: item.variant_sku,- product_name: item.variant_name,- thumbnail_url: item.thumbnail_url,- },- quantity: item.quantity_ordered,- unitCost: item.unit_cost ?? '0.00',- })),- }}- // Every line cost is denominated in it, so changing it now would- // silently reprice the order.- currencyLocked- submitLabel={t('admin.actions.save')}- pendingLabel={t('admin.actions.saving')}- pending={updateMutation.isPending}- onSubmit={handleSubmit}- onCancel={backToOrder}- />- </div>+ <PurchaseOrderForm+ title={t('admin.purchase_orders.edit_title', { number: purchaseOrder.number })}+ backTo={`products/purchase-orders/${purchaseOrderId}`}+ initial={{+ supplierId: purchaseOrder.supplier_id ?? '',+ destinationId: purchaseOrder.destination_location_id ?? '',+ currency: purchaseOrder.currency,+ expectedAt: purchaseOrder.expected_at ?? undefined,+ reference: purchaseOrder.reference ?? '',+ notes: purchaseOrder.notes ?? '',+ // The saved lines carry the same facts a search result does, under+ // their own names, plus the cost the merchant agreed.+ lines: (purchaseOrder.items ?? []).map((item) => ({+ variant: {+ id: item.variant_id ?? '',+ sku: item.variant_sku,+ product_name: item.variant_name,+ thumbnail_url: item.thumbnail_url,+ },+ quantity: item.quantity_ordered,+ unitCost: item.unit_cost ?? '0.00',+ })),+ }}+ // Every line cost is denominated in it, so changing it now would+ // silently reprice the order.+ currencyLocked+ submitLabel={t('admin.actions.save')}+ pendingLabel={t('admin.actions.saving')}+ pending={updateMutation.isPending}+ onSubmit={handleSubmit}+ onCancel={backToOrder}+ />)}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/index.tsxindex 60f5649c17..2021c2c474 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/index.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/$purchaseOrderId/index.tsx@@ -1,5 +1,5 @@import type { PurchaseOrder, PurchaseOrderItem } from '@spree/admin-sdk'-import { Can, PageHeader, Subject, useStore } from '@spree/dashboard-core'+import { adminClient, Can, PageHeader, Subject, useStore } from '@spree/dashboard-core'import {Button,Card,@@ -9,6 +9,7 @@ import {DropdownMenuItem,ErrorState,RelativeTime,+ ResourceLayout,Table,TableBody,TableCell,@@ -23,6 +24,7 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import { InventoryStatusBadge } from '../../../../../../components/spree/inventory-status-badge'import { QuantityCell, QuantityHead } from '../../../../../../components/spree/quantity-cell'+import { ResourceDetailSkeleton } from '../../../../../../components/spree/route-pending'import { StockHistoryCard } from '../../../../../../components/spree/stock-history-card'import { VariantLink } from '../../../../../../components/spree/variant-link'import {@@ -32,6 +34,7 @@ import {usePurchaseOrder,useReceivePurchaseOrder,} from '../../../../../../hooks/use-purchase-orders'+import { spreeJsonLinkResolver } from '../../../../../../lib/json-link-resolver'import { isClosed } from '../../../../../../schemas/inventory-operations'export const Route = createFileRoute(@@ -46,7 +49,7 @@ function PurchaseOrderDetailPage() {const { data: purchaseOrder, isLoading, error, refetch } = usePurchaseOrder(purchaseOrderId)if (isLoading) {- return <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>+ return <ResourceDetailSkeleton sidebar />}// A failed request is not a slow one: without this the screen shows@@ -62,17 +65,19 @@ function PurchaseOrderDetailPage() {}return (- <div className="mx-auto flex w-full max-w-4xl flex-col gap-4 p-4">- <PurchaseOrderHeader purchaseOrder={purchaseOrder} />-- <SummaryCard purchaseOrder={purchaseOrder} />- <ItemsCard purchaseOrder={purchaseOrder} />-- <StockHistoryCard- purchaseOrderId={purchaseOrder.id}- title={t('admin.purchase_orders.history_title')}- />- </div>+ <ResourceLayout+ header={<PurchaseOrderHeader purchaseOrder={purchaseOrder} />}+ main={+ <>+ <ItemsCard purchaseOrder={purchaseOrder} />+ <StockHistoryCard+ purchaseOrderId={purchaseOrder.id}+ title={t('admin.purchase_orders.history_title')}+ />+ </>+ }+ sidebar={<SummaryCard purchaseOrder={purchaseOrder} />}+ />)}@@ -86,12 +91,14 @@ function SummaryCard({ purchaseOrder }: { purchaseOrder: PurchaseOrder }) {<CardTitle>{t('admin.purchase_orders.details_title')}</CardTitle></CardHeader><CardContent>- <dl className="grid grid-cols-3 gap-y-2 text-sm">+ {/* One label-over-value pair per row: the card sits in the narrow+ sidebar column, where a side-by-side grid wraps every value. */}+ <dl className="flex flex-col gap-3 text-sm"><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.supplier')}</dt>- <dd className="col-span-2">+ <dd>{purchaseOrder.supplier_id ? (<Link- to="/$storeId/settings/suppliers"+ to="/$storeId/products/suppliers"params={{ storeId }}search={{ edit: purchaseOrder.supplier_id }}className="text-foreground hover:underline"@@ -104,7 +111,7 @@ function SummaryCard({ purchaseOrder }: { purchaseOrder: PurchaseOrder }) {</dd><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.destination')}</dt>- <dd className="col-span-2">+ <dd>{purchaseOrder.destination_location_id ? (<Linkto="/$storeId/settings/stock-locations"@@ -120,7 +127,7 @@ function SummaryCard({ purchaseOrder }: { purchaseOrder: PurchaseOrder }) {</dd><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.units')}</dt>- <dd className="col-span-2 tabular-nums">+ <dd className="tabular-nums">{t('admin.purchase_orders.units_summary', {received: purchaseOrder.quantity_received_total,ordered: purchaseOrder.quantity_ordered_total,@@ -128,34 +135,34 @@ function SummaryCard({ purchaseOrder }: { purchaseOrder: PurchaseOrder }) {</dd><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.subtotal')}</dt>- <dd className="col-span-2 tabular-nums">{purchaseOrder.display_subtotal}</dd>+ <dd className="tabular-nums">{purchaseOrder.display_subtotal}</dd><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.expected_at')}</dt>- <dd className="col-span-2">{purchaseOrder.expected_at ?? '—'}</dd>+ <dd>{purchaseOrder.expected_at ?? '—'}</dd>{purchaseOrder.reference && (<><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.reference')}</dt>- <dd className="col-span-2">{purchaseOrder.reference}</dd>+ <dd>{purchaseOrder.reference}</dd></>)}{purchaseOrder.notes && (<><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.notes')}</dt>- <dd className="col-span-2 whitespace-pre-line">{purchaseOrder.notes}</dd>+ <dd className="whitespace-pre-line">{purchaseOrder.notes}</dd></>)}<dt className="text-muted-foreground">{t('admin.purchase_orders.fields.ordered_at')}</dt>- <dd className="col-span-2">+ <dd>{purchaseOrder.ordered_at ? <RelativeTime iso={purchaseOrder.ordered_at} /> : '—'}</dd><dt className="text-muted-foreground">{t('admin.purchase_orders.fields.received_at')}</dt>- <dd className="col-span-2">+ <dd>{purchaseOrder.received_at ? <RelativeTime iso={purchaseOrder.received_at} /> : '—'}</dd></dl>@@ -430,6 +437,12 @@ function PurchaseOrderHeader({ purchaseOrder }: { purchaseOrder: PurchaseOrder })}resource={{ id: purchaseOrder.id, number: purchaseOrder.number }}+ jsonPreview={{+ title: purchaseOrder.number,+ fetch: () => adminClient.purchaseOrders.get(purchaseOrder.id, { expand: ['items'] }),+ endpoint: `/api/v3/admin/purchase_orders/${purchaseOrder.id}`,+ resolveLink: spreeJsonLinkResolver(storeId),+ }}/>)}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/new.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/new.tsxindex 350883d858..2a13c0772d 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/new.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/purchase-orders/new.tsx@@ -1,4 +1,3 @@-import { PageHeader } from '@spree/dashboard-core'import { createFileRoute, useNavigate } from '@tanstack/react-router'import { useTranslation } from 'react-i18next'import {@@ -44,17 +43,15 @@ function NewPurchaseOrderPage() {}return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">- <PageHeader title={t('admin.purchase_orders.new_title')} backTo="products/purchase-orders" />-- <PurchaseOrderForm- initial={EMPTY_PURCHASE_ORDER}- submitLabel={t('admin.purchase_orders.actions.create_draft')}- pendingLabel={t('admin.actions.creating')}- pending={createMutation.isPending}- onSubmit={handleSubmit}- onCancel={() => navigate({ to: '/$storeId/products/purchase-orders', params: { storeId } })}- />- </div>+ <PurchaseOrderForm+ initial={EMPTY_PURCHASE_ORDER}+ title={t('admin.purchase_orders.new_title')}+ backTo="products/purchase-orders"+ submitLabel={t('admin.purchase_orders.actions.create_draft')}+ pendingLabel={t('admin.actions.creating')}+ pending={createMutation.isPending}+ onSubmit={handleSubmit}+ onCancel={() => navigate({ to: '/$storeId/products/purchase-orders', params: { storeId } })}+ />)}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/edit.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/edit.tsxindex 9dcf5c8bab..e2c7a5422d 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/edit.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/edit.tsx@@ -34,7 +34,7 @@ function EditStockTransferPage() {// though the header hides the button once the transfer is packed.if (!transfer.editable) {return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">+ <div className="flex flex-col gap-6"><PageHeadertitle={t('admin.stock_transfers.edit_title', { number: transfer.number })}backTo={`products/transfers/${transferId}`}@@ -67,36 +67,31 @@ function EditStockTransferPage() {}return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">- <PageHeader- title={t('admin.stock_transfers.edit_title', { number: transfer.number })}- backTo={`products/transfers/${transferId}`}- />-- <StockTransferForm- initial={{- sourceId: transfer.source_location_id ?? '',- destinationId: transfer.destination_location_id ?? '',- reference: transfer.reference ?? '',- notes: transfer.notes ?? '',- // The saved lines carry the same four facts a search result does,- // under their own names.- lines: (transfer.items ?? []).map((item) => ({- variant: {- id: item.variant_id ?? '',- sku: item.variant_sku,- product_name: item.variant_name,- thumbnail_url: item.thumbnail_url,- },- quantity: item.quantity_shipped,- })),- }}- submitLabel={t('admin.actions.save')}- pendingLabel={t('admin.actions.saving')}- pending={updateMutation.isPending}- onSubmit={handleSubmit}- onCancel={backToTransfer}- />- </div>+ <StockTransferForm+ title={t('admin.stock_transfers.edit_title', { number: transfer.number })}+ backTo={`products/transfers/${transferId}`}+ initial={{+ sourceId: transfer.source_location_id ?? '',+ destinationId: transfer.destination_location_id ?? '',+ reference: transfer.reference ?? '',+ notes: transfer.notes ?? '',+ // The saved lines carry the same four facts a search result does,+ // under their own names.+ lines: (transfer.items ?? []).map((item) => ({+ variant: {+ id: item.variant_id ?? '',+ sku: item.variant_sku,+ product_name: item.variant_name,+ thumbnail_url: item.thumbnail_url,+ },+ quantity: item.quantity_shipped,+ })),+ }}+ submitLabel={t('admin.actions.save')}+ pendingLabel={t('admin.actions.saving')}+ pending={updateMutation.isPending}+ onSubmit={handleSubmit}+ onCancel={backToTransfer}+ />)}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/index.tsxindex 5be6629263..dc563b4be6 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/index.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/$transferId/index.tsx@@ -1,5 +1,12 @@import type { StockTransfer, StockTransferItem } from '@spree/admin-sdk'-import { Can, PageHeader, Subject, useStockLocations, useStore } from '@spree/dashboard-core'+import {+ adminClient,+ Can,+ PageHeader,+ Subject,+ useStockLocations,+ useStore,+} from '@spree/dashboard-core'import {Button,Card,@@ -9,6 +16,7 @@ import {DropdownMenuItem,ErrorState,RelativeTime,+ ResourceLayout,Select,SelectContent,SelectItem,@@ -28,6 +36,7 @@ import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import { InventoryStatusBadge } from '../../../../../../components/spree/inventory-status-badge'import { QuantityCell, QuantityHead } from '../../../../../../components/spree/quantity-cell'+import { ResourceDetailSkeleton } from '../../../../../../components/spree/route-pending'import { StockHistoryCard } from '../../../../../../components/spree/stock-history-card'import { TransferCancelDialog } from '../../../../../../components/spree/transfer-cancel-dialog'import { VariantLink } from '../../../../../../components/spree/variant-link'@@ -38,6 +47,7 @@ import {useReceiveStockTransfer,useStockTransfer,} from '../../../../../../hooks/use-stock-transfers'+import { spreeJsonLinkResolver } from '../../../../../../lib/json-link-resolver'import {DISCREPANCY_REASONS,isClosed,@@ -54,7 +64,7 @@ function StockTransferDetailPage() {const { data: transfer, isLoading, error, refetch } = useStockTransfer(transferId)if (isLoading) {- return <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>+ return <ResourceDetailSkeleton sidebar />}// A failed request is not a slow one: without this the screen shows@@ -70,25 +80,27 @@ function StockTransferDetailPage() {}return (- <div className="mx-auto flex w-full max-w-4xl flex-col gap-4 p-4">- <TransferHeader transfer={transfer} />-- <SummaryCard transfer={transfer} />-- {transfer.status === 'draft' || transfer.status === 'ready_to_ship' ? (- <PlannedItemsCard transfer={transfer} />- ) : (- <ReceiveCard transfer={transfer} />- )}+ <ResourceLayout+ header={<TransferHeader transfer={transfer} />}+ main={+ <>+ {transfer.status === 'draft' || transfer.status === 'ready_to_ship' ? (+ <PlannedItemsCard transfer={transfer} />+ ) : (+ <ReceiveCard transfer={transfer} />+ )}- {/* Where the units on this trip came from and went — read on the- destination warehouse, which is the shelf the merchant is- reconciling. */}- <StockHistoryCard- stockTransferId={transfer.id}- title={t('admin.stock_transfers.history_title')}- />- </div>+ {/* Where the units on this trip came from and went — read on the+ destination warehouse, which is the shelf the merchant is+ reconciling. */}+ <StockHistoryCard+ stockTransferId={transfer.id}+ title={t('admin.stock_transfers.history_title')}+ />+ </>+ }+ sidebar={<SummaryCard transfer={transfer} />}+ />)}@@ -137,9 +149,11 @@ function SummaryCard({ transfer }: { transfer: StockTransfer }) {<CardTitle>{t('admin.stock_transfers.details_title')}</CardTitle></CardHeader><CardContent>- <dl className="grid grid-cols-3 gap-y-2 text-sm">+ {/* One label-over-value pair per row: the card sits in the narrow+ sidebar column, where a side-by-side grid wraps every value. */}+ <dl className="flex flex-col gap-3 text-sm"><dt className="text-muted-foreground">{t('admin.stock_transfers.fields.source')}</dt>- <dd className="col-span-2">+ <dd><WarehouseLinkstoreId={storeId}id={transfer.source_location_id}@@ -148,7 +162,7 @@ function SummaryCard({ transfer }: { transfer: StockTransfer }) {</dd><dt className="text-muted-foreground">{t('admin.stock_transfers.fields.destination')}</dt>- <dd className="col-span-2">+ <dd><WarehouseLinkstoreId={storeId}id={transfer.destination_location_id}@@ -160,7 +174,7 @@ function SummaryCard({ transfer }: { transfer: StockTransfer }) {</dd><dt className="text-muted-foreground">{t('admin.stock_transfers.fields.units')}</dt>- <dd className="col-span-2 tabular-nums">+ <dd className="tabular-nums">{t('admin.stock_transfers.units_summary', {received: transfer.quantity_received_total,shipped: transfer.quantity_shipped_total,@@ -172,26 +186,22 @@ function SummaryCard({ transfer }: { transfer: StockTransfer }) {<dt className="text-muted-foreground">{t('admin.stock_transfers.fields.reference')}</dt>- <dd className="col-span-2">{transfer.reference}</dd>+ <dd>{transfer.reference}</dd></>)}{transfer.notes && (<><dt className="text-muted-foreground">{t('admin.stock_transfers.fields.notes')}</dt>- <dd className="col-span-2 whitespace-pre-line">{transfer.notes}</dd>+ <dd className="whitespace-pre-line">{transfer.notes}</dd></>)}<dt className="text-muted-foreground">{t('admin.stock_transfers.fields.shipped_at')}</dt>- <dd className="col-span-2">- {transfer.shipped_at ? <RelativeTime iso={transfer.shipped_at} /> : '—'}- </dd>+ <dd>{transfer.shipped_at ? <RelativeTime iso={transfer.shipped_at} /> : '—'}</dd><dt className="text-muted-foreground">{t('admin.stock_transfers.fields.received_at')}</dt>- <dd className="col-span-2">- {transfer.received_at ? <RelativeTime iso={transfer.received_at} /> : '—'}- </dd>+ <dd>{transfer.received_at ? <RelativeTime iso={transfer.received_at} /> : '—'}</dd></dl></CardContent></Card>@@ -540,6 +550,12 @@ function TransferHeader({ transfer }: { transfer: StockTransfer }) {)}resource={{ id: transfer.id, number: transfer.number }}+ jsonPreview={{+ title: transfer.number,+ fetch: () => adminClient.stockTransfers.get(transfer.id, { expand: ['items'] }),+ endpoint: `/api/v3/admin/stock_transfers/${transfer.id}`,+ resolveLink: spreeJsonLinkResolver(storeId),+ }}/></>)diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/new.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/new.tsxindex 1e8baf9e00..28a6a7c19a 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/new.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers/new.tsx@@ -1,4 +1,3 @@-import { PageHeader } from '@spree/dashboard-core'import { createFileRoute, useNavigate } from '@tanstack/react-router'import { useTranslation } from 'react-i18next'import {@@ -42,17 +41,15 @@ function NewStockTransferPage() {}return (- <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 p-4">- <PageHeader title={t('admin.stock_transfers.new_title')} backTo="products/transfers" />-- <StockTransferForm- initial={EMPTY_STOCK_TRANSFER}- submitLabel={t('admin.stock_transfers.actions.create_draft')}- pendingLabel={t('admin.actions.creating')}- pending={createMutation.isPending}- onSubmit={handleSubmit}- onCancel={() => navigate({ to: '/$storeId/products/transfers', params: { storeId } })}- />- </div>+ <StockTransferForm+ initial={EMPTY_STOCK_TRANSFER}+ title={t('admin.stock_transfers.new_title')}+ backTo="products/transfers"+ submitLabel={t('admin.stock_transfers.actions.create_draft')}+ pendingLabel={t('admin.actions.creating')}+ pending={createMutation.isPending}+ onSubmit={handleSubmit}+ onCancel={() => navigate({ to: '/$storeId/products/transfers', params: { storeId } })}+ />)}