From 8612622dd8f99496c4a71dea6038a12186a8c43c Mon Sep 17 00:00:00 2001 From: Benson Cho <100653148+choden-dev@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:38:58 +1000 Subject: [PATCH 1/2] feat(admin): manage timeslot link + per-order download on orders-by-timeslot --- components/admin/OrdersByTimeslotView.tsx | 61 ++++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/components/admin/OrdersByTimeslotView.tsx b/components/admin/OrdersByTimeslotView.tsx index 67ef1ac..09275d3 100644 --- a/components/admin/OrdersByTimeslotView.tsx +++ b/components/admin/OrdersByTimeslotView.tsx @@ -195,9 +195,15 @@ function OrdersByTimeslotViewInner() { [getFileKey], ); - /** Download all files for all orders in a timeslot group sequentially */ + /** + * Open every downloadable file across the given orders in new tabs. + * + * Shared by the per-timeslot "Download All Files" button and the per-order + * download button, so both behave identically (parallel presign, sequential + * open with a small delay to dodge popup blockers). + */ const downloadingRef = useRef(false); - const handleDownloadAllFiles = useCallback( + const downloadFilesForOrders = useCallback( async (orders: OrderData[]) => { if (downloadingRef.current) return; downloadingRef.current = true; @@ -265,6 +271,18 @@ function OrdersByTimeslotViewInner() { [getFileKey], ); + /** Download all files across every order in a timeslot group. */ + const handleDownloadAllFiles = useCallback( + (orders: OrderData[]) => downloadFilesForOrders(orders), + [downloadFilesForOrders], + ); + + /** Download all files for a single order. */ + const handleDownloadOrderFiles = useCallback( + (order: OrderData) => downloadFilesForOrders([order]), + [downloadFilesForOrders], + ); + return (
@@ -457,6 +475,23 @@ function OrdersByTimeslotViewInner() { > ⬇ Download All Files + + ⚙ Manage Timeslot +
@@ -691,6 +726,28 @@ function OrdersByTimeslotViewInner() { )} + {order.files?.some( + (f) => f.stagingKey || f.permanentKey, + ) && ( + + )} {order.status === OrderStatus.AWAITING_PICKUP && (