mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 19:58:11 +00:00
Fix 2 — lastmile should only be yes if EDR last mile.
This commit is contained in:
@@ -150,8 +150,9 @@ function AllocationRules() {
|
||||
.filter((yard) => yard.code)
|
||||
.map((yard) => ({
|
||||
value: yard.code,
|
||||
label: `${yard.code} - ${yard.name}${yard.warehouse?.code ? ` (${yard.warehouse.code})` : ''}`,
|
||||
label: `${yard.name} (${yard.code})${yard.warehouse?.code ? ` — ${yard.warehouse.code}` : ''}`,
|
||||
}));
|
||||
const yardNameByCode = Object.fromEntries(yards.map((yard) => [yard.code, yard.name]));
|
||||
|
||||
const resetForm = () => {
|
||||
setEditingId(null);
|
||||
@@ -223,7 +224,11 @@ function AllocationRules() {
|
||||
{
|
||||
id: 'targetYard',
|
||||
header: 'Target yard',
|
||||
cell: ({ row }) => <Badge variant="light">{row.original.targetYardCode}</Badge>,
|
||||
cell: ({ row }) => (
|
||||
<Badge variant="light">
|
||||
{yardNameByCode[row.original.targetYardCode] ?? row.original.targetYardCode}
|
||||
</Badge>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'active',
|
||||
@@ -307,7 +312,8 @@ function AllocationRules() {
|
||||
{anyLabel(form.freightType, 'freight type').toLowerCase()} booking
|
||||
{form.cargoTypeCode.trim() ? ` with cargo code ${form.cargoTypeCode.trim()}` : ''}
|
||||
{form.containerStatus.trim() ? ` and container status ${form.containerStatus.trim()}` : ''}{' '}
|
||||
is received, <b>send it to</b> {form.targetYardCode || 'a selected target yard'}.
|
||||
is received, <b>send it to</b>{' '}
|
||||
{(form.targetYardCode && yardNameByCode[form.targetYardCode]) || form.targetYardCode || 'a selected target yard'}.
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user