mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
- Removed the BookingClearanceWorkflowBanner from ClearanceCard as the clearance progress is now integrated into the unified journey wizard. - Eliminated the MilestoneTimeline component from DocumentsTab, consolidating customs progress into the JourneyWizard. - Updated PageHeader to include a ContractReferenceLink for better navigation to contract details. - Simplified ShipmentTrackingCard to focus on duty/tax payment slip upload, removing unnecessary milestone display. - Integrated JourneyWizard component to visualize the booking journey, replacing the previous progress tracker. - Enhanced ContractDetailPage to better categorize documents and improve user experience with clearer sections for profile, business license, clearance, and other documents. - Introduced CSS for contracts table to manage column sizing and sticky headers effectively. - Added ContractReferenceLink component for backoffice to link to contract details, ensuring consistent navigation across applications.
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { Link } from "react-router-dom";
|
|
|
|
/**
|
|
* The parent contract's reference, linking to that contract's detail page.
|
|
*
|
|
* Backoffice-local on purpose: the contract detail route differs per app
|
|
* (`/dashboard/contract-requests/:id` here vs `/contracts/:id` in the portal),
|
|
* so the portal keeps its own copy in `pages/bookings/booking-display.tsx`
|
|
* rather than the two sharing a component that would have to take the route as
|
|
* a prop at every call site.
|
|
*
|
|
* Renders nothing when either field is missing: `contractId` is nullable on the
|
|
* booking, and only the bookings list/detail endpoints join `contractReference`
|
|
* — other endpoints (warehouse, fleet, payments) return booking rows without it,
|
|
* and a link with no id would be a dead one.
|
|
*
|
|
* `stopPropagation` matters: booking rows are click-to-navigate, so without it a
|
|
* click here would race the row handler and land on the booking instead.
|
|
*/
|
|
export function ContractReferenceLink({
|
|
contractId,
|
|
contractReference,
|
|
className,
|
|
}: {
|
|
contractId?: string | null;
|
|
contractReference?: string | null;
|
|
className?: string;
|
|
}) {
|
|
if (!contractId || !contractReference) return null;
|
|
|
|
return (
|
|
<Link
|
|
to={`/dashboard/contract-requests/${contractId}`}
|
|
onClick={(e) => e.stopPropagation()}
|
|
className={
|
|
className ??
|
|
"block truncate font-mono text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground"
|
|
}
|
|
>
|
|
{contractReference}
|
|
</Link>
|
|
);
|
|
}
|