@flowselections/pick-schermen-kwekers 1.0.15 → 1.0.16
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 +3 -1
- package/dist-lib/components/pick/PreviewDialog.d.ts +13 -0
- package/dist-lib/components/pick/PreviewDialog.d.ts.map +1 -0
- package/dist-lib/components/pick/PreviewDialog.js +52 -0
- package/dist-lib/components/pick/QueueTable.d.ts +2 -1
- package/dist-lib/components/pick/QueueTable.d.ts.map +1 -1
- package/dist-lib/components/pick/QueueTable.js +11 -5
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +146 -12
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +146 -12
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +146 -12
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +146 -12
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/pickPreview.d.ts +19 -0
- package/dist-lib/lib/pickPreview.d.ts.map +1 -0
- package/dist-lib/lib/pickPreview.js +75 -0
- package/dist-lib/lib/pickUiText.d.ts +1 -0
- package/dist-lib/lib/pickUiText.d.ts.map +1 -1
- package/dist-lib/lib/pickUiText.js +11 -1
- package/package.json +1 -1
|
@@ -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":"AAgCA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAkBtE,UAAU,KAAK;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAID;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,+BAwmBpD"}
|
|
@@ -4,6 +4,7 @@ import { Badge, Button, Card, CardContent, Input, Select, SelectContent, SelectI
|
|
|
4
4
|
import { AlertTriangle, ArrowLeft, CheckCircle2, Globe, Loader2, Printer, RefreshCw, ScanLine, Search, WifiOff, Zap, } from "lucide-react";
|
|
5
5
|
import { LanguageTiles } from "./LanguageTiles";
|
|
6
6
|
import { QueueTable } from "./QueueTable";
|
|
7
|
+
import { PreviewDialog } from "./PreviewDialog";
|
|
7
8
|
import { getSessionId, pickApi } from "../../lib/pickApi";
|
|
8
9
|
import { completeLogisticsTaskForItem } from "../../lib/pickPrint";
|
|
9
10
|
import { getPickTranslator } from "../../lib/pickI18n";
|
|
@@ -26,6 +27,7 @@ export function PickScherm({ station, onBack }) {
|
|
|
26
27
|
const [busyId, setBusyId] = useState(null);
|
|
27
28
|
const [pending, setPending] = useState(null);
|
|
28
29
|
const [lastPrinted, setLastPrinted] = useState(null);
|
|
30
|
+
const [previewItem, setPreviewItem] = useState(null);
|
|
29
31
|
const [emptyNotice, setEmptyNotice] = useState(null);
|
|
30
32
|
const resetDone = useRef(null);
|
|
31
33
|
const autoFetched = useRef(false);
|
|
@@ -304,5 +306,5 @@ export function PickScherm({ station, onBack }) {
|
|
|
304
306
|
return;
|
|
305
307
|
e.preventDefault();
|
|
306
308
|
void handleScan(scanInput);
|
|
307
|
-
} })] }), _jsxs(Select, { value: filters.documentTypeId ?? "all", onValueChange: (v) => setFilters((f) => ({ ...f, documentTypeId: v === "all" ? null : v, page: 0 })), children: [_jsx(SelectTrigger, { className: "h-12 w-full sm:w-52", children: _jsx(SelectValue, { placeholder: ui.allDocumentTypes }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: ui.allDocumentTypes }), (Array.isArray(documentTypes) ? documentTypes : []).map((dt) => (_jsx(SelectItem, { value: dt.id, children: dt.name }, dt.id)))] })] }), _jsx(Button, { variant: filters.onlyPending ? "default" : "outline", className: "h-12", onClick: () => setFilters((f) => ({ ...f, onlyPending: !f.onlyPending, page: 0 })), children: ui.onlyPending }), _jsxs(Button, { variant: filters.urgentOnly ? "default" : "outline", className: "h-12", onClick: () => setFilters((f) => ({ ...f, urgentOnly: !f.urgentOnly, page: 0 })), children: [_jsx(Zap, { className: "mr-2 h-4 w-4" }), ui.onlyUrgent, urgentCount > 0 ? ` (${urgentCount})` : ""] })] }) }), !realtimeOk && (_jsx("p", { className: "text-sm text-muted-foreground", children: ui.connectionLost })), loading ? (_jsxs("div", { className: "flex items-center justify-center py-16 text-muted-foreground", children: [_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" }), " ", t("loadingQueue")] })) : (_jsx(QueueTable, { items: items, lockedIds: lockedIds, statuses: Array.isArray(statuses) ? statuses : [], documentTypes: Array.isArray(documentTypes) ? documentTypes : [], busyId: busyId, onPick: handlePick, onReprint: handleReprint, t: t })), _jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("span", { className: "text-center text-sm text-muted-foreground sm:text-left", children: [t("page"), " ", filters.page + 1, " ", t("of"), " ", totalPages] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 sm:flex", children: [_jsx(Button, { variant: "outline", className: "h-12 w-full sm:w-auto", disabled: filters.page === 0, onClick: () => setFilters((f) => ({ ...f, page: Math.max(0, f.page - 1) })), children: t("previous") }), _jsx(Button, { variant: "outline", className: "h-12 w-full sm:w-auto", disabled: filters.page + 1 >= totalPages, onClick: () => setFilters((f) => ({ ...f, page: f.page + 1 })), children: t("next") })] })] }), _jsx("div", { className: "fixed inset-x-0 bottom-0 z-40 border-t bg-background/95 p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] backdrop-blur md:hidden", children: _jsxs(Button, { size: "lg", className: "h-14 w-full text-lg", onClick: () => (pending ? confirmPending() : fetchNext()), disabled: busyId !== null, children: [busyId !== null ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), _jsxs("span", { className: "truncate", children: [t("printNext"), pending?.document_number ? ` · ${pending.document_number}` : ""] })] }) })] }));
|
|
309
|
+
} })] }), _jsxs(Select, { value: filters.documentTypeId ?? "all", onValueChange: (v) => setFilters((f) => ({ ...f, documentTypeId: v === "all" ? null : v, page: 0 })), children: [_jsx(SelectTrigger, { className: "h-12 w-full sm:w-52", children: _jsx(SelectValue, { placeholder: ui.allDocumentTypes }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: ui.allDocumentTypes }), (Array.isArray(documentTypes) ? documentTypes : []).map((dt) => (_jsx(SelectItem, { value: dt.id, children: dt.name }, dt.id)))] })] }), _jsx(Button, { variant: filters.onlyPending ? "default" : "outline", className: "h-12", onClick: () => setFilters((f) => ({ ...f, onlyPending: !f.onlyPending, page: 0 })), children: ui.onlyPending }), _jsxs(Button, { variant: filters.urgentOnly ? "default" : "outline", className: "h-12", onClick: () => setFilters((f) => ({ ...f, urgentOnly: !f.urgentOnly, page: 0 })), children: [_jsx(Zap, { className: "mr-2 h-4 w-4" }), ui.onlyUrgent, urgentCount > 0 ? ` (${urgentCount})` : ""] })] }) }), !realtimeOk && (_jsx("p", { className: "text-sm text-muted-foreground", children: ui.connectionLost })), loading ? (_jsxs("div", { className: "flex items-center justify-center py-16 text-muted-foreground", children: [_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" }), " ", t("loadingQueue")] })) : (_jsx(QueueTable, { items: items, lockedIds: lockedIds, statuses: Array.isArray(statuses) ? statuses : [], documentTypes: Array.isArray(documentTypes) ? documentTypes : [], busyId: busyId, onPick: handlePick, onReprint: handleReprint, onPreview: setPreviewItem, t: t })), _jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("span", { className: "text-center text-sm text-muted-foreground sm:text-left", children: [t("page"), " ", filters.page + 1, " ", t("of"), " ", totalPages] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 sm:flex", children: [_jsx(Button, { variant: "outline", className: "h-12 w-full sm:w-auto", disabled: filters.page === 0, onClick: () => setFilters((f) => ({ ...f, page: Math.max(0, f.page - 1) })), children: t("previous") }), _jsx(Button, { variant: "outline", className: "h-12 w-full sm:w-auto", disabled: filters.page + 1 >= totalPages, onClick: () => setFilters((f) => ({ ...f, page: f.page + 1 })), children: t("next") })] })] }), _jsx("div", { className: "fixed inset-x-0 bottom-0 z-40 border-t bg-background/95 p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] backdrop-blur md:hidden", children: _jsxs(Button, { size: "lg", className: "h-14 w-full text-lg", onClick: () => (pending ? confirmPending() : fetchNext()), disabled: busyId !== null, children: [busyId !== null ? (_jsx(Loader2, { className: "mr-2 h-5 w-5 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-5 w-5" })), _jsxs("span", { className: "truncate", children: [t("printNext"), pending?.document_number ? ` · ${pending.document_number}` : ""] })] }) }), _jsx(PreviewDialog, { item: previewItem, stationSlug: station.slug, onClose: () => setPreviewItem(null) })] }));
|
|
308
310
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PickQueueItem } from "../../lib/pickTypes";
|
|
2
|
+
interface Props {
|
|
3
|
+
item: PickQueueItem | null;
|
|
4
|
+
stationSlug: string | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Toont het PDF-voorbeeld zoals de printketen het opbouwt. Bewust zonder
|
|
9
|
+
* printknop: printen loopt uitsluitend via de wachtrijknoppen.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PreviewDialog({ item, stationSlug, onClose }: Props): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=PreviewDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewDialog.d.ts","sourceRoot":"","sources":["../../../src/components/pick/PreviewDialog.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,UAAU,KAAK;IACb,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,KAAK,+BAqFlE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@flowselections/core";
|
|
4
|
+
import { AlertTriangle, Loader2 } from "lucide-react";
|
|
5
|
+
import { fetchPickPreview, PickPreviewError } from "../../lib/pickPreview";
|
|
6
|
+
/**
|
|
7
|
+
* Toont het PDF-voorbeeld zoals de printketen het opbouwt. Bewust zonder
|
|
8
|
+
* printknop: printen loopt uitsluitend via de wachtrijknoppen.
|
|
9
|
+
*/
|
|
10
|
+
export function PreviewDialog({ item, stationSlug, onClose }) {
|
|
11
|
+
const [url, setUrl] = useState(null);
|
|
12
|
+
const [bron, setBron] = useState(null);
|
|
13
|
+
const [error, setError] = useState(null);
|
|
14
|
+
const [loading, setLoading] = useState(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!item)
|
|
17
|
+
return;
|
|
18
|
+
if (!stationSlug) {
|
|
19
|
+
setError("Dit pickstation heeft geen openbare verwijzing; een voorbeeld is niet mogelijk.");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
let objectUrl = null;
|
|
24
|
+
setLoading(true);
|
|
25
|
+
setError(null);
|
|
26
|
+
setUrl(null);
|
|
27
|
+
setBron(null);
|
|
28
|
+
fetchPickPreview({ stationSlug, queueItemId: item.id, signal: controller.signal })
|
|
29
|
+
.then((result) => {
|
|
30
|
+
objectUrl = result.url;
|
|
31
|
+
setUrl(result.url);
|
|
32
|
+
setBron(result.bron);
|
|
33
|
+
})
|
|
34
|
+
.catch((err) => {
|
|
35
|
+
if (controller.signal.aborted)
|
|
36
|
+
return;
|
|
37
|
+
setError(err instanceof PickPreviewError
|
|
38
|
+
? err.message
|
|
39
|
+
: "Het voorbeeld kon niet worden opgehaald.");
|
|
40
|
+
})
|
|
41
|
+
.finally(() => {
|
|
42
|
+
if (!controller.signal.aborted)
|
|
43
|
+
setLoading(false);
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
controller.abort();
|
|
47
|
+
if (objectUrl)
|
|
48
|
+
URL.revokeObjectURL(objectUrl);
|
|
49
|
+
};
|
|
50
|
+
}, [item, stationSlug]);
|
|
51
|
+
return (_jsx(Dialog, { open: !!item, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-3xl", children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { children: ["Voorbeeld ", item?.document_number ?? ""] }), _jsx(DialogDescription, { children: bron ? `Bron: ${bron}` : "Zo komt dit document uit de printer." })] }), loading && (_jsx("div", { className: "flex h-96 items-center justify-center", children: _jsx(Loader2, { className: "h-8 w-8 animate-spin text-primary" }) })), !loading && error && (_jsxs("div", { className: "flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 p-4", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" }), _jsx("p", { className: "text-sm text-foreground", children: error })] })), !loading && !error && url && (_jsx("object", { data: url, type: "application/pdf", className: "h-[70vh] max-h-[70vh] w-full rounded-lg border", "aria-label": `Voorbeeld van ${item?.document_number ?? "document"}`, children: _jsxs("p", { className: "p-4 text-sm text-muted-foreground", children: ["Deze browser kan de PDF niet tonen.", " ", _jsx("a", { className: "underline", href: url, target: "_blank", rel: "noreferrer", children: "Openen in een nieuw tabblad" })] }) }))] }) }));
|
|
52
|
+
}
|
|
@@ -8,9 +8,10 @@ interface Props {
|
|
|
8
8
|
busyId: string | null;
|
|
9
9
|
onPick: (item: PickQueueItem) => void;
|
|
10
10
|
onReprint?: (item: PickQueueItem) => void;
|
|
11
|
+
onPreview?: (item: PickQueueItem) => void;
|
|
11
12
|
readOnly?: boolean;
|
|
12
13
|
t?: PickTranslator;
|
|
13
14
|
}
|
|
14
|
-
export declare function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, onPick, onReprint, readOnly, t: translator, }: Props): import("react").JSX.Element;
|
|
15
|
+
export declare function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, onPick, onReprint, onPreview, readOnly, t: translator, }: Props): import("react").JSX.Element;
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=QueueTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueTable.d.ts","sourceRoot":"","sources":["../../../src/components/pick/QueueTable.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5E,UAAU,KAAK;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,CAAC,EAAE,cAAc,CAAC;CACpB;AASD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,EACN,MAAM,EACN,SAAS,EACT,QAAQ,EACR,CAAC,EAAE,UAAU,GACd,EAAE,KAAK,+
|
|
1
|
+
{"version":3,"file":"QueueTable.d.ts","sourceRoot":"","sources":["../../../src/components/pick/QueueTable.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5E,UAAU,KAAK;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,CAAC,EAAE,cAAc,CAAC;CACpB;AASD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,CAAC,EAAE,UAAU,GACd,EAAE,KAAK,+BA4PP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Badge, Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@flowselections/core";
|
|
3
|
-
import { AlertTriangle, Lock, Printer, RotateCcw } from "lucide-react";
|
|
3
|
+
import { AlertTriangle, Eye, Lock, Printer, RotateCcw } from "lucide-react";
|
|
4
4
|
import { sinceLabel } from "../../lib/pickTypes";
|
|
5
5
|
import { getPickTranslator } from "../../lib/pickI18n";
|
|
6
6
|
function priorityTone(priority, urgent) {
|
|
@@ -12,7 +12,7 @@ function priorityTone(priority, urgent) {
|
|
|
12
12
|
return "bg-secondary text-secondary-foreground";
|
|
13
13
|
return "bg-muted text-muted-foreground";
|
|
14
14
|
}
|
|
15
|
-
export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, onPick, onReprint, readOnly, t: translator, }) {
|
|
15
|
+
export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, onPick, onReprint, onPreview, readOnly, t: translator, }) {
|
|
16
16
|
const t = translator ?? getPickTranslator("nl");
|
|
17
17
|
const safeItems = Array.isArray(items) ? items : [];
|
|
18
18
|
const docById = new Map((Array.isArray(documentTypes) ? documentTypes : []).map((d) => [d.id, d]));
|
|
@@ -25,14 +25,20 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
|
|
|
25
25
|
priorityTone(item.priority, item.is_urgent), children: item.is_urgent ? t("urgent") : item.priority }) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: new Date(item.announced_at).toLocaleTimeString(t.locale, {
|
|
26
26
|
hour: "2-digit",
|
|
27
27
|
minute: "2-digit",
|
|
28
|
-
}) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: sinceLabel(item.announced_at) }), _jsx(TableCell, { className: "text-right", children:
|
|
28
|
+
}) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: sinceLabel(item.announced_at) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex items-center justify-end gap-1", children: [onPreview && (_jsx("button", { type: "button", "aria-label": "Voorbeeld " + item.document_number, title: "Voorbeeld " + item.document_number, className: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground", onClick: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
onPreview(item);
|
|
31
|
+
}, children: _jsx(Eye, { className: "h-5 w-5" }) })), printed ? (_jsxs(Button, { size: "sm", variant: "ghost", disabled: readOnly || busyId === item.id, onClick: () => (onReprint ?? onPick)(item), children: [_jsx(RotateCcw, { className: "mr-1 h-4 w-4" }), t("print")] })) : locked ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Lock, { className: "h-3.5 w-3.5" }), " ", t("inProgress")] })) : (_jsxs(Button, { size: "sm", variant: "outline", disabled: readOnly || busyId === item.id, onClick: () => onPick(item), children: [_jsx(Printer, { className: "mr-1 h-4 w-4" }), t("print")] }))] }) })] }, item.id));
|
|
29
32
|
}), safeItems.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 11, className: "py-10 text-center text-muted-foreground", children: t("emptyQueue") }) }))] })] }) }), _jsxs("div", { className: "space-y-3 md:hidden", children: [safeItems.map((item) => {
|
|
30
33
|
const printed = !!item.printed_at;
|
|
31
34
|
const locked = !printed && lockedIds.has(item.id);
|
|
32
35
|
const doc = item.document_type_id ? docById.get(item.document_type_id) : undefined;
|
|
33
36
|
const warnings = Array.isArray(item.warnings) ? item.warnings : [];
|
|
34
|
-
return (_jsxs("div", { className: "rounded-lg border bg-card p-4 " + (locked || printed ? "opacity-60" : ""), children: [_jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "truncate text-lg font-bold text-foreground", children: item.document_number }), warnings.length > 0 && (_jsx(AlertTriangle, { className: "h-4 w-4 shrink-0 text-destructive", "aria-label": t("warning") }))] }), _jsx("p", { className: "truncate text-xs text-muted-foreground", children: doc?.name ?? "-" })] }), _jsxs("div", { className: "flex shrink-0
|
|
35
|
-
|
|
37
|
+
return (_jsxs("div", { className: "rounded-lg border bg-card p-4 " + (locked || printed ? "opacity-60" : ""), children: [_jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "truncate text-lg font-bold text-foreground", children: item.document_number }), warnings.length > 0 && (_jsx(AlertTriangle, { className: "h-4 w-4 shrink-0 text-destructive", "aria-label": t("warning") }))] }), _jsx("p", { className: "truncate text-xs text-muted-foreground", children: doc?.name ?? "-" })] }), _jsxs("div", { className: "flex shrink-0 items-start gap-1", children: [onPreview && (_jsx("button", { type: "button", "aria-label": "Voorbeeld " + item.document_number, title: "Voorbeeld " + item.document_number, className: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground", onClick: (e) => {
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
onPreview(item);
|
|
40
|
+
}, children: _jsx(Eye, { className: "h-5 w-5" }) })), _jsxs("div", { className: "flex shrink-0 flex-col items-end gap-1", children: [_jsx(Badge, { variant: printed ? "secondary" : "default", children: printed ? t("statusPrinted") : t("statusToPrint") }), _jsx("span", { className: "rounded px-2 py-0.5 text-xs font-semibold " +
|
|
41
|
+
priorityTone(item.priority, item.is_urgent), children: item.is_urgent ? t("urgent") : item.priority })] })] })] }), _jsxs("div", { className: "mt-2 min-w-0 space-y-0.5 text-sm", children: [_jsx("p", { className: "truncate text-foreground", children: item.order_number }), _jsx("p", { className: "truncate text-muted-foreground", children: item.customer_name }), item.delivery_address && (_jsx("p", { className: "truncate text-xs text-muted-foreground", children: item.delivery_address }))] }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground", children: [_jsxs("span", { children: [t("lines"), ": ", item.line_count] }), _jsxs("span", { children: [t("carts"), ": ", item.cart_count] }), _jsxs("span", { children: [t("announced"), ":", " ", new Date(item.announced_at).toLocaleTimeString(t.locale, {
|
|
36
42
|
hour: "2-digit",
|
|
37
43
|
minute: "2-digit",
|
|
38
44
|
})] }), _jsxs("span", { children: [t("waiting"), ": ", sinceLabel(item.announced_at)] })] }), _jsx("div", { className: "mt-3", children: printed ? (_jsxs(Button, { size: "lg", variant: "outline", className: "h-12 w-full", disabled: readOnly || busyId === item.id, onClick: () => (onReprint ?? onPick)(item), children: [_jsx(RotateCcw, { className: "mr-2 h-4 w-4" }), t("print")] })) : locked ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Lock, { className: "h-3.5 w-3.5" }), " ", t("inProgress")] })) : (_jsxs(Button, { size: "lg", className: "h-12 w-full", disabled: readOnly || busyId === item.id, onClick: () => onPick(item), children: [_jsx(Printer, { className: "mr-2 h-4 w-4" }), t("print")] })) })] }, item.id));
|
|
@@ -2,18 +2,6 @@ import type { Database } from './types';
|
|
|
2
2
|
export declare const requireSupabaseAuth: import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
3
3
|
supabase: import("@supabase/supabase-js").SupabaseClient<Database, "public", "public", {
|
|
4
4
|
Tables: {
|
|
5
|
-
_banner_check: {
|
|
6
|
-
Row: {
|
|
7
|
-
inactief: import("./types").Json | null;
|
|
8
|
-
};
|
|
9
|
-
Insert: {
|
|
10
|
-
inactief?: import("./types").Json | null;
|
|
11
|
-
};
|
|
12
|
-
Update: {
|
|
13
|
-
inactief?: import("./types").Json | null;
|
|
14
|
-
};
|
|
15
|
-
Relationships: [];
|
|
16
|
-
};
|
|
17
5
|
afhandeling_settings: {
|
|
18
6
|
Row: {
|
|
19
7
|
auto_print_delivery_note: boolean;
|
|
@@ -10748,6 +10736,24 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
10748
10736
|
};
|
|
10749
10737
|
Relationships: [];
|
|
10750
10738
|
};
|
|
10739
|
+
maps_job_lease: {
|
|
10740
|
+
Row: {
|
|
10741
|
+
job: string;
|
|
10742
|
+
locked_until: string;
|
|
10743
|
+
updated_at: string;
|
|
10744
|
+
};
|
|
10745
|
+
Insert: {
|
|
10746
|
+
job: string;
|
|
10747
|
+
locked_until?: string;
|
|
10748
|
+
updated_at?: string;
|
|
10749
|
+
};
|
|
10750
|
+
Update: {
|
|
10751
|
+
job?: string;
|
|
10752
|
+
locked_until?: string;
|
|
10753
|
+
updated_at?: string;
|
|
10754
|
+
};
|
|
10755
|
+
Relationships: [];
|
|
10756
|
+
};
|
|
10751
10757
|
maps_request_queue: {
|
|
10752
10758
|
Row: {
|
|
10753
10759
|
attempts: number;
|
|
@@ -10809,6 +10815,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
10809
10815
|
last_error: string | null;
|
|
10810
10816
|
last_error_at: string | null;
|
|
10811
10817
|
last_success_at: string | null;
|
|
10818
|
+
provider: string;
|
|
10812
10819
|
updated_at: string;
|
|
10813
10820
|
};
|
|
10814
10821
|
Insert: {
|
|
@@ -10820,6 +10827,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
10820
10827
|
last_error?: string | null;
|
|
10821
10828
|
last_error_at?: string | null;
|
|
10822
10829
|
last_success_at?: string | null;
|
|
10830
|
+
provider?: string;
|
|
10823
10831
|
updated_at?: string;
|
|
10824
10832
|
};
|
|
10825
10833
|
Update: {
|
|
@@ -10831,6 +10839,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
10831
10839
|
last_error?: string | null;
|
|
10832
10840
|
last_error_at?: string | null;
|
|
10833
10841
|
last_success_at?: string | null;
|
|
10842
|
+
provider?: string;
|
|
10834
10843
|
updated_at?: string;
|
|
10835
10844
|
};
|
|
10836
10845
|
Relationships: [];
|
|
@@ -13568,6 +13577,39 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13568
13577
|
};
|
|
13569
13578
|
Relationships: [];
|
|
13570
13579
|
};
|
|
13580
|
+
print_dedupe_events: {
|
|
13581
|
+
Row: {
|
|
13582
|
+
bestaande_job_id: string | null;
|
|
13583
|
+
created_at: string;
|
|
13584
|
+
detail: string | null;
|
|
13585
|
+
documentnaam: string | null;
|
|
13586
|
+
documenttype: string | null;
|
|
13587
|
+
id: string;
|
|
13588
|
+
idempotentie_sleutel: string;
|
|
13589
|
+
reden: string;
|
|
13590
|
+
};
|
|
13591
|
+
Insert: {
|
|
13592
|
+
bestaande_job_id?: string | null;
|
|
13593
|
+
created_at?: string;
|
|
13594
|
+
detail?: string | null;
|
|
13595
|
+
documentnaam?: string | null;
|
|
13596
|
+
documenttype?: string | null;
|
|
13597
|
+
id?: string;
|
|
13598
|
+
idempotentie_sleutel: string;
|
|
13599
|
+
reden: string;
|
|
13600
|
+
};
|
|
13601
|
+
Update: {
|
|
13602
|
+
bestaande_job_id?: string | null;
|
|
13603
|
+
created_at?: string;
|
|
13604
|
+
detail?: string | null;
|
|
13605
|
+
documentnaam?: string | null;
|
|
13606
|
+
documenttype?: string | null;
|
|
13607
|
+
id?: string;
|
|
13608
|
+
idempotentie_sleutel?: string;
|
|
13609
|
+
reden?: string;
|
|
13610
|
+
};
|
|
13611
|
+
Relationships: [];
|
|
13612
|
+
};
|
|
13571
13613
|
print_job_logs: {
|
|
13572
13614
|
Row: {
|
|
13573
13615
|
created_at: string;
|
|
@@ -13609,6 +13651,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13609
13651
|
foutmelding: string | null;
|
|
13610
13652
|
gebruiker_id: string | null;
|
|
13611
13653
|
gebruiker_naam: string;
|
|
13654
|
+
gebruikte_bron: string | null;
|
|
13655
|
+
gebruikte_layout_id: string | null;
|
|
13612
13656
|
gestart_op: string | null;
|
|
13613
13657
|
herkomst: string | null;
|
|
13614
13658
|
id: string;
|
|
@@ -13639,6 +13683,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13639
13683
|
foutmelding?: string | null;
|
|
13640
13684
|
gebruiker_id?: string | null;
|
|
13641
13685
|
gebruiker_naam?: string;
|
|
13686
|
+
gebruikte_bron?: string | null;
|
|
13687
|
+
gebruikte_layout_id?: string | null;
|
|
13642
13688
|
gestart_op?: string | null;
|
|
13643
13689
|
herkomst?: string | null;
|
|
13644
13690
|
id?: string;
|
|
@@ -13669,6 +13715,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13669
13715
|
foutmelding?: string | null;
|
|
13670
13716
|
gebruiker_id?: string | null;
|
|
13671
13717
|
gebruiker_naam?: string;
|
|
13718
|
+
gebruikte_bron?: string | null;
|
|
13719
|
+
gebruikte_layout_id?: string | null;
|
|
13672
13720
|
gestart_op?: string | null;
|
|
13673
13721
|
herkomst?: string | null;
|
|
13674
13722
|
id?: string;
|
|
@@ -13802,6 +13850,39 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13802
13850
|
};
|
|
13803
13851
|
Relationships: [];
|
|
13804
13852
|
};
|
|
13853
|
+
print_preview_events: {
|
|
13854
|
+
Row: {
|
|
13855
|
+
code: string | null;
|
|
13856
|
+
created_at: string;
|
|
13857
|
+
detail: import("./types").Json;
|
|
13858
|
+
id: string;
|
|
13859
|
+
queue_item_id: string | null;
|
|
13860
|
+
reden: string | null;
|
|
13861
|
+
station_slug: string | null;
|
|
13862
|
+
uitkomst: string;
|
|
13863
|
+
};
|
|
13864
|
+
Insert: {
|
|
13865
|
+
code?: string | null;
|
|
13866
|
+
created_at?: string;
|
|
13867
|
+
detail?: import("./types").Json;
|
|
13868
|
+
id?: string;
|
|
13869
|
+
queue_item_id?: string | null;
|
|
13870
|
+
reden?: string | null;
|
|
13871
|
+
station_slug?: string | null;
|
|
13872
|
+
uitkomst?: string;
|
|
13873
|
+
};
|
|
13874
|
+
Update: {
|
|
13875
|
+
code?: string | null;
|
|
13876
|
+
created_at?: string;
|
|
13877
|
+
detail?: import("./types").Json;
|
|
13878
|
+
id?: string;
|
|
13879
|
+
queue_item_id?: string | null;
|
|
13880
|
+
reden?: string | null;
|
|
13881
|
+
station_slug?: string | null;
|
|
13882
|
+
uitkomst?: string;
|
|
13883
|
+
};
|
|
13884
|
+
Relationships: [];
|
|
13885
|
+
};
|
|
13805
13886
|
print_queue_runners: {
|
|
13806
13887
|
Row: {
|
|
13807
13888
|
actief: boolean;
|
|
@@ -14029,6 +14110,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14029
14110
|
created_at: string;
|
|
14030
14111
|
driver: string;
|
|
14031
14112
|
extern_printer_id: string | null;
|
|
14113
|
+
formaten_bijgewerkt_op: string | null;
|
|
14032
14114
|
id: string;
|
|
14033
14115
|
ip_adres: string | null;
|
|
14034
14116
|
laatst_gezien: string | null;
|
|
@@ -14036,6 +14118,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14036
14118
|
merk: string;
|
|
14037
14119
|
naam: string;
|
|
14038
14120
|
omschrijving: string;
|
|
14121
|
+
ondersteunde_formaten: import("./types").Json | null;
|
|
14122
|
+
ondersteunde_laden: import("./types").Json | null;
|
|
14039
14123
|
online: boolean;
|
|
14040
14124
|
papierformaat: string;
|
|
14041
14125
|
poort: number | null;
|
|
@@ -14051,6 +14135,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14051
14135
|
created_at?: string;
|
|
14052
14136
|
driver?: string;
|
|
14053
14137
|
extern_printer_id?: string | null;
|
|
14138
|
+
formaten_bijgewerkt_op?: string | null;
|
|
14054
14139
|
id?: string;
|
|
14055
14140
|
ip_adres?: string | null;
|
|
14056
14141
|
laatst_gezien?: string | null;
|
|
@@ -14058,6 +14143,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14058
14143
|
merk?: string;
|
|
14059
14144
|
naam: string;
|
|
14060
14145
|
omschrijving?: string;
|
|
14146
|
+
ondersteunde_formaten?: import("./types").Json | null;
|
|
14147
|
+
ondersteunde_laden?: import("./types").Json | null;
|
|
14061
14148
|
online?: boolean;
|
|
14062
14149
|
papierformaat?: string;
|
|
14063
14150
|
poort?: number | null;
|
|
@@ -14073,6 +14160,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14073
14160
|
created_at?: string;
|
|
14074
14161
|
driver?: string;
|
|
14075
14162
|
extern_printer_id?: string | null;
|
|
14163
|
+
formaten_bijgewerkt_op?: string | null;
|
|
14076
14164
|
id?: string;
|
|
14077
14165
|
ip_adres?: string | null;
|
|
14078
14166
|
laatst_gezien?: string | null;
|
|
@@ -14080,6 +14168,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
14080
14168
|
merk?: string;
|
|
14081
14169
|
naam?: string;
|
|
14082
14170
|
omschrijving?: string;
|
|
14171
|
+
ondersteunde_formaten?: import("./types").Json | null;
|
|
14172
|
+
ondersteunde_laden?: import("./types").Json | null;
|
|
14083
14173
|
online?: boolean;
|
|
14084
14174
|
papierformaat?: string;
|
|
14085
14175
|
poort?: number | null;
|
|
@@ -20329,6 +20419,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
20329
20419
|
foutmelding: string | null;
|
|
20330
20420
|
gebruiker_id: string | null;
|
|
20331
20421
|
gebruiker_naam: string;
|
|
20422
|
+
gebruikte_bron: string | null;
|
|
20423
|
+
gebruikte_layout_id: string | null;
|
|
20332
20424
|
gestart_op: string | null;
|
|
20333
20425
|
herkomst: string | null;
|
|
20334
20426
|
id: string;
|
|
@@ -20450,6 +20542,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
20450
20542
|
foutmelding: string | null;
|
|
20451
20543
|
gebruiker_id: string | null;
|
|
20452
20544
|
gebruiker_naam: string;
|
|
20545
|
+
gebruikte_bron: string | null;
|
|
20546
|
+
gebruikte_layout_id: string | null;
|
|
20453
20547
|
gestart_op: string | null;
|
|
20454
20548
|
herkomst: string | null;
|
|
20455
20549
|
id: string;
|
|
@@ -21506,6 +21600,12 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
21506
21600
|
};
|
|
21507
21601
|
Returns: string;
|
|
21508
21602
|
};
|
|
21603
|
+
logistics_document_type_map: {
|
|
21604
|
+
Args: {
|
|
21605
|
+
_document_code: string;
|
|
21606
|
+
};
|
|
21607
|
+
Returns: Database["public"]["Enums"]["doc_layout_type"][];
|
|
21608
|
+
};
|
|
21509
21609
|
logistics_emit_event: {
|
|
21510
21610
|
Args: {
|
|
21511
21611
|
p_event_type: string;
|
|
@@ -22279,6 +22379,7 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
22279
22379
|
};
|
|
22280
22380
|
pick_enqueue_print_job: {
|
|
22281
22381
|
Args: {
|
|
22382
|
+
_is_herprint?: boolean;
|
|
22282
22383
|
_printer_id?: string;
|
|
22283
22384
|
_queue_item_id: string;
|
|
22284
22385
|
_session_id?: string;
|
|
@@ -22292,6 +22393,13 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
22292
22393
|
};
|
|
22293
22394
|
Returns: import("./types").Json;
|
|
22294
22395
|
};
|
|
22396
|
+
pick_preview_job: {
|
|
22397
|
+
Args: {
|
|
22398
|
+
_queue_item_id: string;
|
|
22399
|
+
_station_slug: string;
|
|
22400
|
+
};
|
|
22401
|
+
Returns: import("./types").Json;
|
|
22402
|
+
};
|
|
22295
22403
|
pick_print_job_status: {
|
|
22296
22404
|
Args: {
|
|
22297
22405
|
_job_id: string;
|
|
@@ -22469,6 +22577,24 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
22469
22577
|
};
|
|
22470
22578
|
Returns: undefined;
|
|
22471
22579
|
};
|
|
22580
|
+
print_preview_toestaan: {
|
|
22581
|
+
Args: {
|
|
22582
|
+
_max?: number;
|
|
22583
|
+
_queue_item_id: string;
|
|
22584
|
+
_station_slug: string;
|
|
22585
|
+
_venster_sec?: number;
|
|
22586
|
+
};
|
|
22587
|
+
Returns: import("./types").Json;
|
|
22588
|
+
};
|
|
22589
|
+
print_preview_weiger: {
|
|
22590
|
+
Args: {
|
|
22591
|
+
_code: string;
|
|
22592
|
+
_queue_item_id: string;
|
|
22593
|
+
_reden: string;
|
|
22594
|
+
_station_slug: string;
|
|
22595
|
+
};
|
|
22596
|
+
Returns: undefined;
|
|
22597
|
+
};
|
|
22472
22598
|
process_logistics_event: {
|
|
22473
22599
|
Args: {
|
|
22474
22600
|
p_event_id: string;
|
|
@@ -22586,6 +22712,14 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
22586
22712
|
};
|
|
22587
22713
|
Returns: undefined;
|
|
22588
22714
|
};
|
|
22715
|
+
replace_order_carts: {
|
|
22716
|
+
Args: {
|
|
22717
|
+
p_buffer_id: string;
|
|
22718
|
+
p_carts: import("./types").Json;
|
|
22719
|
+
p_order_id: string;
|
|
22720
|
+
};
|
|
22721
|
+
Returns: import("./types").Json;
|
|
22722
|
+
};
|
|
22589
22723
|
reset_floriday_sync_cursor: {
|
|
22590
22724
|
Args: {
|
|
22591
22725
|
p_connection_id: string;
|