@flowselections/layout-maker 1.59.1 → 1.61.1
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/LivePrintstatusRegel.d.ts.map +1 -1
- package/dist-lib/components/LivePrintstatusRegel.js +29 -29
- package/dist-lib/components/PrintInstallatiesBlok.d.ts +3 -0
- package/dist-lib/components/PrintInstallatiesBlok.d.ts.map +1 -0
- package/dist-lib/components/PrintInstallatiesBlok.js +29 -0
- package/dist-lib/components/PrintQueuePage.d.ts.map +1 -1
- package/dist-lib/components/PrintQueuePage.js +27 -8
- package/dist-lib/components/PrintStatusBanner.d.ts.map +1 -1
- package/dist-lib/components/PrintStatusBanner.js +3 -1
- package/dist-lib/components/PrintenInstellenWizard.d.ts.map +1 -1
- package/dist-lib/components/PrintenInstellenWizard.js +14 -1
- package/dist-lib/components/WerkplekOmzettingStap.d.ts.map +1 -1
- package/dist-lib/components/WerkplekOmzettingStap.js +2 -1
- package/dist-lib/components/WerkplekkenTab.d.ts.map +1 -1
- package/dist-lib/components/WerkplekkenTab.js +27 -3
- package/dist-lib/index.js +3 -3
- package/dist-lib/integrations/supabase/types.d.ts +701 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/etiketControle.d.ts +8 -0
- package/dist-lib/lib/etiketControle.d.ts.map +1 -1
- package/dist-lib/lib/etiketControle.js +7 -2
- package/dist-lib/lib/foutTekst.d.ts +6 -0
- package/dist-lib/lib/foutTekst.d.ts.map +1 -1
- package/dist-lib/lib/foutTekst.js +46 -16
- package/dist-lib/lib/layoutVerwijzingen.js +1 -1
- package/dist-lib/lib/printApi.d.ts +1 -1
- package/dist-lib/lib/printApi.d.ts.map +1 -1
- package/dist-lib/lib/printApi.js +5 -4
- package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
- package/dist-lib/lib/printQueue.server.js +16 -2
- package/dist-lib/lib/printService.functions.d.ts +94 -0
- package/dist-lib/lib/printService.functions.d.ts.map +1 -1
- package/dist-lib/lib/printService.functions.js +52 -2
- package/dist-lib/lib/printnodeStatus.d.ts +1 -0
- package/dist-lib/lib/printnodeStatus.d.ts.map +1 -1
- package/dist-lib/lib/printnodeStatus.js +4 -2
- package/dist-lib/lib/printnodeWebhook.d.ts +12 -0
- package/dist-lib/lib/printnodeWebhook.d.ts.map +1 -1
- package/dist-lib/lib/printnodeWebhook.js +27 -1
- package/dist-lib/lib/printplekken.js +1 -1
- package/dist-lib/lib/queueTick.d.ts.map +1 -1
- package/dist-lib/lib/queueTick.js +9 -0
- package/dist-lib/lib/runnerRegistry.server.d.ts +5 -0
- package/dist-lib/lib/runnerRegistry.server.d.ts.map +1 -1
- package/dist-lib/lib/runnerRegistry.server.js +22 -1
- package/dist-lib/lib/shellPoort.d.ts +21 -0
- package/dist-lib/lib/shellPoort.d.ts.map +1 -0
- package/dist-lib/lib/shellPoort.js +43 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivePrintstatusRegel.d.ts","sourceRoot":"","sources":["../../src/components/LivePrintstatusRegel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LivePrintstatusRegel.d.ts","sourceRoot":"","sources":["../../src/components/LivePrintstatusRegel.tsx"],"names":[],"mappings":"AAeA,wBAAgB,oBAAoB,gCAiFnC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// ============================================================================
|
|
3
|
-
// src/components/LivePrintstatusRegel.tsx — één regel
|
|
4
|
-
//
|
|
3
|
+
// src/components/LivePrintstatusRegel.tsx — één eenvoudige regel over de live
|
|
4
|
+
// printstatus. Cijfers, adres en meldingen staan onder "Details voor beheer".
|
|
5
5
|
// ============================================================================
|
|
6
6
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
8
|
import { useState } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { Button, toast } from "@flowselections/core";
|
|
10
10
|
import { webhookOpnieuwKoppelen, webhookStatus } from "../lib/printService.functions.js";
|
|
11
|
+
import { PrintInstallatiesLijst, PrintStilstandMelding } from "./PrintInstallatiesBlok.js";
|
|
12
|
+
const tijd = (iso) => new Date(iso).toLocaleTimeString("nl-NL", { hour: "2-digit", minute: "2-digit" });
|
|
11
13
|
export function LivePrintstatusRegel() {
|
|
12
14
|
const haal = useServerFn(webhookStatus);
|
|
13
15
|
const koppel = useServerFn(webhookOpnieuwKoppelen);
|
|
@@ -17,31 +19,29 @@ export function LivePrintstatusRegel() {
|
|
|
17
19
|
const s = data && data.ok ? data : null;
|
|
18
20
|
const weergave = s?.weergave ?? "uit";
|
|
19
21
|
const aan = weergave === "aan";
|
|
20
|
-
const pnTelling = s && (s.pnGeslaagd != null || s.pnMislukt != null || s.pnOntvangen != null)
|
|
21
|
-
? `PrintNode: ${s.pnOntvangen ?? "?"} ontvangen, ${s.pnGeslaagd ?? "?"} geslaagd, ${s.pnMislukt ?? "?"} mislukt, ${s.pnWeggegooid ?? "?"} weggegooid${s.pnUrl ? ` naar ${s.pnUrl}` : ""}`
|
|
22
|
-
: null;
|
|
23
22
|
const meldingen = Array.isArray(s?.meldingen) ? s.meldingen : [];
|
|
24
23
|
const adresAfwijkend = !!(s?.pnUrl && s?.url && s.pnUrl !== s.url);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
const hoofdtekst = s?.nietBereikbaar
|
|
25
|
+
? "De live printstatus werkt nu niet; de status wordt elke paar minuten opgehaald."
|
|
26
|
+
: aan
|
|
27
|
+
? s?.laatstOntvangenOp
|
|
28
|
+
? `Printers werken ✓ — laatste bevestiging ${tijd(s.laatstOntvangenOp)}`
|
|
29
|
+
: "Printers werken ✓ — wacht op de eerste bevestiging"
|
|
30
|
+
: weergave === "onbekend"
|
|
31
|
+
? "Wacht op de eerste bevestiging van de printers."
|
|
32
|
+
: "De status wordt elke paar minuten opgehaald.";
|
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsx(PrintStilstandMelding, {}), _jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-3 rounded-md border border-border bg-card px-4 py-3 text-sm", children: [_jsx("span", { className: aan ? "font-medium text-foreground" : "text-muted-foreground", children: hoofdtekst }), _jsx(Button, { size: "sm", variant: "outline", className: "ml-auto", disabled: bezig, onClick: async () => {
|
|
34
|
+
setBezig(true);
|
|
35
|
+
try {
|
|
36
|
+
const r = await koppel();
|
|
37
|
+
if (r.ok)
|
|
38
|
+
toast.success("Live printstatus opnieuw gekoppeld");
|
|
39
|
+
else
|
|
40
|
+
toast.error("Opnieuw koppelen is niet gelukt. Probeer het opnieuw; blijft het, meld het bij kantoor.");
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
setBezig(false);
|
|
44
|
+
qc.invalidateQueries({ queryKey: ["printnode-webhook-status"] });
|
|
45
|
+
}
|
|
46
|
+
}, children: bezig ? "Bezig…" : "Opnieuw koppelen" }), _jsxs("details", { className: "w-full text-xs text-muted-foreground", children: [_jsx("summary", { className: "cursor-pointer", children: "Details voor beheer" }), _jsxs("div", { className: "mt-2 space-y-1", children: [_jsxs("p", { children: ["Live status: ", weergave, s?.fout ? ` · ${s.fout}` : ""] }), s && (s.pnGeslaagd != null || s.pnMislukt != null || s.pnOntvangen != null) ? (_jsxs("p", { children: ["PrintNode-tellers (sinds aanmaken webhook): ", s.pnOntvangen ?? "?", " meldingen ontvangen,", " ", s.pnGeslaagd ?? "?", " aanroepen geslaagd, ", s.pnMislukt ?? "?", " aanroepen mislukt,", " ", s.pnWeggegooid ?? "?", " meldingen weggegooid. Meldingen en aanroepen worden apart geteld (\u00E9\u00E9n aanroep kan meerdere meldingen bevatten, een mislukte aanroep wordt \u00E9\u00E9n keer herhaald)."] })) : null, s?.pnUrl ? _jsxs("p", { children: ["Adres: ", s.pnUrl] }) : null, adresAfwijkend ? _jsx("p", { className: "text-destructive", children: "PrintNode stuurt naar een ander adres dan dit Shell-adres." }) : null, s?.melding ? _jsx("p", { children: s.melding }) : null, meldingen.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "pt-1 font-medium", children: "Laatste meldingen" }), _jsx("ul", { className: "space-y-1", children: meldingen.map((m, i) => (_jsxs("li", { children: [new Date(m.ontvangen_op).toLocaleString("nl-NL"), " \u00B7 ", m.weergave, Array.isArray(m.printnode_ids) && m.printnode_ids.length ? ` · ${m.printnode_ids.join(", ")}` : "", Array.isArray(m.niet_gematcht) && m.niet_gematcht.length ? ` · onbekend: ${m.niet_gematcht.join(", ")}` : ""] }, i))) })] })) : null, _jsx(PrintInstallatiesLijst, {})] })] })] })] }));
|
|
47
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintInstallatiesBlok.d.ts","sourceRoot":"","sources":["../../src/components/PrintInstallatiesBlok.tsx"],"names":[],"mappings":"AAYA,wBAAgB,qBAAqB,uCAepC;AAED,wBAAgB,sBAAsB,uCA6BrC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// src/components/PrintInstallatiesBlok.tsx — stilstandmelding (voor iedereen)
|
|
4
|
+
// en de lijst met printinstallaties (alleen onder "Details voor beheer").
|
|
5
|
+
// ============================================================================
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
8
|
+
import { printInstallaties } from "../lib/printService.functions.js";
|
|
9
|
+
const tijd = (iso) => new Date(iso).toLocaleTimeString("nl-NL", { hour: "2-digit", minute: "2-digit" });
|
|
10
|
+
export function PrintStilstandMelding() {
|
|
11
|
+
const haal = useServerFn(printInstallaties);
|
|
12
|
+
const { data } = useQuery({ queryKey: ["print-installaties"], queryFn: () => haal(), refetchInterval: 60000 });
|
|
13
|
+
if (!data?.ok || !data.stil)
|
|
14
|
+
return null;
|
|
15
|
+
const tekst = data.reden === "geen_shell_adres"
|
|
16
|
+
? "Printen staat stil: er is geen Shell-adres ingesteld. Meld dit bij kantoor."
|
|
17
|
+
: data.reden === "shell_niet_aangemeld"
|
|
18
|
+
? "Printen staat stil: de Shell heeft zich nog niet gemeld. Meld dit bij kantoor."
|
|
19
|
+
: `Printen staat stil: de Shell reageert niet sinds ${data.sinds ? tijd(data.sinds) : "onbekend"}`;
|
|
20
|
+
return (_jsx("div", { className: "mb-4 rounded-md border border-destructive bg-destructive/10 px-4 py-3 text-sm font-medium text-destructive", children: tekst }));
|
|
21
|
+
}
|
|
22
|
+
export function PrintInstallatiesLijst() {
|
|
23
|
+
const haal = useServerFn(printInstallaties);
|
|
24
|
+
const { data } = useQuery({ queryKey: ["print-installaties"], queryFn: () => haal(), refetchInterval: 60000 });
|
|
25
|
+
const lijst = data?.ok && Array.isArray(data.installaties) ? data.installaties : [];
|
|
26
|
+
if (!data?.ok || !data.beheer)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs("div", { className: "pt-2", children: [_jsx("p", { className: "font-medium", children: "Printinstallaties" }), _jsxs("table", { className: "mt-1 w-full text-left", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "pr-2", children: "Adres" }), _jsx("th", { className: "pr-2", children: "Versie" }), _jsx("th", { className: "pr-2", children: "Laatst actief" }), _jsx("th", { className: "pr-2", children: "Rol" }), _jsx("th", { children: "Opdrachten 7 dagen" })] }) }), _jsx("tbody", { children: lijst.map((i, n) => (_jsxs("tr", { children: [_jsx("td", { className: "pr-2", children: i.adres }), _jsx("td", { className: "pr-2", children: i.versie ?? "niet gemeld" }), _jsx("td", { className: "pr-2", children: i.laatstActief ? new Date(i.laatstActief).toLocaleString("nl-NL") : "—" }), _jsx("td", { className: "pr-2", children: i.isShell ? "Shell (print)" : i.actief ? "overgeslagen: niet de Shell" : "uit" }), _jsx("td", { children: i.opdrachten7d })] }, n))) })] })] }));
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintQueuePage.d.ts","sourceRoot":"","sources":["../../src/components/PrintQueuePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrintQueuePage.d.ts","sourceRoot":"","sources":["../../src/components/PrintQueuePage.tsx"],"names":[],"mappings":"AAwFA,wBAAgB,cAAc,gCA6a7B"}
|
|
@@ -6,11 +6,13 @@ import { RotateCcw, Search, XCircle } from "lucide-react";
|
|
|
6
6
|
import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh.js";
|
|
7
7
|
import { PrintStatusBanner } from "./PrintStatusBanner.js";
|
|
8
8
|
import { useLayouts, usePrinters, usePrintJobs, usePrintPlekNamen, } from "../lib/useDocumentData.js";
|
|
9
|
-
import { annuleerPrintOpdrachten, opnieuwPrinten
|
|
9
|
+
import { annuleerPrintOpdrachten, opnieuwPrinten } from "../lib/printService.functions.js";
|
|
10
10
|
import { opnieuwActie, printnodeStatusLabel, SCANBARE_SOORTEN } from "../lib/printnodeStatus.js";
|
|
11
11
|
import { supabase } from "../lib/supabaseClient.js";
|
|
12
12
|
import { vraagWachtrijRonde } from "../lib/queueTickClient.js";
|
|
13
13
|
import { documentTypeLabel } from "../lib/documentTypes.js";
|
|
14
|
+
import { gebruikersTekst } from "../lib/foutTekst.js";
|
|
15
|
+
const isTestprintJob = (j) => j.payload?.["is_testprint"] === true;
|
|
14
16
|
import { jobPlekLabel } from "../lib/printQueue.js";
|
|
15
17
|
const STATUS_VARIANT = {
|
|
16
18
|
wachtend: "outline",
|
|
@@ -22,7 +24,7 @@ const STATUS_VARIANT = {
|
|
|
22
24
|
/** Leesbare naam van de bron waaruit het document is opgemaakt. */
|
|
23
25
|
const BRON_LABEL = {
|
|
24
26
|
extern_pdf: "aangeleverde PDF",
|
|
25
|
-
floriday_1op1: "Floriday-document
|
|
27
|
+
floriday_1op1: "Origineel Floriday-document",
|
|
26
28
|
eigen_layout: "eigen ontwerp",
|
|
27
29
|
render_html: "meegestuurde opmaak",
|
|
28
30
|
klantlayout: "klantlayout",
|
|
@@ -82,7 +84,18 @@ export function PrintQueuePage() {
|
|
|
82
84
|
const [tellingFout, setTellingFout] = useState(null);
|
|
83
85
|
const herlaadTellingen = async () => {
|
|
84
86
|
try {
|
|
85
|
-
|
|
87
|
+
// Alleen aantallen tellen in de database (geen rijen ophalen), parallel.
|
|
88
|
+
const statussen = ["wachtend", "bezig", "voltooid", "mislukt", "geannuleerd"];
|
|
89
|
+
const t = {};
|
|
90
|
+
await Promise.all(statussen.map(async (st) => {
|
|
91
|
+
const { count, error } = await supabase
|
|
92
|
+
.from("print_jobs")
|
|
93
|
+
.select("id", { count: "exact", head: true })
|
|
94
|
+
.eq("status", st);
|
|
95
|
+
if (error)
|
|
96
|
+
throw new Error(`Tellen is niet gelukt (${st})`);
|
|
97
|
+
t[st] = count ?? 0;
|
|
98
|
+
}));
|
|
86
99
|
if (t && typeof t === "object") {
|
|
87
100
|
setTellingen(t);
|
|
88
101
|
setTellingFout(null);
|
|
@@ -92,6 +105,11 @@ export function PrintQueuePage() {
|
|
|
92
105
|
setTellingFout(e instanceof Error ? e.message : "Tellen is niet gelukt");
|
|
93
106
|
}
|
|
94
107
|
};
|
|
108
|
+
// Tellingen direct bij openen (niet wachten op de eerste verversronde).
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
void herlaadTellingen();
|
|
111
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
|
+
}, []);
|
|
95
113
|
const printerById = useMemo(() => new Map(printers.map((p) => [p.id, p])), [printers]);
|
|
96
114
|
// "Gescand": goedgekeurde controlescan van de kar (match op cart_id). Alleen lezen.
|
|
97
115
|
const [gescand, setGescand] = useState(new Map());
|
|
@@ -185,11 +203,12 @@ export function PrintQueuePage() {
|
|
|
185
203
|
setAnnuleertAlles(false);
|
|
186
204
|
await reload(true);
|
|
187
205
|
}
|
|
188
|
-
}, children: [_jsx(XCircle, { className: "mr-2 h-4 w-4" }), annuleertAlles ? "Bezig…" : `Alles annuleren (${openJobs.length})`] })] })] }), _jsx(PrintStatusBanner, { fout: tickFout }), _jsx("div", { className: "grid gap-4 md:grid-cols-4", children: ["wachtend", "bezig", "voltooid", "mislukt"].map((s) => (_jsx(Card, { children: _jsxs(CardHeader, { className: "pb-2", children: [_jsx(CardDescription, { className: "capitalize", children: s }), _jsx(CardTitle, { className: "text-2xl", title: tellingFout ?? undefined, children: tellingFout && !tellingen ? "—" : tellingen ? (tellingen[s] ?? 0) : "laden…" }), tellingFout ? _jsx("p", { className: "text-destructive text-xs", children: tellingFout }) : null] }) }, s))) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Opdrachten" }), _jsx(CardDescription, { children: loading ? "Laden…" : `${gefilterd.length} opdrachten` })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-4", children: [_jsxs("div", { className: "relative md:col-span-2", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek op document of gebruiker", value: zoek, onChange: (e) => setZoek(e.target.value) })] }), _jsxs(Select, { value: status, onValueChange: setStatus, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle statussen" }), ["wachtend", "bezig", "voltooid", "mislukt", "geannuleerd"].map((s) => (_jsx(SelectItem, { value: s, children: s }, s)))] })] }), _jsxs(Select, { value: plekFilter, onValueChange: setPlekFilter, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle printplekken" }), plekOpties.map((p) => (_jsx(SelectItem, { value: p, children: p }, p))), _jsx(SelectItem, { value: "\u2014", children: "Zonder printplek" })] })] })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Document" }), _jsx(TableHead, { children: "Printplek" }), _jsx(TableHead, { children: "
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
206
|
+
}, children: [_jsx(XCircle, { className: "mr-2 h-4 w-4" }), annuleertAlles ? "Bezig…" : `Alles annuleren (${openJobs.length})`] })] })] }), _jsx(PrintStatusBanner, { fout: tickFout }), _jsx("div", { className: "grid gap-4 md:grid-cols-4", children: ["wachtend", "bezig", "voltooid", "mislukt"].map((s) => (_jsx(Card, { children: _jsxs(CardHeader, { className: "pb-2", children: [_jsx(CardDescription, { className: "capitalize", children: s }), _jsx(CardTitle, { className: "text-2xl", title: tellingFout ?? undefined, children: tellingFout && !tellingen ? "—" : tellingen ? (tellingen[s] ?? 0) : "laden…" }), tellingFout ? _jsx("p", { className: "text-destructive text-xs", children: tellingFout }) : null] }) }, s))) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Opdrachten" }), _jsx(CardDescription, { children: loading ? "Laden…" : `${gefilterd.length} opdrachten` })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-4", children: [_jsxs("div", { className: "relative md:col-span-2", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek op document of gebruiker", value: zoek, onChange: (e) => setZoek(e.target.value) })] }), _jsxs(Select, { value: status, onValueChange: setStatus, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle statussen" }), ["wachtend", "bezig", "voltooid", "mislukt", "geannuleerd"].map((s) => (_jsx(SelectItem, { value: s, children: s }, s)))] })] }), _jsxs(Select, { value: plekFilter, onValueChange: setPlekFilter, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle printplekken" }), plekOpties.map((p) => (_jsx(SelectItem, { value: p, children: p }, p))), _jsx(SelectItem, { value: "\u2014", children: "Zonder printplek" })] })] })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Document" }), _jsx(TableHead, { children: "Printplek" }), _jsx(TableHead, { children: "Ontwerp" }), _jsx(TableHead, { children: "Printer" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Tijdstip" }), _jsx(TableHead, { className: "text-right", children: "Acties" })] }) }), _jsxs(TableBody, { children: [gefilterd.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 7, className: "py-10 text-center text-sm text-muted-foreground", children: "Geen printopdrachten." }) })), gefilterd.map((j) => (_jsxs(TableRow, { children: [_jsxs(TableCell, { children: [_jsx("span", { className: "font-medium", children: j.documentnaam ?? documentTypeLabel(j.documenttype) }), j.is_herprint && (_jsx(Badge, { variant: "outline", className: "ml-2", children: "herprint" })), !heeftOrderKenmerk(j) && !isTestprintJob(j) && (_jsx(Badge, { variant: "outline", className: "ml-2 text-amber-600", children: "geen orderkenmerk" })), j.foutmelding && (_jsx("span", { className: "block text-xs text-destructive", title: `Details voor beheer: ${j.foutmelding}`, children: gebruikersTekst(j.foutmelding, documentTypeLabel) ??
|
|
207
|
+
String(j.foutmelding).replace(/^[A-Z_]+:\s*/, "") }))] }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: plekPerJob.get(j.id) || "—" }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: _jsxs("span", { className: "block", title: "Gebruikt ontwerp", children: [_jsx("span", { children: j.gebruikte_layout_id
|
|
208
|
+
? layoutNaam.get(j.gebruikte_layout_id) ?? "Onbekend ontwerp"
|
|
209
|
+
: j.gebruikte_bron
|
|
210
|
+
? "geen eigen ontwerp"
|
|
211
|
+
: "nog niet verwerkt" }), j.gebruikte_bron && (_jsx(Badge, { variant: "outline", className: "ml-2", children: BRON_LABEL[j.gebruikte_bron] ?? j.gebruikte_bron }))] }) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: j.printer_id ? printerNaam.get(j.printer_id) ?? "—" : "—" }), _jsxs(TableCell, { children: [_jsx(Badge, { variant: STATUS_VARIANT[j.status] ?? "outline", children: printnodeStatusLabel(j) }), SCANBARE_SOORTEN.has(j.documenttype) && !j.is_herprint && j.status === "voltooid" &&
|
|
193
212
|
(() => {
|
|
194
213
|
const scan = gescand.get(String(j.payload?.["cart_id"] ?? ""));
|
|
195
214
|
if (scan == null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintStatusBanner.d.ts","sourceRoot":"","sources":["../../src/components/PrintStatusBanner.tsx"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,kBAAuB,EACvB,gBAAuB,GACxB,EAAE;IACD,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,
|
|
1
|
+
{"version":3,"file":"PrintStatusBanner.d.ts","sourceRoot":"","sources":["../../src/components/PrintStatusBanner.tsx"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,kBAAuB,EACvB,gBAAuB,GACxB,EAAE;IACD,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,sCAoCA"}
|
|
@@ -9,7 +9,9 @@ export function PrintStatusBanner({ fout, offlineWerkplekken = [], toonWerkplekL
|
|
|
9
9
|
const sleutelProbleem = !!fout && /toegangsbewijs|401|unauthorized|token|sleutel/i.test(fout);
|
|
10
10
|
if (!fout && offlineWerkplekken.length === 0)
|
|
11
11
|
return null;
|
|
12
|
-
return (_jsxs("div", { className: "border-destructive/30 bg-destructive/5 text-destructive space-y-1 rounded-xl border p-4 text-sm", children: [_jsxs("p", { className: "flex items-center gap-2 font-medium", children: [_jsx(AlertTriangle, { className: "h-4 w-4" }), " Er kan nu niet worden afgedrukt"] }), fout && (
|
|
12
|
+
return (_jsxs("div", { className: "border-destructive/30 bg-destructive/5 text-destructive space-y-1 rounded-xl border p-4 text-sm", children: [_jsxs("p", { className: "flex items-center gap-2 font-medium", children: [_jsx(AlertTriangle, { className: "h-4 w-4" }), " Er kan nu niet worden afgedrukt"] }), fout && (_jsx("p", { children: sleutelProbleem
|
|
13
|
+
? "Er kan nu niet worden geprint: de koppeling met de printdienst is verlopen. Vraag de beheerder dit te herstellen."
|
|
14
|
+
: fout })), offlineWerkplekken.length > 0 && (_jsxs("p", { children: [offlineWerkplekken.length === 1
|
|
13
15
|
? `Werkplek ${offlineWerkplekken[0]} staat uit`
|
|
14
16
|
: `${offlineWerkplekken.length} werkplekken staan uit (${offlineWerkplekken.join(", ")})`, ". Opdrachten blijven wachten tot het printprogramma op die computer draait.", toonWerkplekLink && (_jsxs(_Fragment, { children: [" ", _jsx(Link, { to: "/layouts-printers/printplekken", className: "underline", children: "Naar printplekken" })] }))] }))] }));
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintenInstellenWizard.d.ts","sourceRoot":"","sources":["../../src/components/PrintenInstellenWizard.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,YAAY,EACZ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,+
|
|
1
|
+
{"version":3,"file":"PrintenInstellenWizard.d.ts","sourceRoot":"","sources":["../../src/components/PrintenInstellenWizard.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,YAAY,EACZ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,+BAyKA"}
|
|
@@ -68,7 +68,20 @@ export function PrintenInstellenWizard({ open, onOpenChange, onKlaar, }) {
|
|
|
68
68
|
setStatus((s) => ({ ...s, [printerId]: `mislukt: ${leesbareFout(e, "versturen mislukt")}` }));
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
// Vangnet: ook Escape vanuit een keuzelijst sluit de wizard.
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!open)
|
|
74
|
+
return;
|
|
75
|
+
const toets = (e) => {
|
|
76
|
+
if (e.key === "Escape")
|
|
77
|
+
onOpenChange(false);
|
|
78
|
+
};
|
|
79
|
+
window.addEventListener("keydown", toets);
|
|
80
|
+
return () => window.removeEventListener("keydown", toets);
|
|
81
|
+
}, [open, onOpenChange]);
|
|
82
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "max-h-[85vh] max-w-2xl overflow-y-auto",
|
|
83
|
+
// Escape en klikken naast het venster sluiten zonder op te slaan.
|
|
84
|
+
onEscapeKeyDown: () => onOpenChange(false), onPointerDownOutside: () => onOpenChange(false), children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: stap === 0 ? "Printen instellen — voorstel uit huidige instellingen" : `Printen instellen — stap ${stap} van 4` }), _jsx(DialogDescription, { children: "In een paar minuten weet je zeker waar het papier uitkomt." })] }), stap === 0 && voorstel?.length ? (_jsx(WerkplekOmzettingStap, { voorstel: voorstel, printers: printers, beheerder: beheerder, onOverslaan: () => setStap(1), onKlaar: () => { void reloadPrinters(); onKlaar?.(); setNaam(voorstel[0]?.naam ?? naam); setStap(3); } })) : null, stap === 1 ? (_jsxs("div", { className: "space-y-2 text-sm", children: [_jsx("p", { children: "Op deze computers draait het printprogramma:" }), computers.map((c) => (_jsxs("div", { className: "flex items-center gap-2 rounded border p-2", children: [_jsx("span", { className: "font-medium", children: c.naam }), _jsx(Badge, { variant: c.online ? "secondary" : "destructive", children: c.online ? "online" : "offline" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [c.aantalGevonden, " printers"] })] }, c.id))), !loading && !computers.length ? _jsx("p", { className: "text-muted-foreground", children: "Nog geen computers gevonden. Installeer het printprogramma op de computer met de printers." }) : null, _jsxs(Button, { size: "sm", variant: "outline", onClick: () => { void reload(); void reloadPrinters(); }, children: [loading ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), " Opnieuw zoeken"] })] })) : null, stap === 2 ? (_jsxs("div", { className: "grid gap-2 text-sm sm:grid-cols-[9rem_1fr]", children: [_jsx("span", { children: "Naam werkplek" }), _jsx(Input, { value: naam, onChange: (e) => setNaam(e.target.value) }), _jsx("span", { children: "A4-printer" }), _jsxs("select", { className: selectKlasse, value: a4 ?? "", onChange: (e) => setA4(e.target.value || null), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsxs("option", { value: p.id, children: [printerTitel(p), p.locatie ? ` · ${p.locatie}` : ""] }, p.id))] }), _jsx("span", { children: "Labelprinter" }), _jsxs("select", { className: selectKlasse, value: label ?? "", onChange: (e) => setLabel(e.target.value || null), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsxs("option", { value: p.id, children: [printerTitel(p), p.locatie ? ` · ${p.locatie}` : ""] }, p.id))] }), labelPrinter ? (_jsx("div", { className: "sm:col-span-2", children: _jsx(GeladenEtiketKeuze, { printer: labelPrinter, onGewijzigd: () => void reloadPrinters() }) })) : null] })) : null, stap === 3 ? (_jsx("div", { className: "space-y-2 text-sm", children: [a4 ? { id: a4, soort: "vrij" } : null, label ? { id: label, soort: "sticker" } : null]
|
|
72
85
|
.filter(Boolean)
|
|
73
86
|
.map((r) => {
|
|
74
87
|
const p = printers.find((x) => x.id === r.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WerkplekOmzettingStap.d.ts","sourceRoot":"","sources":["../../src/components/WerkplekOmzettingStap.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WerkplekOmzettingStap.d.ts","sourceRoot":"","sources":["../../src/components/WerkplekOmzettingStap.tsx"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAA+B,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAW9F,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EAAE,KAAK,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,+BA8FA"}
|
|
@@ -6,6 +6,7 @@ import { useState } from "react";
|
|
|
6
6
|
import { Badge, Button, Input, toast } from "@flowselections/core";
|
|
7
7
|
import { documentTypeLabel } from "../lib/documentTypes.js";
|
|
8
8
|
import { leesbareFout } from "../lib/foutTekst.js";
|
|
9
|
+
import { etiketTekst } from "../lib/etiketControle.js";
|
|
9
10
|
import { printerTitel } from "../lib/werkplekken.js";
|
|
10
11
|
import { herbereken, pasOmzettingToe } from "../lib/werkplekOmzetting.js";
|
|
11
12
|
const selectKlasse = "border-input bg-background rounded-md border px-2 py-1 text-sm";
|
|
@@ -26,7 +27,7 @@ export function WerkplekOmzettingStap({ voorstel: begin, printers, beheerder, on
|
|
|
26
27
|
return (_jsxs("div", { className: "space-y-3 text-sm", children: [_jsx("p", { children: "Op basis van de huidige instellingen stelt de module deze werkplekken voor. Controleer per documentsoort de printer van nu en die van na de omzetting. Er wordt pas iets aangemaakt als je bevestigt." }), voorstel.map((w, i) => {
|
|
27
28
|
const etiket = printers.find((p) => p.id === w.label_printer_id)?.geladen_etiket;
|
|
28
29
|
const verschillen = w.soorten.filter((s) => s.verschil).length;
|
|
29
|
-
return (_jsxs("div", { className: "space-y-2 rounded border p-2", "data-werkplek-voorstel": w.print_plek_id ?? "kantoor", children: [_jsxs("div", { className: "grid gap-2 sm:grid-cols-[8rem_1fr]", children: [_jsx("span", { children: "Naam" }), _jsx(Input, { value: w.naam, disabled: w.bestaat || !beheerder, onChange: (e) => wijzig(i, { naam: e.target.value }) }), _jsx("span", { children: "A4-printer" }), _jsxs("select", { className: selectKlasse, disabled: w.bestaat || !beheerder, value: w.a4_printer_id ?? "", onChange: (e) => wijzig(i, { a4_printer_id: e.target.value || null }), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsx("option", { value: p.id, children: printerTitel(p) }, p.id))] }), _jsx("span", { children: "Labelprinter" }), _jsxs("select", { className: selectKlasse, disabled: w.bestaat || !beheerder, value: w.label_printer_id ?? "", onChange: (e) => wijzig(i, { label_printer_id: e.target.value || null }), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsx("option", { value: p.id, children: printerTitel(p) }, p.id))] }), _jsx("span", { children: "Geladen etiket" }), _jsx("span", { className: etiket ? "" : "text-destructive", children: etiket ?
|
|
30
|
+
return (_jsxs("div", { className: "space-y-2 rounded border p-2", "data-werkplek-voorstel": w.print_plek_id ?? "kantoor", children: [_jsxs("div", { className: "grid gap-2 sm:grid-cols-[8rem_1fr]", children: [_jsx("span", { children: "Naam" }), _jsx(Input, { value: w.naam, disabled: w.bestaat || !beheerder, onChange: (e) => wijzig(i, { naam: e.target.value }) }), _jsx("span", { children: "A4-printer" }), _jsxs("select", { className: selectKlasse, disabled: w.bestaat || !beheerder, value: w.a4_printer_id ?? "", onChange: (e) => wijzig(i, { a4_printer_id: e.target.value || null }), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsx("option", { value: p.id, children: printerTitel(p) }, p.id))] }), _jsx("span", { children: "Labelprinter" }), _jsxs("select", { className: selectKlasse, disabled: w.bestaat || !beheerder, value: w.label_printer_id ?? "", onChange: (e) => wijzig(i, { label_printer_id: e.target.value || null }), children: [_jsx("option", { value: "", children: "\u2014 geen \u2014" }), bruikbaar.map((p) => _jsx("option", { value: p.id, children: printerTitel(p) }, p.id))] }), _jsx("span", { children: "Geladen etiket" }), _jsx("span", { className: etiket ? "" : "text-destructive", children: etiket ? etiketTekst(etiket) : "nog niet ingesteld — stel het in bij Werkplekken" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [w.print_plek_id ? _jsx(Badge, { variant: "outline", children: "gekoppeld aan printplek" }) : _jsx(Badge, { variant: "outline", children: "op basis van standaardregels" }), w.bestaat ? _jsx(Badge, { variant: "secondary", children: "bestaat al \u2014 wordt overgeslagen" }) : null, _jsxs(Badge, { variant: verschillen ? "destructive" : "secondary", children: [verschillen, " verschillen"] })] }), _jsxs("table", { className: "w-full text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "text-muted-foreground text-left", children: [_jsx("th", { className: "py-0.5", children: "Documentsoort" }), _jsx("th", { children: "Nu" }), _jsx("th", { children: "Bron nu" }), _jsx("th", { children: "Na omzetting" })] }) }), _jsx("tbody", { children: w.soorten.map((s) => (_jsxs("tr", { className: s.verschil ? "bg-destructive/10 font-medium" : "", "data-verschil": s.verschil ? "ja" : "nee", children: [_jsxs("td", { className: "py-0.5", children: [documentTypeLabel(s.documenttype), s.geen_etiketlayout ? (_jsx("div", { className: "text-destructive", "data-geen-etiketlayout": "ja", children: "Deze soort heeft nog geen etiketlayout (layout staat op A4)" })) : null] }), _jsx("td", { children: titel(s.printer_id) }), _jsx("td", { children: BRON[s.bron ?? "geen"] ?? s.bron }), _jsxs("td", { children: [titel(s.na_printer_id), s.klasse === "label" ? " (label)" : " (A4)"] })] }, s.documenttype))) })] })] }, `${w.print_plek_id ?? "kantoor"}`));
|
|
30
31
|
}), !beheerder ? _jsx("p", { className: "text-muted-foreground", children: "Alleen beheerders kunnen dit wijzigen." }) : null, _jsxs("div", { className: "flex justify-between", children: [_jsx(Button, { variant: "ghost", onClick: onOverslaan, children: "Overslaan, zelf instellen" }), _jsx(Button, { disabled: !beheerder || bezig || !nieuw.length || nieuw.some((w) => !w.naam.trim() || (!w.a4_printer_id && !w.label_printer_id)), onClick: async () => {
|
|
31
32
|
if (!window.confirm(`${nieuw.length} werkplek(ken) aanmaken? De verschillen hierboven gaan dan gelden voor wie deze werkplek kiest.`))
|
|
32
33
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WerkplekkenTab.d.ts","sourceRoot":"","sources":["../../src/components/WerkplekkenTab.tsx"],"names":[],"mappings":"AAcA,OAAO,EAUL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAM5B,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"WerkplekkenTab.d.ts","sourceRoot":"","sources":["../../src/components/WerkplekkenTab.tsx"],"names":[],"mappings":"AAcA,OAAO,EAUL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAM5B,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,+BAyE5G;AAqPD,wBAAgB,cAAc,gCA4E7B"}
|
|
@@ -11,7 +11,7 @@ import { AlertTriangle, Plus, Printer, Trash2, Wand2 } from "lucide-react";
|
|
|
11
11
|
import { supabase } from "../lib/supabaseClient.js";
|
|
12
12
|
import { DOCUMENT_TYPES, documentTypeLabel } from "../lib/documentTypes.js";
|
|
13
13
|
import { leesbareFout } from "../lib/foutTekst.js";
|
|
14
|
-
import { etiketOpties,
|
|
14
|
+
import { etiketOpties, etiketTekst, maatNl } from "../lib/etiketControle.js";
|
|
15
15
|
import { formaatKlasse, printerTitel, slaWerkplekOp, soortPastBijFormaat, usePrinterLijst, useWerkplekken, verwijderWerkplek, zetAfwijking, zetPrinterVelden, } from "../lib/werkplekken.js";
|
|
16
16
|
import { PrintenInstellenWizard } from "./PrintenInstellenWizard.js";
|
|
17
17
|
const selectKlasse = "border-input bg-background rounded-md border px-2 py-1 text-sm";
|
|
@@ -20,7 +20,31 @@ export function GeladenEtiketKeuze({ printer, onGewijzigd }) {
|
|
|
20
20
|
const opties = useMemo(() => etiketOpties(printer.ondersteunde_formaten), [printer.ondersteunde_formaten]);
|
|
21
21
|
// Namen uit PrintNode kunnen spaties aan begin of eind hebben: vergelijk getrimd.
|
|
22
22
|
const huidig = (printer.geladen_etiket?.naam ?? "").trim();
|
|
23
|
-
|
|
23
|
+
const [zoek, setZoek] = useState("");
|
|
24
|
+
// Maten die al in een van de printers zitten (gelezen, niets vast in code).
|
|
25
|
+
const [inGebruik, setInGebruik] = useState(new Set());
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let actief = true;
|
|
28
|
+
void db
|
|
29
|
+
.from("printers")
|
|
30
|
+
.select("geladen_etiket")
|
|
31
|
+
.not("geladen_etiket", "is", null)
|
|
32
|
+
.then(({ data }) => {
|
|
33
|
+
if (!actief)
|
|
34
|
+
return;
|
|
35
|
+
const namen = (Array.isArray(data) ? data : []).map((r) => String(r.geladen_etiket?.naam ?? "").trim()).filter(Boolean);
|
|
36
|
+
setInGebruik(new Set(namen));
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
actief = false;
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
const q = zoek.trim().toLowerCase();
|
|
43
|
+
const gefilterd = opties.filter((o) => !q || `${o.naam} ${maatNl(o.breedte_mm, o.hoogte_mm)}`.toLowerCase().includes(q));
|
|
44
|
+
const voorgesteld = gefilterd.filter((o) => o.naam.trim() === huidig || inGebruik.has(o.naam.trim()));
|
|
45
|
+
const andere = gefilterd.filter((o) => !voorgesteld.includes(o));
|
|
46
|
+
const optie = (o) => (_jsx("option", { value: o.naam.trim(), children: etiketTekst(o) }, o.naam));
|
|
47
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", id: `etiket-${printer.id}`, children: [_jsx("span", { className: "text-muted-foreground", children: "Geladen etiket:" }), opties.length > 8 ? (_jsx(Input, { className: "h-8 w-40", placeholder: "Zoek maat of naam", value: zoek, onChange: (e) => setZoek(e.target.value) })) : null, _jsxs("select", { className: selectKlasse, value: huidig, onChange: async (e) => {
|
|
24
48
|
const keuze = opties.find((o) => o.naam.trim() === e.target.value) ?? null;
|
|
25
49
|
try {
|
|
26
50
|
await zetPrinterVelden(printer.id, { geladen_etiket: keuze });
|
|
@@ -30,7 +54,7 @@ export function GeladenEtiketKeuze({ printer, onGewijzigd }) {
|
|
|
30
54
|
catch (err) {
|
|
31
55
|
toast.error(leesbareFout(err, "Opslaan mislukt"));
|
|
32
56
|
}
|
|
33
|
-
}, children: [_jsx("option", { value: "", children: "\u2014 kies het etiket dat in de printer zit \u2014" }), huidig && !opties.some((o) => o.naam.trim() === huidig) && printer.geladen_etiket ? (
|
|
57
|
+
}, children: [_jsx("option", { value: "", children: "\u2014 kies het etiket dat in de printer zit \u2014" }), huidig && !opties.some((o) => o.naam.trim() === huidig) && printer.geladen_etiket ? (_jsx("option", { value: huidig, children: etiketTekst(printer.geladen_etiket) })) : null, voorgesteld.length ? _jsx("optgroup", { label: "In gebruik", children: voorgesteld.map(optie) }) : null, andere.length ? (voorgesteld.length ? _jsx("optgroup", { label: "Andere maten", children: andere.map(optie) }) : andere.map(optie)) : null] }), !huidig ? (_jsxs("span", { className: "text-destructive flex items-center gap-1 text-xs", children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), " Niet ingesteld: er wordt niets naar deze labelprinter geprint."] })) : null, !opties.length ? _jsx("span", { className: "text-muted-foreground text-xs", children: "De printer meldt nog geen etiketmaten." }) : null] }));
|
|
34
58
|
}
|
|
35
59
|
function PrinterSelect({ printers, value, onChange, leeg = "— geen —", }) {
|
|
36
60
|
return (_jsxs("select", { className: selectKlasse, value: value ?? "", onChange: (e) => onChange(e.target.value || null), children: [_jsx("option", { value: "", children: leeg }), printers.map((p) => (_jsxs("option", { value: p.id, children: [printerTitel(p), p.locatie ? ` · ${p.locatie}` : "", p.online === false ? " (offline)" : ""] }, p.id)))] }));
|
package/dist-lib/index.js
CHANGED
|
@@ -76,10 +76,10 @@ export { ComputerVerwijderenDialog } from './components/ComputerVerwijderenDialo
|
|
|
76
76
|
export { GeenPrinterFout } from './lib/printApi.js';
|
|
77
77
|
export const layoutmodule = {
|
|
78
78
|
id: "layout-maker",
|
|
79
|
-
name: "
|
|
80
|
-
version: "1.
|
|
79
|
+
name: "Printen",
|
|
80
|
+
version: "1.61.0",
|
|
81
81
|
nav: {
|
|
82
|
-
label: "
|
|
82
|
+
label: "Printen",
|
|
83
83
|
href: "/layouts-printers/documenten",
|
|
84
84
|
icon: LayoutTemplate,
|
|
85
85
|
children: [
|