mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
fix issues
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { ExternalLink, MoreHorizontal, Receipt } from "lucide-react";
|
||||
import { Button, Menu, ActionIcon, Group, Text } from "@mantine/core";
|
||||
|
||||
import { BookingConfirmDialog } from "./BookingConfirmDialog";
|
||||
import { OperationRescheduleModal } from "./OperationRescheduleModal";
|
||||
import { useBookingActionDialog } from "./useBookingActionDialog";
|
||||
import { useAuth } from "@/auth/useAuth";
|
||||
import { FREIGHT_PERMS, hasPermission as hasFreightPermission } from "@/lib/permissions";
|
||||
@@ -10,6 +12,7 @@ import {
|
||||
isAllocateAction,
|
||||
isClearanceNavAction,
|
||||
isContractNavAction,
|
||||
isRescheduleAction,
|
||||
listRowHasActions,
|
||||
type BookingActionContext,
|
||||
} from "@/features/bookings/booking-actions.config";
|
||||
@@ -44,6 +47,8 @@ export function BookingActionsMenu({
|
||||
|
||||
const flow = useBookingActionDialog(row.id, context);
|
||||
const { actions, pendingAction, mutations } = flow;
|
||||
// Day / train reschedule has its own modal (date + export train picker).
|
||||
const [rescheduleOpen, setRescheduleOpen] = useState(false);
|
||||
|
||||
const goToContract = () =>
|
||||
navigate(`/dashboard/booking-requests/${row.id}/contract`);
|
||||
@@ -67,6 +72,8 @@ export function BookingActionsMenu({
|
||||
goToClearanceTab();
|
||||
} else if (isAllocateAction(action.id)) {
|
||||
onAllocateBooking?.();
|
||||
} else if (isRescheduleAction(action.id)) {
|
||||
setRescheduleOpen(true);
|
||||
} else {
|
||||
flow.openAction(action);
|
||||
}
|
||||
@@ -109,6 +116,14 @@ export function BookingActionsMenu({
|
||||
consolidationPartnerId={row.consolidationPartnerId}
|
||||
consolidationPartnerReference={row.consolidationPartnerReference}
|
||||
/>
|
||||
<OperationRescheduleModal
|
||||
bookingId={row.id}
|
||||
opened={rescheduleOpen}
|
||||
onClose={() => {
|
||||
onSuppressRowClick?.();
|
||||
setRescheduleOpen(false);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -183,6 +198,14 @@ export function BookingActionsMenu({
|
||||
consolidationPartnerId={row.consolidationPartnerId}
|
||||
consolidationPartnerReference={row.consolidationPartnerReference}
|
||||
/>
|
||||
<OperationRescheduleModal
|
||||
bookingId={row.id}
|
||||
opened={rescheduleOpen}
|
||||
onClose={() => {
|
||||
onSuppressRowClick?.();
|
||||
setRescheduleOpen(false);
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user