mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 00:50:56 +00:00
Merge pull request #1230 from Tria-plc/freight_feature/usermanagement
feat(wagons): enforce wagon availability limits in transfer requests
This commit is contained in:
@@ -44,9 +44,8 @@ const clampInt = (v: number | string, max: number): number => {
|
||||
|
||||
/**
|
||||
* NumberInput + Slider + All/Half presets, kept in sync. `max` bounds the field
|
||||
* for actions that move real wagons; omit it for a transfer REQUEST, which may
|
||||
* legitimately ask for more than the yard holds today (OCC fulfils it in
|
||||
* instalments) — the slider then just tracks the current value.
|
||||
* to the wagons on hand; omitting it leaves the field unbounded and the slider
|
||||
* simply tracks the current value.
|
||||
*/
|
||||
const QuantityField = ({
|
||||
value,
|
||||
@@ -434,9 +433,14 @@ const WagonYardWorkspaceModal = ({ opened, onClose }: WagonYardWorkspaceModalPro
|
||||
{availableCount} available
|
||||
</Badge>
|
||||
</Group>
|
||||
{/* No max: the request may exceed what the yard holds
|
||||
today — OCC fulfils it in instalments. */}
|
||||
<QuantityField value={transferQty} onChange={setTransferQty} />
|
||||
{/* Capped at the wagons actually available in this yard
|
||||
right now (uncoupled + Available) — a request may not
|
||||
ask for more than the yard can hand over. */}
|
||||
<QuantityField
|
||||
value={transferQty}
|
||||
onChange={setTransferQty}
|
||||
max={availableCount}
|
||||
/>
|
||||
</div>
|
||||
<Select
|
||||
label="Destination yard"
|
||||
|
||||
Reference in New Issue
Block a user