Merge branch 'yard-name-display' into dev

This commit is contained in:
hager
2026-09-06 20:13:50 +00:00
3 changed files with 9 additions and 10 deletions

View File

@@ -17,9 +17,8 @@ export function BookingRouteCard({ booking }: BookingRouteCardProps) {
<Text size="xs" c="dimmed" fw={500} tt="uppercase" lts="0.04em"> <Text size="xs" c="dimmed" fw={500} tt="uppercase" lts="0.04em">
Origin Origin
</Text> </Text>
<Text fw={600}>{booking.originYard?.label}</Text> <Text fw={600}>
<Text size="xs" c="dimmed"> {booking.originYard?.label ?? booking.originYard?.code}
{booking.originYard?.code}
</Text> </Text>
</Stack> </Stack>
@@ -57,10 +56,7 @@ export function BookingRouteCard({ booking }: BookingRouteCardProps) {
Destination Destination
</Text> </Text>
<Text fw={600} ta="right"> <Text fw={600} ta="right">
{booking.destinationYard?.label} {booking.destinationYard?.label ?? booking.destinationYard?.code}
</Text>
<Text size="xs" c="dimmed">
{booking.destinationYard?.code}
</Text> </Text>
</Stack> </Stack>
</Group> </Group>

View File

@@ -67,8 +67,11 @@ const emptyForm = (): RouteFormState => ({
/** Order-insensitive pair key — yard distances are symmetric. */ /** Order-insensitive pair key — yard distances are symmetric. */
const pairKey = (a: string, b: string) => (a < b ? `${a}|${b}` : `${b}|${a}`); const pairKey = (a: string, b: string) => (a < b ? `${a}|${b}` : `${b}|${a}`);
// Yards are identified to operators by name, not by their internal code: the
// yard coded KALITY is universally called GMP / Gelan Multipurpose Port, and
// showing both read as two different places. The code stays in the data.
const yardLabel = (yard?: YardRef | null) => const yardLabel = (yard?: YardRef | null) =>
yard ? `${yard.label} (${yard.code})` : "—"; yard ? (yard.label ?? yard.code) : "—";
const statusColor = (status: RouteStatus) => { const statusColor = (status: RouteStatus) => {
switch (status) { switch (status) {
@@ -232,7 +235,7 @@ export default function RoutesPage() {
() => () =>
(yardsQuery.data ?? []).map((yard) => ({ (yardsQuery.data ?? []).map((yard) => ({
value: yard.id, value: yard.id,
label: `${yard.label} (${yard.code})`, label: yard.label ?? yard.code,
})), })),
[yardsQuery.data], [yardsQuery.data],
); );

View File

@@ -83,7 +83,7 @@ export function YardDesksModal({
<Modal <Modal
opened={opened} opened={opened}
onClose={onClose} onClose={onClose}
title={yard ? `Desks at ${yard.label} (${yard.code})` : "Desks"} title={yard ? `Desks at ${yard.label ?? yard.code}` : "Desks"}
size="lg" size="lg"
> >
<Stack gap="md"> <Stack gap="md">