mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 11:21:18 +00:00
Merge pull request #847 from Tria-plc/freight_feature/usermanagement
chnages
This commit is contained in:
@@ -205,6 +205,14 @@ const WagonYardWorkspaceModal = ({ opened, onClose }: WagonYardWorkspaceModalPro
|
||||
const availableCount = availableWagons.length;
|
||||
const assignedCount = assignedWagons.length;
|
||||
const otherCount = otherWagons.length;
|
||||
// Split "Other" so a coupled wagon is visible as such. The Available/Assigned
|
||||
// buckets deliberately count only UNCOUPLED wagons (see above), so a yard
|
||||
// holding 54 assigned wagons of which 53 are on a train shows "Assigned 1" —
|
||||
// accurate for shunting, but unreadable unless the other 53 are named.
|
||||
const onTrainCount = useMemo(
|
||||
() => matching.filter((w) => w.trainId != null).length,
|
||||
[matching],
|
||||
);
|
||||
|
||||
const destinationYardOptions = useMemo(
|
||||
() =>
|
||||
@@ -397,9 +405,14 @@ const WagonYardWorkspaceModal = ({ opened, onClose }: WagonYardWorkspaceModalPro
|
||||
</div>
|
||||
</Group>
|
||||
<Group gap="lg" wrap="wrap">
|
||||
<LegendDot color="teal" label="Available" value={availableCount} />
|
||||
<LegendDot color="blue" label="Assigned" value={assignedCount} />
|
||||
{otherCount > 0 ? <LegendDot color="gray" label="Other" value={otherCount} /> : null}
|
||||
<LegendDot color="teal" label="Available in yard" value={availableCount} />
|
||||
<LegendDot color="blue" label="Assigned in yard" value={assignedCount} />
|
||||
{onTrainCount > 0 ? (
|
||||
<LegendDot color="gray" label="On train" value={onTrainCount} />
|
||||
) : null}
|
||||
{otherCount - onTrainCount > 0 ? (
|
||||
<LegendDot color="gray" label="Other" value={otherCount - onTrainCount} />
|
||||
) : null}
|
||||
</Group>
|
||||
</Group>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user