@flowselections/pick-schermen-kwekers 1.0.70 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/pick/PickScherm.d.ts.map +1 -1
- package/dist-lib/components/pick/PickScherm.js +24 -7
- package/dist-lib/hooks/usePickQueue.d.ts +2 -0
- package/dist-lib/hooks/usePickQueue.d.ts.map +1 -1
- package/dist-lib/hooks/usePickQueue.js +6 -1
- package/dist-lib/integrations/supabase/types.d.ts +470 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/__tests__/pickBackoff.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/pickBackoff.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/pickBackoff.test.js +10 -0
- package/dist-lib/lib/__tests__/pickLoadOrder.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/pickLoadOrder.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/pickLoadOrder.test.js +37 -0
- package/dist-lib/lib/__tests__/pickSharedCart.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/pickSharedCart.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/pickSharedCart.test.js +14 -0
- package/dist-lib/lib/pick159.d.ts.map +1 -1
- package/dist-lib/lib/pick159.js +1 -0
- package/dist-lib/lib/pickApi.d.ts +2 -0
- package/dist-lib/lib/pickApi.d.ts.map +1 -1
- package/dist-lib/lib/pickApi.js +16 -0
- package/dist-lib/lib/pickBackoff.d.ts +12 -0
- package/dist-lib/lib/pickBackoff.d.ts.map +1 -0
- package/dist-lib/lib/pickBackoff.js +16 -0
- package/dist-lib/lib/pickCartResults.d.ts +1 -1
- package/dist-lib/lib/pickCartResults.d.ts.map +1 -1
- package/dist-lib/lib/pickCartResults.js +5 -2
- package/dist-lib/lib/pickLoadOrder.d.ts +15 -0
- package/dist-lib/lib/pickLoadOrder.d.ts.map +1 -0
- package/dist-lib/lib/pickLoadOrder.js +13 -0
- package/package.json +1 -1
- package/schema/pickschermen.sql +234 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickScherm.d.ts","sourceRoot":"","sources":["../../../src/components/pick/PickScherm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickScherm.d.ts","sourceRoot":"","sources":["../../../src/components/pick/PickScherm.tsx"],"names":[],"mappings":"AA2DA,OAAO,EAaL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AA+D7B,UAAU,KAAK;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAGD,wCAAwC;AACxC,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,WAAuC,CAAC;AAsBxF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,sCAutEpD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { showSyncingNotice } from "../../lib/pickLoadOrder.js";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
5
|
import { Badge, Button, Card, CardContent, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
|
|
5
6
|
import { AlertTriangle, ArrowLeft, CheckCircle2, ChevronLeft, ChevronRight, FileDown, Globe, Loader2, Printer, RefreshCw, Search, WifiOff, Zap, } from "lucide-react";
|
|
@@ -16,6 +17,7 @@ import { CART_PLAN_MISMATCH_MESSAGE, formatSiteTime, WORKDAYS_UNKNOWN, autoSendM
|
|
|
16
17
|
import { completeLogisticsTaskForItem, documentTypeOf } from "../../lib/pickPrint.js";
|
|
17
18
|
import { cartRowOf, isPdfOnlyFailure, pickReadiness, printedCartIdsOf, pdfSaveWarning, unitRefOf, statusRefOf, unitTitleOf, } from "../../lib/pickTypes.js";
|
|
18
19
|
import { rowFingerprint, rowsToVerify } from "../../lib/pickVerify.js";
|
|
20
|
+
import { VERIFY_SLOW_MESSAGE, VERIFY_SLOW_TOAST_ID, verifyDelayMs } from "../../lib/pickBackoff.js";
|
|
19
21
|
import { alreadyPrintedResults, CART_MISSING_MESSAGE, cartResultLine, cartsForRow, isCartMissingError, reprintCartsIndividually, resettableJobs, runExclusive, resultsFromBatch, resultsFromBatchError, summarizeCartResults, trackableJobs, } from "../../lib/pickCartResults.js";
|
|
20
22
|
import { getPickTranslator } from "../../lib/pickI18n.js";
|
|
21
23
|
import { friendlyPickError, getPickUiTexts } from "../../lib/pickUiText.js";
|
|
@@ -226,7 +228,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
226
228
|
return () => clearTimeout(timer);
|
|
227
229
|
}, [searchInput]);
|
|
228
230
|
const effectiveFilters = useMemo(() => ({ ...filters, country: null, sortRules: [] }), [filters]);
|
|
229
|
-
const { items, total, loading, lockedIds, refresh, pendingCount, printedCount, countsLoading, urgentCount, realtimeOk, pickDay, rebuiltAt, syncError, } = usePickQueue({
|
|
231
|
+
const { items, total, loading, lockedIds, refresh, pendingCount, printedCount, countsLoading, urgentCount, realtimeOk, pickDay, rebuiltAt, syncError, syncing, } = usePickQueue({
|
|
230
232
|
stationId: station.id,
|
|
231
233
|
filters: effectiveFilters,
|
|
232
234
|
enabled: lang !== null,
|
|
@@ -419,6 +421,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
419
421
|
const itemsRef = useRef([]);
|
|
420
422
|
itemsRef.current = Array.isArray(items) ? items : [];
|
|
421
423
|
const verifyMemo = useRef(new Map());
|
|
424
|
+
const verifyFailures = useRef(0);
|
|
422
425
|
useEffect(() => {
|
|
423
426
|
let cancelled = false;
|
|
424
427
|
let running = false;
|
|
@@ -472,9 +475,15 @@ export function PickScherm({ station, onBack }) {
|
|
|
472
475
|
checkedAt: now,
|
|
473
476
|
});
|
|
474
477
|
}
|
|
478
|
+
if (verifyFailures.current > 0)
|
|
479
|
+
toast.dismiss(VERIFY_SLOW_TOAST_ID);
|
|
480
|
+
verifyFailures.current = 0;
|
|
475
481
|
}
|
|
476
482
|
catch {
|
|
477
|
-
// fail closed: bestaande uitkomst blijft staan; nooit bevestigde regels blijven "Pakbon ophalen"
|
|
483
|
+
// fail closed: bestaande uitkomst blijft staan; nooit bevestigde regels blijven "Pakbon ophalen".
|
|
484
|
+
// Steeds langer wachten (10 → 20 → 40 s, max 2 min) en één melding tonen.
|
|
485
|
+
verifyFailures.current += 1;
|
|
486
|
+
toast.warning(VERIFY_SLOW_MESSAGE, { id: VERIFY_SLOW_TOAST_ID });
|
|
478
487
|
}
|
|
479
488
|
finally {
|
|
480
489
|
running = false;
|
|
@@ -485,11 +494,18 @@ export function PickScherm({ station, onBack }) {
|
|
|
485
494
|
setReadinessById((prev) => ({ ...prev, ...next }));
|
|
486
495
|
setCheckProgress({ done: 0, total: 0 });
|
|
487
496
|
};
|
|
488
|
-
|
|
489
|
-
const
|
|
497
|
+
let timer;
|
|
498
|
+
const loop = async () => {
|
|
499
|
+
await verifyVisibleRows();
|
|
500
|
+
if (cancelled)
|
|
501
|
+
return;
|
|
502
|
+
timer = window.setTimeout(() => void loop(), verifyDelayMs(verifyFailures.current));
|
|
503
|
+
};
|
|
504
|
+
void loop();
|
|
490
505
|
return () => {
|
|
491
506
|
cancelled = true;
|
|
492
|
-
|
|
507
|
+
if (timer !== undefined)
|
|
508
|
+
window.clearTimeout(timer);
|
|
493
509
|
};
|
|
494
510
|
}, [visibleIdsKey]);
|
|
495
511
|
/**
|
|
@@ -1099,7 +1115,8 @@ export function PickScherm({ station, onBack }) {
|
|
|
1099
1115
|
const todo = rowCarts.filter((cart) => !already.includes(cart.cartId));
|
|
1100
1116
|
if (todo.length === 0) {
|
|
1101
1117
|
// Alles al geprint: geen opdracht. Herprinten alleen via de knop Herprint.
|
|
1102
|
-
|
|
1118
|
+
const shared = await pickApi.sharedCartMessages(item.id, rowCarts.map((c) => c.cartId));
|
|
1119
|
+
showCartResults(alreadyPrintedResults(rowCarts, shared));
|
|
1103
1120
|
await releaseQuietly(item.id);
|
|
1104
1121
|
refresh();
|
|
1105
1122
|
return;
|
|
@@ -1387,7 +1404,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
1387
1404
|
? "Pickwachtrij laden…"
|
|
1388
1405
|
: checkDone > 0
|
|
1389
1406
|
? `Pakbonnen controleren (${checkDone} van ${checkTotal})…`
|
|
1390
|
-
: `Pakbonnen controleren (${checkTotal})…` }), _jsxs("span", { className: "tabular-nums", children: [loadPercent, "%"] })] }), _jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-muted", children: _jsx("div", { className: "h-full rounded-full bg-primary transition-all duration-300", style: { width: `${Math.max(5, loadPercent)}%` } }) })] })), _jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:flex-wrap md:items-center md:justify-between", children: [_jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-3", children: [_jsxs(Button, { variant: "outline", size: "lg", className: "h-12 shrink-0 px-3 sm:px-4", onClick: () => setLang(null), "aria-label": t("changeLanguage"), children: [_jsx(Globe, { className: "h-5 w-5 sm:mr-2" }), _jsx("span", { className: "hidden sm:inline", children: t("changeLanguage") })] }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "truncate text-lg font-bold text-foreground sm:text-xl", children: station.name }), _jsxs("p", { className: "truncate text-sm text-muted-foreground", children: [countsLoading ? "…" : pendingCount, " ", t("statusToPrint"), " \u00B7 ", countsLoading ? "…" : printedCount, " ", t("statusPrinted"), openJobIds.length > 0 ? ` · ${openJobIds.length} wacht op printer` : ""] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", size: "lg", className: "h-12 px-3", onClick: () => void shiftDay(-1), disabled: loadingDay || !(chosenDay ?? pickDay), "aria-label": ui.pickDayPrev, children: [_jsx(ChevronLeft, { className: "h-5 w-5 sm:mr-1" }), _jsx("span", { className: "hidden sm:inline", children: ui.pickDayPrev })] }), _jsx("div", { className: "flex h-12 items-center rounded-md border bg-muted px-4 text-sm font-semibold text-foreground", children: chosenDay ? dayLabel(chosenDay) : ui.pickDayToday }), _jsxs(Button, { variant: "outline", size: "lg", className: "h-12 px-3", onClick: () => void shiftDay(1), disabled: loadingDay || !(chosenDay ?? pickDay), "aria-label": ui.pickDayNext, children: [_jsx("span", { className: "hidden sm:inline", children: ui.pickDayNext }), _jsx(ChevronRight, { className: "h-5 w-5 sm:ml-1" })] }), chosenDay && (_jsx(Button, { variant: "secondary", size: "lg", className: "h-12 px-4", onClick: () => void chooseDay("current"), disabled: loadingDay, children: ui.pickDayBackToToday }))] }), _jsxs("div", { className: "flex items-center gap-2", children: [!online && (_jsxs(Badge, { className: "bg-destructive text-destructive-foreground", children: [_jsx(WifiOff, { className: "mr-1 h-3.5 w-3.5" }), " ", t("offline")] })), _jsx(Button, { variant: "outline", size: "icon", className: "h-12 w-12 shrink-0", onClick: refresh, "aria-label": t("refresh"), children: _jsx(RefreshCw, { className: "h-4 w-4" }) }), _jsxs(Button, { variant: "outline", size: "lg", className: "hidden h-14 px-5 md:inline-flex", disabled: fetchingNotes, onClick: () => void fetchShippingNotes(), children: [fetchingNotes ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(FileDown, { className: "mr-2 h-5 w-5" })), fetchingNotes ? "Ophalen…" : "Verzendbrieven ophalen"] }), cartsPerPrint != null && (_jsxs(Button, { size: "lg", className: "hidden h-14 px-6 text-lg md:inline-flex", disabled: loading || printStatusLoading || batchPrinting || (busyId != null || actionBusy), onClick: () => void printNextCarts(), children: [batchPrinting ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), "Volgende printen (", cartsPerPrint, " karren)"] })), _jsxs(Button, { size: "lg", className: "hidden h-14 px-8 text-lg md:inline-flex", onClick: () => (pending ? confirmPending() : fetchNextLocked()), disabled: (busyId !== null || actionBusy) || fetchingData || (!pending && printStatusLoading), children: [(busyId !== null || actionBusy) || fetchingData ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : pending && !readiness.ready ? (_jsx(RefreshCw, { className: "mr-2 h-5 w-5" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), pending && !readiness.ready ? "Pakbon ophalen" : t("printNext")] })] })] }), syncError && (_jsxs("div", { role: "alert", className: "flex items-start gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("span", { children: [SYNC_ERROR_MESSAGE, _jsxs("details", { className: "mt-1 text-xs text-muted-foreground", children: [_jsx("summary", { children: "Details voor beheer" }), syncError] })] })] })), !plekLoading && !printPlek && (_jsxs("div", { className: "flex items-start gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsx("span", { children: "Nog geen printplek gekoppeld \u2014 de opdracht blijft in de wachtrij staan." })] })), (cartMissing || rowGone) && (_jsxs("div", { role: "alert", className: "flex flex-col gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("span", { className: "flex items-start gap-2", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), rowGone ? ROW_GONE_MESSAGE : CART_MISSING_MESSAGE] }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
|
|
1407
|
+
: `Pakbonnen controleren (${checkTotal})…` }), _jsxs("span", { className: "tabular-nums", children: [loadPercent, "%"] })] }), _jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-muted", children: _jsx("div", { className: "h-full rounded-full bg-primary transition-all duration-300", style: { width: `${Math.max(5, loadPercent)}%` } }) })] })), _jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:flex-wrap md:items-center md:justify-between", children: [_jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-3", children: [_jsxs(Button, { variant: "outline", size: "lg", className: "h-12 shrink-0 px-3 sm:px-4", onClick: () => setLang(null), "aria-label": t("changeLanguage"), children: [_jsx(Globe, { className: "h-5 w-5 sm:mr-2" }), _jsx("span", { className: "hidden sm:inline", children: t("changeLanguage") })] }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "truncate text-lg font-bold text-foreground sm:text-xl", children: station.name }), _jsxs("p", { className: "truncate text-sm text-muted-foreground", children: [countsLoading ? "…" : pendingCount, " ", t("statusToPrint"), " \u00B7 ", countsLoading ? "…" : printedCount, " ", t("statusPrinted"), openJobIds.length > 0 ? ` · ${openJobIds.length} wacht op printer` : ""] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", size: "lg", className: "h-12 px-3", onClick: () => void shiftDay(-1), disabled: loadingDay || !(chosenDay ?? pickDay), "aria-label": ui.pickDayPrev, children: [_jsx(ChevronLeft, { className: "h-5 w-5 sm:mr-1" }), _jsx("span", { className: "hidden sm:inline", children: ui.pickDayPrev })] }), _jsx("div", { className: "flex h-12 items-center rounded-md border bg-muted px-4 text-sm font-semibold text-foreground", children: chosenDay ? dayLabel(chosenDay) : ui.pickDayToday }), _jsxs(Button, { variant: "outline", size: "lg", className: "h-12 px-3", onClick: () => void shiftDay(1), disabled: loadingDay || !(chosenDay ?? pickDay), "aria-label": ui.pickDayNext, children: [_jsx("span", { className: "hidden sm:inline", children: ui.pickDayNext }), _jsx(ChevronRight, { className: "h-5 w-5 sm:ml-1" })] }), chosenDay && (_jsx(Button, { variant: "secondary", size: "lg", className: "h-12 px-4", onClick: () => void chooseDay("current"), disabled: loadingDay, children: ui.pickDayBackToToday }))] }), _jsxs("div", { className: "flex items-center gap-2", children: [!online && (_jsxs(Badge, { className: "bg-destructive text-destructive-foreground", children: [_jsx(WifiOff, { className: "mr-1 h-3.5 w-3.5" }), " ", t("offline")] })), _jsx(Button, { variant: "outline", size: "icon", className: "h-12 w-12 shrink-0", onClick: refresh, "aria-label": t("refresh"), children: _jsx(RefreshCw, { className: "h-4 w-4" }) }), _jsxs(Button, { variant: "outline", size: "lg", className: "hidden h-14 px-5 md:inline-flex", disabled: fetchingNotes, onClick: () => void fetchShippingNotes(), children: [fetchingNotes ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(FileDown, { className: "mr-2 h-5 w-5" })), fetchingNotes ? "Ophalen…" : "Verzendbrieven ophalen"] }), cartsPerPrint != null && (_jsxs(Button, { size: "lg", className: "hidden h-14 px-6 text-lg md:inline-flex", disabled: loading || printStatusLoading || batchPrinting || (busyId != null || actionBusy), onClick: () => void printNextCarts(), children: [batchPrinting ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), "Volgende printen (", cartsPerPrint, " karren)"] })), _jsxs(Button, { size: "lg", className: "hidden h-14 px-8 text-lg md:inline-flex", onClick: () => (pending ? confirmPending() : fetchNextLocked()), disabled: (busyId !== null || actionBusy) || fetchingData || (!pending && printStatusLoading), children: [(busyId !== null || actionBusy) || fetchingData ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : pending && !readiness.ready ? (_jsx(RefreshCw, { className: "mr-2 h-5 w-5" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), pending && !readiness.ready ? "Pakbon ophalen" : t("printNext")] })] })] }), showSyncingNotice({ syncing, syncError }) && (_jsx("div", { role: "status", "aria-live": "polite", className: "px-4 py-1 text-xs text-muted-foreground", children: "Wachtrij wordt bijgewerkt\u2026" })), syncError && (_jsxs("div", { role: "alert", className: "flex items-start gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("span", { children: [SYNC_ERROR_MESSAGE, _jsxs("details", { className: "mt-1 text-xs text-muted-foreground", children: [_jsx("summary", { children: "Details voor beheer" }), syncError] })] })] })), !plekLoading && !printPlek && (_jsxs("div", { className: "flex items-start gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsx("span", { children: "Nog geen printplek gekoppeld \u2014 de opdracht blijft in de wachtrij staan." })] })), (cartMissing || rowGone) && (_jsxs("div", { role: "alert", className: "flex flex-col gap-2 rounded-md border-2 border-destructive/50 bg-destructive/5 p-3 text-sm text-destructive sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("span", { className: "flex items-start gap-2", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), rowGone ? ROW_GONE_MESSAGE : CART_MISSING_MESSAGE] }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
|
|
1391
1408
|
setCartMissing(false);
|
|
1392
1409
|
setRowGone(false);
|
|
1393
1410
|
setPending(null);
|
|
@@ -37,6 +37,8 @@ export declare function usePickQueue(args: {
|
|
|
37
37
|
realtimeOk: boolean;
|
|
38
38
|
/** Letterlijke fout uit de wachtrij-synchronisatie, of null. */
|
|
39
39
|
syncError: string | null;
|
|
40
|
+
/** Synchronisatie loopt op de achtergrond: "Wachtrij wordt bijgewerkt…". */
|
|
41
|
+
syncing: boolean;
|
|
40
42
|
/** Tijdstip van de laatste heropbouw na een buffer-seintje van de Engine. */
|
|
41
43
|
rebuiltAt: number | null;
|
|
42
44
|
refresh: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePickQueue.d.ts","sourceRoot":"","sources":["../../src/hooks/usePickQueue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAY,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"usePickQueue.d.ts","sourceRoot":"","sources":["../../src/hooks/usePickQueue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAY,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAM9E,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,EAAE,YAS5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;;;;;;;IAuNG,sDAAsD;;;;;;IAMtD,gEAAgE;;IAEhE,4EAA4E;;IAE5E,6EAA6E;;;EAIhF;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM;;EAuBhG;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,iFAOnF;AACD,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,OAAO,UAAO;;;YAQzC;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,CAAC,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAEpF"}
|
|
@@ -4,6 +4,7 @@ import { pickApi, pickDb } from "../lib/pickApi.js";
|
|
|
4
4
|
import { safeArray } from "../lib/pickTypes.js";
|
|
5
5
|
import { isRowOpen } from "../lib/pick143.js";
|
|
6
6
|
import { pickMark, pickMeasure } from "../lib/pickPerf.js";
|
|
7
|
+
import { pickDayLoadEnabled } from "../lib/pickLoadOrder.js";
|
|
7
8
|
export const defaultFilters = {
|
|
8
9
|
country: null,
|
|
9
10
|
search: "",
|
|
@@ -63,9 +64,11 @@ export function usePickQueue(args) {
|
|
|
63
64
|
});
|
|
64
65
|
const rebuildCount = bufferEventsQuery.data?.events ?? 0;
|
|
65
66
|
const [rebuiltAt, setRebuiltAt] = useState(null);
|
|
67
|
+
// 1.0.73: openen wacht niet meer op de Engine-synchronisatie. De bestaande
|
|
68
|
+
// wachtrij verschijnt meteen; na de sync wordt opnieuw geladen.
|
|
66
69
|
const pickDayQuery = useQuery({
|
|
67
70
|
queryKey: ["pick", "pickDay"],
|
|
68
|
-
enabled: enabled
|
|
71
|
+
enabled: pickDayLoadEnabled({ enabled, syncPending: syncQuery.isPending }),
|
|
69
72
|
queryFn: () => pickMeasure("pickdag", () => pickApi.currentPickDay()),
|
|
70
73
|
staleTime: 30000,
|
|
71
74
|
});
|
|
@@ -210,6 +213,8 @@ export function usePickQueue(args) {
|
|
|
210
213
|
realtimeOk,
|
|
211
214
|
/** Letterlijke fout uit de wachtrij-synchronisatie, of null. */
|
|
212
215
|
syncError: syncQuery.data?.syncError ?? null,
|
|
216
|
+
/** Synchronisatie loopt op de achtergrond: "Wachtrij wordt bijgewerkt…". */
|
|
217
|
+
syncing: syncQuery.isFetching || bufferEventsQuery.isFetching,
|
|
213
218
|
/** Tijdstip van de laatste heropbouw na een buffer-seintje van de Engine. */
|
|
214
219
|
rebuiltAt,
|
|
215
220
|
refresh: invalidateNow,
|