@flowselections/scan-module 1.0.60 → 1.0.61
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/ScanModulePage.d.ts.map +1 -1
- package/dist-lib/components/ScanModulePage.js +16 -4
- package/dist-lib/integrations/supabase/types.d.ts +1948 -6
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/printStatus.d.ts +10 -0
- package/dist-lib/lib/printStatus.d.ts.map +1 -0
- package/dist-lib/lib/printStatus.js +18 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScanModulePage.d.ts","sourceRoot":"","sources":["../../src/components/ScanModulePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScanModulePage.d.ts","sourceRoot":"","sources":["../../src/components/ScanModulePage.tsx"],"names":[],"mappings":"AAmeA,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,+BA2H/E"}
|
|
@@ -15,6 +15,7 @@ import { supabase } from "../integrations/supabase/client.js";
|
|
|
15
15
|
import { useScanners } from "../hooks/useScanners.js";
|
|
16
16
|
import { scannerType, normaliseerScannerType } from "../lib/scannerTypes.js";
|
|
17
17
|
import { scannerSoortLabel } from "../lib/labels.js";
|
|
18
|
+
import { kiesPrintStatusTekst } from "../lib/printStatus.js";
|
|
18
19
|
import { KoppelQr } from "./scanners/KoppelQr.js";
|
|
19
20
|
import { TableSkeleton } from "./fs-ui/TableSkeleton.js";
|
|
20
21
|
import { LijstDetail, LijstRij, Toetsje } from "./fs-ui/LijstDetail.js";
|
|
@@ -62,7 +63,14 @@ function tekst(v) {
|
|
|
62
63
|
function isFunctieOnbekend(error) {
|
|
63
64
|
return error?.code === "PGRST202" || error?.code === "42883";
|
|
64
65
|
}
|
|
65
|
-
const LEEG = { laden: true, fout: false, plekId: null, plek: null, klaar: null, reden: null, melding: null, docs: null };
|
|
66
|
+
const LEEG = { laden: true, fout: false, plekId: null, plek: null, klaar: null, reden: null, melding: null, statusTekst: null, docs: null };
|
|
67
|
+
/** Statusregel van het blok Printen: de tekst van de Layout-maker is leidend. */
|
|
68
|
+
function PrintStatusRegel({ stand }) {
|
|
69
|
+
const regel = kiesPrintStatusTekst(stand);
|
|
70
|
+
if (!regel)
|
|
71
|
+
return null;
|
|
72
|
+
return (_jsxs("p", { className: cn("inline-flex items-start gap-1", stand.klaar === false ? "text-warning" : stand.klaar === true ? "text-primary" : "text-muted-foreground"), children: [stand.klaar === false ? (_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true })) : stand.klaar === true ? (_jsx(Check, { className: "h-3.5 w-3.5", "aria-hidden": true })) : null, _jsx("span", { children: regel })] }));
|
|
73
|
+
}
|
|
66
74
|
/** Plek, stand en documenten komen telkens uit de Layout-maker; elke 30 s en bij terugkomen ververst, zonder knipperen. */
|
|
67
75
|
function usePrintStand(scanner) {
|
|
68
76
|
const [stand, setStand] = useState(LEEG);
|
|
@@ -86,10 +94,14 @@ function usePrintStand(scanner) {
|
|
|
86
94
|
}
|
|
87
95
|
const d = basis.data ?? {};
|
|
88
96
|
const plekId = eind ? tekst(d.print_plek_id) : tekst(d.plek_id);
|
|
89
|
-
|
|
97
|
+
// Bij Eindcontrole levert layouts_controleplek sinds Layout-maker 1.69.62 zelf
|
|
98
|
+
// status_tekst en printer_naam; printer_naam is de terugval voor de pleknaam.
|
|
99
|
+
const plekNaam = eind ? (plekId ? (tekst(d.naam) ?? tekst(d.printer_naam)) : null) : tekst(d.plek_naam);
|
|
90
100
|
const melding = eind ? null : tekst(d.melding);
|
|
91
101
|
let klaar = eind ? null : (plekId ? d.status === "werkt" : null);
|
|
92
102
|
let reden = null;
|
|
103
|
+
// status_tekst van de Layout-maker is de status voor de gebruiker.
|
|
104
|
+
let statusTekst = tekst(d.status_tekst);
|
|
93
105
|
let docs = null;
|
|
94
106
|
let naam = plekNaam;
|
|
95
107
|
if (plekId) {
|
|
@@ -123,7 +135,7 @@ function usePrintStand(scanner) {
|
|
|
123
135
|
return;
|
|
124
136
|
if (klaar === false && !reden)
|
|
125
137
|
reden = "Deze plek kan nu niet printen. Kijk bij Printen › Printplekken.";
|
|
126
|
-
setStand({ laden: false, fout: false, plekId, plek: naam, klaar, reden, melding, docs });
|
|
138
|
+
setStand({ laden: false, fout: false, plekId, plek: naam, klaar, reden, melding, statusTekst, docs });
|
|
127
139
|
};
|
|
128
140
|
void lees();
|
|
129
141
|
const timer = window.setInterval(() => { if (document.visibilityState === "visible")
|
|
@@ -244,7 +256,7 @@ function ScannerDetail({ scanner, basis, pincode, onNaamOpslaan, onPincode, onSl
|
|
|
244
256
|
meldFout("Kopiëren lukt niet. Selecteer de link en kopieer hem zelf.", error);
|
|
245
257
|
}
|
|
246
258
|
};
|
|
247
|
-
return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(BewerkbareNaam, { naam: scanner.naam, bewerken: naamBewerken, onKlaar: () => setNaamBewerken(false), onOpslaan: onNaamOpslaan }), _jsx("span", { className: "text-xs text-muted-foreground", children: scannerSoortLabel(scanner.type) })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Meer voor ${scanner.naam}`, children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => window.setTimeout(() => setNaamBewerken(true), 0), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Naam wijzigen"] }), _jsxs(DropdownMenuItem, { onSelect: onPincode, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Pincode wijzigen"] })] })] })] }), _jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Openen" }), basis.staat === "laden" ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Link wordt opgehaald\u2026" })) : url ? (_jsxs("div", { className: "grid gap-4 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center", children: [_jsx(KoppelQr, { link: url, alt: `QR-code om ${scanner.naam} op een telefoon te openen` }), _jsxs("div", { className: "min-w-0 space-y-2", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Scan de QR-code met de telefoon, of open of kopieer de link." }), _jsxs("div", { className: "relative", children: [_jsx(Input, { readOnly: true, value: url, onFocus: (e) => e.currentTarget.select(), "aria-label": "Scannerlink", className: "pr-11 text-sm" }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => void kopieer(), "aria-label": gekopieerd ? "Link gekopieerd" : "Link kopiëren", title: gekopieerd ? "Gekopieerd" : "Link kopiëren", className: "absolute right-0.5 top-1/2 h-8 w-8 -translate-y-1/2", children: gekopieerd ? _jsx(Check, { className: "h-4 w-4" }) : _jsx(Copy, { className: "h-4 w-4" }) })] }), _jsx(Button, { asChild: true, className: "w-full", children: _jsxs("a", { href: url, target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), "Scanner openen"] }) })] })] })) : (_jsx("p", { className: "text-sm text-destructive", children: "De link kan nu niet worden gemaakt. Probeer het later opnieuw; blijft het misgaan, neem contact op met de beheerder." }))] }), _jsxs("section", { className: "space-y-3 border-t border-border pt-4", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Printen" }), _jsxs("div", { className: "flex flex-wrap items-start gap-3 text-sm", children: [_jsx(Printer, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Printen via" }), print.laden ? (_jsx("p", { className: "text-muted-foreground", children: "Laden\u2026" })) : print.fout ? (_jsx("p", { className: "text-warning", children: "De printplek kan nu niet worden gelezen. Probeer het later opnieuw." })) : print.plek ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-semibold text-card-foreground break-words", children: print.plek }),
|
|
259
|
+
return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(BewerkbareNaam, { naam: scanner.naam, bewerken: naamBewerken, onKlaar: () => setNaamBewerken(false), onOpslaan: onNaamOpslaan }), _jsx("span", { className: "text-xs text-muted-foreground", children: scannerSoortLabel(scanner.type) })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Meer voor ${scanner.naam}`, children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => window.setTimeout(() => setNaamBewerken(true), 0), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Naam wijzigen"] }), _jsxs(DropdownMenuItem, { onSelect: onPincode, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Pincode wijzigen"] })] })] })] }), _jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Openen" }), basis.staat === "laden" ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Link wordt opgehaald\u2026" })) : url ? (_jsxs("div", { className: "grid gap-4 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center", children: [_jsx(KoppelQr, { link: url, alt: `QR-code om ${scanner.naam} op een telefoon te openen` }), _jsxs("div", { className: "min-w-0 space-y-2", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Scan de QR-code met de telefoon, of open of kopieer de link." }), _jsxs("div", { className: "relative", children: [_jsx(Input, { readOnly: true, value: url, onFocus: (e) => e.currentTarget.select(), "aria-label": "Scannerlink", className: "pr-11 text-sm" }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => void kopieer(), "aria-label": gekopieerd ? "Link gekopieerd" : "Link kopiëren", title: gekopieerd ? "Gekopieerd" : "Link kopiëren", className: "absolute right-0.5 top-1/2 h-8 w-8 -translate-y-1/2", children: gekopieerd ? _jsx(Check, { className: "h-4 w-4" }) : _jsx(Copy, { className: "h-4 w-4" }) })] }), _jsx(Button, { asChild: true, className: "w-full", children: _jsxs("a", { href: url, target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), "Scanner openen"] }) })] })] })) : (_jsx("p", { className: "text-sm text-destructive", children: "De link kan nu niet worden gemaakt. Probeer het later opnieuw; blijft het misgaan, neem contact op met de beheerder." }))] }), _jsxs("section", { className: "space-y-3 border-t border-border pt-4", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Printen" }), _jsxs("div", { className: "flex flex-wrap items-start gap-3 text-sm", children: [_jsx(Printer, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Printen via" }), print.laden ? (_jsx("p", { className: "text-muted-foreground", children: "Laden\u2026" })) : print.fout ? (_jsx("p", { className: "text-warning", children: "De printplek kan nu niet worden gelezen. Probeer het later opnieuw." })) : print.plek ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-semibold text-card-foreground break-words", children: print.plek }), _jsx(PrintStatusRegel, { stand: print }), print.melding ? _jsx("p", { className: "text-xs text-muted-foreground", children: print.melding }) : null] })) : (_jsxs("p", { className: "inline-flex items-center gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "h-3.5 w-3.5", "aria-hidden": true }), eind ? "Nog geen controleplek gekozen" : "Nog geen printplek gekozen"] }))] }), pad ? (_jsx("a", { href: print.plekId ? `${pad}?plek=${encodeURIComponent(print.plekId)}` : pad, className: "shrink-0 font-semibold text-primary underline-offset-2 hover:underline", children: "Wijzigen" })) : (_jsx("span", { className: "w-full text-muted-foreground sm:w-auto", children: "Wijzig dit in Printen \u203A Printplekken" }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-semibold text-card-foreground", children: "Deze documenten worden hier geprint" }), _jsx("ul", { className: "overflow-hidden rounded-lg border border-border", children: PRINT_RIJEN[eind ? "eind" : "kar"].filter((rij) => !rij.alleenAlsLayoutMaker || (Array.isArray(print.docs) && print.docs.some((d) => d.soort === rij.soort))).map((rij, i) => {
|
|
248
260
|
const doc = print.docs?.find((d) => d.soort === rij.soort) ?? null;
|
|
249
261
|
const extra = doc ? [doc.versie, doc.formaat].filter(Boolean).join(" · ") : "";
|
|
250
262
|
return (_jsxs("li", { className: cn("flex items-start gap-3 px-3 py-2 text-sm", i > 0 && "border-t border-border"), children: [_jsx(FileText, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("p", { className: "break-words", children: [_jsx("span", { className: "text-card-foreground", children: rij.naam }), extra ? _jsxs("span", { className: "text-muted-foreground", children: [" \u00B7 ", extra] }) : null] }), doc && doc.kanPrinten === false ? (_jsxs("p", { className: "inline-flex items-start gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true }), doc.reden ?? "Dit document kan hier nu niet printen."] })) : null] })] }, rij.naam));
|