mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 15:25:45 +00:00
Merge branch 'yard-name-display' into dev
This commit is contained in:
@@ -17,9 +17,8 @@ export function BookingRouteCard({ booking }: BookingRouteCardProps) {
|
||||
<Text size="xs" c="dimmed" fw={500} tt="uppercase" lts="0.04em">
|
||||
Origin
|
||||
</Text>
|
||||
<Text fw={600}>{booking.originYard?.label}</Text>
|
||||
<Text size="xs" c="dimmed">
|
||||
{booking.originYard?.code}
|
||||
<Text fw={600}>
|
||||
{booking.originYard?.label ?? booking.originYard?.code}
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
@@ -57,10 +56,7 @@ export function BookingRouteCard({ booking }: BookingRouteCardProps) {
|
||||
Destination
|
||||
</Text>
|
||||
<Text fw={600} ta="right">
|
||||
{booking.destinationYard?.label}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed">
|
||||
{booking.destinationYard?.code}
|
||||
{booking.destinationYard?.label ?? booking.destinationYard?.code}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
|
||||
@@ -67,8 +67,11 @@ const emptyForm = (): RouteFormState => ({
|
||||
/** Order-insensitive pair key — yard distances are symmetric. */
|
||||
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) =>
|
||||
yard ? `${yard.label} (${yard.code})` : "—";
|
||||
yard ? (yard.label ?? yard.code) : "—";
|
||||
|
||||
const statusColor = (status: RouteStatus) => {
|
||||
switch (status) {
|
||||
@@ -232,7 +235,7 @@ export default function RoutesPage() {
|
||||
() =>
|
||||
(yardsQuery.data ?? []).map((yard) => ({
|
||||
value: yard.id,
|
||||
label: `${yard.label} (${yard.code})`,
|
||||
label: yard.label ?? yard.code,
|
||||
})),
|
||||
[yardsQuery.data],
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ export function YardDesksModal({
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
title={yard ? `Desks at ${yard.label} (${yard.code})` : "Desks"}
|
||||
title={yard ? `Desks at ${yard.label ?? yard.code}` : "Desks"}
|
||||
size="lg"
|
||||
>
|
||||
<Stack gap="md">
|
||||
|
||||
Reference in New Issue
Block a user