Add ScheduleWorkspacePanel and integrate it into TrainScheduleV2DetailPage with tabs

This commit is contained in:
Marshal
2026-07-03 15:56:26 +00:00
parent 6dc6914397
commit 907ff2138b
3 changed files with 576 additions and 13 deletions

View File

@@ -8,6 +8,7 @@ import {
Paper,
RingProgress,
Stack,
Tabs,
Text,
Textarea,
TextInput,
@@ -25,10 +26,12 @@ import {
LayoutGrid,
Navigation,
Package,
PackageCheck,
Route as RouteIcon,
Send,
Train,
Weight,
Workflow as WorkflowIcon,
} from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Link, useParams } from "react-router-dom";
@@ -45,6 +48,7 @@ import { FleetAvailabilitySummary } from "@/components/trainScheduling/FleetAvai
import { RescheduleTrainDialog } from "@/components/trainScheduling/RescheduleTrainDialog";
import { ScheduleBatchPanel } from "@/components/trainScheduling/ScheduleBatchPanel";
import { ScheduleBookingsStep } from "@/components/trainScheduling/ScheduleBookingsStep";
import { ScheduleWorkspacePanel } from "@/components/trainScheduling/ScheduleWorkspacePanel";
import { FreightTypeBadge } from "@/components/trainScheduling/ScheduleStatusBadge";
import {
RouteCorridor,
@@ -1028,6 +1032,18 @@ export default function TrainScheduleV2DetailPage() {
</Paper>
) : null}
<Tabs defaultValue="workflow" radius="md" color="edr-green" keepMounted={false}>
<Tabs.List mb="md">
<Tabs.Tab value="workflow" leftSection={<WorkflowIcon size={16} />}>
Workflow
</Tabs.Tab>
<Tabs.Tab value="workspace" leftSection={<PackageCheck size={16} />}>
Workspace
</Tabs.Tab>
</Tabs.List>
<Tabs.Panel value="workflow">
<Stack gap="lg">
<Paper radius="xl" p="lg">
<Stack gap="lg">
{/* Workflow header with ring progress */}
@@ -1085,7 +1101,20 @@ export default function TrainScheduleV2DetailPage() {
</Stack>
</Paper>
<ScheduleBatchPanel schedule={schedule} />
<ScheduleBatchPanel schedule={schedule} />
</Stack>
</Tabs.Panel>
<Tabs.Panel value="workspace">
<ScheduleWorkspacePanel
schedule={schedule}
onChanged={() => {
autoPreviewedRef.current = false;
void detailQuery.refetch();
}}
/>
</Tabs.Panel>
</Tabs>
{scheduleId ? (
<RescheduleTrainDialog

View File

@@ -89,7 +89,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, maxTrainLengthMeters: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -100,7 +99,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, maxTrainWeightTons: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -110,7 +108,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, maxWagonsPerTrain: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -124,7 +121,6 @@ export default function TrainSchedulingGlobalRulesPage() {
}))
}
min={0.001}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -138,7 +134,6 @@ export default function TrainSchedulingGlobalRulesPage() {
}))
}
min={0}
clampBehavior="strict"
disabled={loading}
/>
</Stack>
@@ -158,7 +153,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, importWindowLeadDays: value }))
}
min={0}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -169,7 +163,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, exportBookingLeadHours: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -181,7 +174,6 @@ export default function TrainSchedulingGlobalRulesPage() {
}
min={0}
max={23}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -193,7 +185,6 @@ export default function TrainSchedulingGlobalRulesPage() {
min={0.25}
max={12}
step={0.25}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -204,7 +195,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, docReviewMinutes: value }))
}
min={0}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -215,7 +205,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, paymentWindowMinutes: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<NumberInput
@@ -226,7 +215,6 @@ export default function TrainSchedulingGlobalRulesPage() {
setForm((current) => ({ ...current, reopenDelayMinutes: value }))
}
min={1}
clampBehavior="strict"
disabled={loading}
/>
<Group justify="flex-end">