@flowselections/layout-maker 1.20.0 → 1.21.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentenPage.d.ts","sourceRoot":"","sources":["../../src/components/DocumentenPage.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,CAAC,EAAE,GAAe,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,+BAUhF"}
1
+ {"version":3,"file":"DocumentenPage.d.ts","sourceRoot":"","sources":["../../src/components/DocumentenPage.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,cAAc,CAAC,EAAE,GAAe,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,+BAchF"}
@@ -3,14 +3,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // src/components/DocumentenPage.tsx — één menu-item "Documenten" met tabbladen
4
4
  // voor de documentontwerpen en de logobibliotheek.
5
5
  // ============================================================================
6
+ import { useState } from "react";
6
7
  import { FileText, Image } from "lucide-react";
7
8
  import { ModuleTabs } from "./ModuleTabs.js";
8
9
  import { LayoutsPage } from "./LayoutsPage.js";
9
10
  import { LogosPage } from "./LogosPage.js";
10
11
  const TABS = [
11
- { label: "Documenten", href: "/layouts-printers", icon: FileText },
12
- { label: "Logo's", href: "/layouts-printers/logos", icon: Image },
12
+ { id: "layouts", label: "Documenten", icon: FileText },
13
+ { id: "logos", label: "Logo's", icon: Image },
13
14
  ];
14
15
  export function DocumentenPage({ tab = "layouts" }) {
15
- return (_jsx(ModuleTabs, { titel: "Documenten", omschrijving: "Ontwerp pakbonnen, facturen, stickers en beheer de logo's die daarop staan.", tabs: TABS, children: tab === "logos" ? _jsx(LogosPage, { ingebed: true }) : _jsx(LayoutsPage, { ingebed: true }) }));
16
+ const [actiefTab, setActiefTab] = useState(tab);
17
+ return (_jsx(ModuleTabs, { titel: "Documenten", omschrijving: "Ontwerp pakbonnen, facturen, stickers en beheer de logo's die daarop staan.", tabs: TABS, actiefTab: actiefTab, onTabWijzig: (nieuwTab) => setActiefTab(nieuwTab === "logos" ? "logos" : "layouts"), children: actiefTab === "logos" ? _jsx(LogosPage, { ingebed: true }) : _jsx(LayoutsPage, { ingebed: true }) }));
16
18
  }
@@ -1,19 +1,19 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { LucideIcon } from "lucide-react";
3
3
  export interface ModuleTab {
4
+ id: string;
4
5
  label: string;
5
- href: string;
6
6
  icon?: LucideIcon;
7
- /** Extra paden die dit tabblad actief maken (bijv. detailpagina's). */
8
- ook?: string[];
9
7
  }
10
8
  interface Props {
11
9
  titel: string;
12
10
  omschrijving?: string;
13
11
  tabs: ModuleTab[];
12
+ actiefTab: string;
13
+ onTabWijzig: (tab: string) => void;
14
14
  acties?: ReactNode;
15
15
  children: ReactNode;
16
16
  }
17
- export declare function ModuleTabs({ titel, omschrijving, tabs, acties, children }: Props): import("react").JSX.Element;
17
+ export declare function ModuleTabs({ titel, omschrijving, tabs, actiefTab, onTabWijzig, acties, children, }: Props): import("react").JSX.Element;
18
18
  export {};
19
19
  //# sourceMappingURL=ModuleTabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleTabs.d.ts","sourceRoot":"","sources":["../../src/components/ModuleTabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK,+BA2ChF"}
1
+ {"version":3,"file":"ModuleTabs.d.ts","sourceRoot":"","sources":["../../src/components/ModuleTabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,GACT,EAAE,KAAK,+BAqCP"}
@@ -1,17 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Link, useRouterState } from "@tanstack/react-router";
3
- export function ModuleTabs({ titel, omschrijving, tabs, acties, children }) {
4
- const pad = useRouterState({ select: (s) => s.location.pathname });
2
+ import { Button } from "@flowselections/core";
3
+ export function ModuleTabs({ titel, omschrijving, tabs, actiefTab, onTabWijzig, acties, children, }) {
5
4
  const veilig = Array.isArray(tabs) ? tabs : [];
6
- const isActief = (t) => {
7
- const paden = [t.href, ...(Array.isArray(t.ook) ? t.ook : [])];
8
- return paden.some((p) => pad === p || pad.startsWith(`${p}/`));
9
- };
10
5
  return (_jsxs("main", { className: "space-y-5 p-6", children: [_jsxs("header", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "truncate text-xl font-semibold", children: titel }), omschrijving && _jsx("p", { className: "text-muted-foreground text-sm", children: omschrijving })] }), acties && _jsx("div", { className: "flex flex-wrap items-center gap-2", children: acties })] }), _jsx("nav", { className: "bg-muted/50 inline-flex flex-wrap gap-1 rounded-lg p-1", children: veilig.map((t) => {
11
- const actief = isActief(t);
6
+ const actief = actiefTab === t.id;
12
7
  const Icon = t.icon;
13
- return (_jsxs(Link, { to: t.href, className: `flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${actief
14
- ? "bg-background text-foreground shadow-sm"
15
- : "text-muted-foreground hover:text-foreground"}`, children: [Icon && _jsx(Icon, { className: "h-4 w-4" }), t.label] }, t.href));
8
+ return (_jsxs(Button, { type: "button", variant: actief ? "secondary" : "ghost", size: "sm", onClick: () => onTabWijzig(t.id), "aria-pressed": actief, className: "gap-2", children: [Icon && _jsx(Icon, { className: "h-4 w-4" }), t.label] }, t.id));
16
9
  }) }), _jsx("div", { children: children })] }));
17
10
  }
@@ -11,5 +11,5 @@ export function PrintStatusBanner({ fout, offlineWerkplekken = [], toonWerkplekL
11
11
  return null;
12
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 && (_jsxs("p", { children: [fout, " ", sleutelProbleem && (_jsxs(_Fragment, { children: ["Controleer de sleutel van de printdienst bij", " ", _jsx(Link, { to: "/instellingen", className: "underline", children: "Instellingen" }), "."] }))] })), offlineWerkplekken.length > 0 && (_jsxs("p", { children: [offlineWerkplekken.length === 1
13
13
  ? `Werkplek ${offlineWerkplekken[0]} staat uit`
14
- : `${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/printers", className: "underline", children: "Naar werkplekken" })] }))] }))] }));
14
+ : `${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
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PrintenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintenPage.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,CAAC,EAC1B,GAAoB,GACrB,EAAE;IACD,GAAG,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;CACpC,+BAUA"}
1
+ {"version":3,"file":"PrintenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintenPage.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,CAAC,EAC1B,GAAoB,GACrB,EAAE;IACD,GAAG,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;CACpC,+BAoBA"}
@@ -3,19 +3,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // src/components/PrintenPage.tsx — één menu-item "Printen" met tabbladen voor
4
4
  // printplekken (plekken, computers en printers samen) en standaardregels.
5
5
  // ============================================================================
6
+ import { useState } from "react";
6
7
  import { MapPin, Route as RouteIcon } from "lucide-react";
7
8
  import { ModuleTabs } from "./ModuleTabs.js";
8
9
  import { PrintplekkenPage } from "./PrintplekkenPage.js";
9
10
  import { DocumentRouteringPage } from "./DocumentRouteringPage.js";
10
11
  const TABS = [
11
12
  {
13
+ id: "printplekken",
12
14
  label: "Printplekken",
13
- href: "/layouts-printers/printplekken",
14
15
  icon: MapPin,
15
- ook: ["/layouts-printers/printers"],
16
16
  },
17
- { label: "Standaardregels", href: "/layouts-printers/routering", icon: RouteIcon },
17
+ { id: "routering", label: "Standaardregels", icon: RouteIcon },
18
18
  ];
19
19
  export function PrintenPage({ tab = "printplekken", }) {
20
- return (_jsx(ModuleTabs, { titel: "Printen", omschrijving: "Stel per plek in het bedrijf in welke computers, printers en documenten daar horen.", tabs: TABS, children: tab === "routering" ? _jsx(DocumentRouteringPage, { ingebed: true }) : _jsx(PrintplekkenPage, { ingebed: true }) }));
20
+ const [actiefTab, setActiefTab] = useState(tab);
21
+ return (_jsx(ModuleTabs, { titel: "Printen", omschrijving: "Stel per plek in het bedrijf in welke computers, printers en documenten daar horen.", tabs: TABS, actiefTab: actiefTab, onTabWijzig: (nieuwTab) => setActiefTab(nieuwTab === "routering" ? "routering" : "printplekken"), children: actiefTab === "routering" ? (_jsx(DocumentRouteringPage, { ingebed: true })) : (_jsx(PrintplekkenPage, { ingebed: true })) }));
21
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PrintplekDetailPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekDetailPage.tsx"],"names":[],"mappings":"AA6CA,wBAAgB,mBAAmB,gCAqVlC"}
1
+ {"version":3,"file":"PrintplekDetailPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekDetailPage.tsx"],"names":[],"mappings":"AA8CA,wBAAgB,mBAAmB,gCAgWlC"}
@@ -15,6 +15,7 @@ import { useComputers } from "./ComputersLijst.js";
15
15
  import { DOCUMENT_TYPES, documentTypeLabel } from "../lib/documentTypes.js";
16
16
  import { drukTestpaginaAf } from "../lib/testpagina.js";
17
17
  import { PrintplekWizard } from "./PrintplekWizard.js";
18
+ import { TestprintDialog } from "./TestprintDialog.js";
18
19
  export function PrintplekDetailPage() {
19
20
  const params = useParams({ strict: false });
20
21
  const plekId = params.printplekId ?? "";
@@ -26,6 +27,7 @@ export function PrintplekDetailPage() {
26
27
  const [naam, setNaam] = useState("");
27
28
  const [alleDocumenten, setAlleDocumenten] = useState(false);
28
29
  const [wizardOpen, setWizardOpen] = useState(false);
30
+ const [testprintOpen, setTestprintOpen] = useState(false);
29
31
  const plek = plekken.find((p) => p.id === plekId) ?? null;
30
32
  const eigenComputers = plekComputers.filter((c) => c.print_plek_id === plekId);
31
33
  const eigenNamen = new Set(eigenComputers.map((c) => c.computer_naam));
@@ -70,14 +72,14 @@ export function PrintplekDetailPage() {
70
72
  }, children: _jsx(Check, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", onClick: () => setNaamBewerken(false), children: _jsx(X, { className: "h-4 w-4" }) })] })) : (_jsx("h1", { className: "cursor-pointer text-xl font-semibold", onClick: () => {
71
73
  setNaam(plek.naam);
72
74
  setNaamBewerken(true);
73
- }, children: plek.naam })), _jsx("p", { className: "text-muted-foreground text-sm", children: plek.omschrijving ?? "Stel hier in wat er op deze plek wordt afgedrukt." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", onClick: () => setWizardOpen(true), children: [_jsx(Wand2, { className: "mr-2 h-4 w-4" }), onvolledig ? "Afmaken met de wizard" : "Instellen met de wizard"] }), _jsxs(Button, { variant: "ghost", className: "text-destructive", onClick: async () => {
75
+ }, children: plek.naam })), _jsx("p", { className: "text-muted-foreground text-sm", children: plek.omschrijving ?? "Stel hier in wat er op deze plek wordt afgedrukt." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", onClick: () => setTestprintOpen(true), children: [_jsx(Printer, { className: "mr-2 h-4 w-4" }), " Testprint controleren"] }), _jsxs(Button, { variant: "outline", onClick: () => setWizardOpen(true), children: [_jsx(Wand2, { className: "mr-2 h-4 w-4" }), onvolledig ? "Afmaken met de wizard" : "Instellen met de wizard"] }), _jsxs(Button, { variant: "ghost", className: "text-destructive", onClick: async () => {
74
76
  await verwijderPrintplek(plek.id);
75
77
  toast.success("Printplek verwijderd");
76
78
  await reload();
77
- }, children: [_jsx(Trash2, { className: "mr-2 h-4 w-4" }), " Verwijderen"] })] })] }), _jsx(PrintplekWizard, { open: wizardOpen, onOpenChange: setWizardOpen, printplekId: plekId, onKlaar: () => void reload() }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Monitor, { className: "h-4 w-4" }), " Computers op deze plek"] }), _jsx(CardDescription, { children: "Computers voeg je toe of haal je weg met de wizard." })] }), _jsx(CardContent, { className: "space-y-3", children: eigenComputers.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: "Nog geen computers gekoppeld." })) : (_jsx("div", { className: "flex flex-wrap gap-2", children: eigenComputers.map((c) => {
79
+ }, children: [_jsx(Trash2, { className: "mr-2 h-4 w-4" }), " Verwijderen"] })] })] }), _jsx(PrintplekWizard, { open: wizardOpen, onOpenChange: setWizardOpen, printplekId: plekId, onKlaar: () => void reload() }), _jsx(TestprintDialog, { open: testprintOpen, onOpenChange: setTestprintOpen, printplekId: plekId, printplekNaam: plek.naam }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Monitor, { className: "h-4 w-4" }), " Computers op deze plek"] }), _jsx(CardDescription, { children: "Computers voeg je toe of haal je weg met de wizard." })] }), _jsx(CardContent, { className: "space-y-3", children: eigenComputers.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: "Nog geen computers gekoppeld." })) : (_jsx("div", { className: "flex flex-wrap gap-2", children: eigenComputers.map((c) => {
78
80
  const aan = computers.find((k) => k.naam === c.computer_naam)?.online ?? false;
79
81
  return (_jsxs("span", { className: "flex items-center gap-2 rounded-full border px-3 py-1 text-sm", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${aan ? "bg-emerald-500" : "bg-muted-foreground"}` }), c.computer_naam] }, c.id));
80
- }) })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Printer, { className: "h-4 w-4" }), " Printers op deze plek"] }), _jsx(CardDescription, { children: "Test een printer om te zien of hij goed staat." })] }), _jsx(CardContent, { children: eigenPrinters.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(AlertTriangle, { className: "text-destructive h-4 w-4" }), "Nog geen ingestelde printers. Voeg ze toe bij", " ", _jsx(Link, { className: "text-primary underline", to: "/layouts-printers/printers", children: "Werkplekken" }), "."] })) : (_jsx("div", { className: "space-y-2", children: eigenPrinters.map((p) => (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border p-2", children: [_jsxs("div", { className: "text-sm", children: [_jsx("span", { className: "font-medium", children: p.naam }), p.papierformaat ? (_jsx(Badge, { variant: "secondary", className: "ml-2", children: p.papierformaat })) : null] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: async () => {
82
+ }) })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Printer, { className: "h-4 w-4" }), " Printers op deze plek"] }), _jsx(CardDescription, { children: "Test een printer om te zien of hij goed staat." })] }), _jsx(CardContent, { children: eigenPrinters.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(AlertTriangle, { className: "text-destructive h-4 w-4" }), "Nog geen ingestelde printers. Voeg ze toe bij", " ", _jsx(Link, { className: "text-primary underline", to: "/layouts-printers/printplekken", children: "Printplekken" }), "."] })) : (_jsx("div", { className: "space-y-2", children: eigenPrinters.map((p) => (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border p-2", children: [_jsxs("div", { className: "text-sm", children: [_jsx("span", { className: "font-medium", children: p.naam }), p.papierformaat ? (_jsx(Badge, { variant: "secondary", className: "ml-2", children: p.papierformaat })) : null] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: async () => {
81
83
  try {
82
84
  await drukTestpaginaAf(p.id, p.naam);
83
85
  toast.success("Testpagina verstuurd");
@@ -1 +1 @@
1
- {"version":3,"file":"PrintplekkenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekkenPage.tsx"],"names":[],"mappings":"AAmCA,wBAAgB,gBAAgB,CAAC,EAAE,OAAe,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,+BAmY/E"}
1
+ {"version":3,"file":"PrintplekkenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekkenPage.tsx"],"names":[],"mappings":"AAoCA,wBAAgB,gBAAgB,CAAC,EAAE,OAAe,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,+BAuZ/E"}
@@ -15,6 +15,7 @@ import { useComputers } from "./ComputersLijst.js";
15
15
  import { ComputersLijst } from "./ComputersLijst.js";
16
16
  import { telPrintersPerComputer } from "../lib/printerTelling.js";
17
17
  import { PrintplekWizard } from "./PrintplekWizard.js";
18
+ import { TestprintDialog } from "./TestprintDialog.js";
18
19
  import { PrintStatusBanner } from "./PrintStatusBanner.js";
19
20
  import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh.js";
20
21
  import { documentTypeLabel } from "../lib/documentTypes.js";
@@ -26,6 +27,7 @@ export function PrintplekkenPage({ ingebed = false } = {}) {
26
27
  const navigate = useNavigate();
27
28
  const [zoekterm, setZoekterm] = useState("");
28
29
  const [wizardOpen, setWizardOpen] = useState(false);
30
+ const [testprint, setTestprint] = useState(null);
29
31
  const [computerToevoegen, setComputerToevoegen] = useState(false);
30
32
  const bijgewerkt = useAutoRefresh(async () => {
31
33
  await Promise.all([reload(true), herlaadComputers(true), herlaadPrinters(true), zoek()]);
@@ -83,7 +85,10 @@ export function PrintplekkenPage({ ingebed = false } = {}) {
83
85
  const naarComputer = (computerId) => {
84
86
  if (!computerId)
85
87
  return;
86
- void navigate({ to: "/layouts-printers/printers/$computerId", params: { computerId } });
88
+ void navigate({
89
+ to: "/layouts-printers/printplekken/computers/$computerId",
90
+ params: { computerId },
91
+ });
87
92
  };
88
93
  const koppel = async (plekId, computerNaam) => {
89
94
  await koppelComputerAanPrintplek(plekId, computerNaam);
@@ -92,14 +97,14 @@ export function PrintplekkenPage({ ingebed = false } = {}) {
92
97
  const Wrapper = ingebed ? "div" : "main";
93
98
  return (_jsxs(Wrapper, { className: ingebed ? "space-y-6" : "space-y-6 p-6", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [!ingebed && (_jsxs("div", { children: [_jsx("h1", { className: "text-xl font-semibold", children: "Printplekken" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "Een printplek is een fysieke plek in het bedrijf, bijvoorbeeld een pickstation. Alle computers en printers op die plek horen bij elkaar." })] })), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", onClick: () => setComputerToevoegen(true), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Computer aanmelden"] }), _jsxs(Button, { onClick: () => setWizardOpen(true), children: [_jsx(Wand2, { className: "mr-2 h-4 w-4" }), " Printplek instellen"] })] })] }), _jsx(PrintStatusBanner, { fout: computersFout, offlineWerkplekken: computers.filter((c) => !c.online).map((c) => c.naam), toonWerkplekLink: false }), fout ? (_jsx("div", { className: "border-destructive/40 bg-destructive/10 text-destructive rounded-xl border p-3 text-sm", children: fout })) : null, _jsxs("div", { className: "flex flex-wrap items-center gap-3 rounded-xl border p-3", children: [_jsxs("div", { className: "relative min-w-[220px] flex-1", children: [_jsx(Search, { className: "text-muted-foreground absolute top-2.5 left-3 h-4 w-4" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek printplek of computer\u2026", value: zoekterm, onChange: (e) => setZoekterm(e.target.value) })] }), _jsxs("span", { className: "text-muted-foreground text-sm", children: [plekken.length, " plek", plekken.length === 1 ? "" : "ken", " \u00B7 ", computers.length, " computer", computers.length === 1 ? "" : "s", " (", computersOnline, " aan) \u00B7 ", totaalPrinters, " printer", totaalPrinters === 1 ? "" : "s"] }), _jsx("span", { className: "text-muted-foreground ml-auto text-xs", children: bijgewerktTekst(bijgewerkt) })] }), kaarten.length === 0 ? (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: plekken.length === 0 ? "Nog geen printplekken" : "Geen resultaten" }), _jsx(CardDescription, { children: plekken.length === 0
94
99
  ? 'Maak er één aan per plek waar geprint wordt, bijvoorbeeld "Pickstation 1".'
95
- : "Geen printplek of computer gevonden met deze zoekterm." })] }), _jsx(CardContent, { className: "flex flex-wrap gap-2", children: _jsxs(Button, { onClick: () => setWizardOpen(true), children: [_jsx(Wand2, { className: "mr-2 h-4 w-4" }), " Printplek instellen"] }) })] })) : (_jsx("div", { className: "grid gap-4 xl:grid-cols-2", children: kaarten.map((k) => (_jsxs("div", { className: "rounded-xl border p-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(MapPin, { className: "text-muted-foreground h-4 w-4" }), _jsx("span", { className: "truncate font-medium", children: k.plek.naam }), _jsx("span", { className: `h-2.5 w-2.5 shrink-0 rounded-full ${k.klaar ? "bg-emerald-500" : "bg-destructive"}`, "aria-label": k.klaar ? "Klaar om te printen" : "Nog niet compleet" })] }), k.plek.omschrijving ? (_jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: k.plek.omschrijving })) : null] }), _jsxs(Link, { to: "/layouts-printers/printplekken/$printplekId", params: { printplekId: k.plek.id }, className: "text-primary flex shrink-0 items-center text-xs", children: ["Instellen ", _jsx(ChevronRight, { className: "ml-1 h-3.5 w-3.5" })] })] }), _jsx("div", { className: "mt-3 space-y-2", children: k.computerLijst.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex flex-wrap items-center gap-2 rounded-lg border border-dashed p-3 text-sm", children: ["Nog geen computer gekoppeld", nietGekoppeld.length > 0 ? (_jsxs(Select, { onValueChange: (naam) => void koppel(k.plek.id, naam), children: [_jsx(SelectTrigger, { className: "h-8 w-[190px]", children: _jsx(SelectValue, { placeholder: "Computer koppelen" }) }), _jsx(SelectContent, { children: nietGekoppeld.map((c) => (_jsx(SelectItem, { value: c.naam, children: c.naam }, c.id))) })] })) : (_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setComputerToevoegen(true), children: "Computer aanmelden" }))] })) : (k.computerLijst.map((c) => (_jsxs("div", { className: "bg-muted/40 flex flex-wrap items-center gap-3 rounded-lg px-3 py-2 text-sm", children: [_jsx(Monitor, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: c.naam }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${c.online ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`, children: c.aangemeld ? (c.online ? "Aan" : "Uit") : "Niet aangemeld" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [c.ingesteld, " printer", c.ingesteld === 1 ? "" : "s", " \u00B7 ", c.gevonden, " gevonden"] }), _jsx(Button, { variant: "ghost", size: "sm", disabled: !c.id, onClick: () => naarComputer(c.id), children: "Printers toevoegen" })] }, c.koppelingId)))) }), _jsxs("div", { className: "text-muted-foreground mt-3 flex items-start gap-2 text-xs", children: [_jsx(Printer, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }), _jsx("span", { children: k.documentRegels.length === 0
100
+ : "Geen printplek of computer gevonden met deze zoekterm." })] }), _jsx(CardContent, { className: "flex flex-wrap gap-2", children: _jsxs(Button, { onClick: () => setWizardOpen(true), children: [_jsx(Wand2, { className: "mr-2 h-4 w-4" }), " Printplek instellen"] }) })] })) : (_jsx("div", { className: "grid gap-4 xl:grid-cols-2", children: kaarten.map((k) => (_jsxs("div", { className: "rounded-xl border p-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(MapPin, { className: "text-muted-foreground h-4 w-4" }), _jsx("span", { className: "truncate font-medium", children: k.plek.naam }), _jsx("span", { className: `h-2.5 w-2.5 shrink-0 rounded-full ${k.klaar ? "bg-emerald-500" : "bg-destructive"}`, "aria-label": k.klaar ? "Klaar om te printen" : "Nog niet compleet" })] }), k.plek.omschrijving ? (_jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: k.plek.omschrijving })) : null] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [_jsxs("button", { type: "button", className: "text-primary flex items-center text-xs", onClick: () => setTestprint({ id: k.plek.id, naam: k.plek.naam }), children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), " Testprint"] }), _jsxs(Link, { to: "/layouts-printers/printplekken/$printplekId", params: { printplekId: k.plek.id }, className: "text-primary flex items-center text-xs", children: ["Instellen ", _jsx(ChevronRight, { className: "ml-1 h-3.5 w-3.5" })] })] })] }), _jsx("div", { className: "mt-3 space-y-2", children: k.computerLijst.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex flex-wrap items-center gap-2 rounded-lg border border-dashed p-3 text-sm", children: ["Nog geen computer gekoppeld", nietGekoppeld.length > 0 ? (_jsxs(Select, { onValueChange: (naam) => void koppel(k.plek.id, naam), children: [_jsx(SelectTrigger, { className: "h-8 w-[190px]", children: _jsx(SelectValue, { placeholder: "Computer koppelen" }) }), _jsx(SelectContent, { children: nietGekoppeld.map((c) => (_jsx(SelectItem, { value: c.naam, children: c.naam }, c.id))) })] })) : (_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setComputerToevoegen(true), children: "Computer aanmelden" }))] })) : (k.computerLijst.map((c) => (_jsxs("div", { className: "bg-muted/40 flex flex-wrap items-center gap-3 rounded-lg px-3 py-2 text-sm", children: [_jsx(Monitor, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: c.naam }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${c.online ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`, children: c.aangemeld ? (c.online ? "Aan" : "Uit") : "Niet aangemeld" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [c.ingesteld, " printer", c.ingesteld === 1 ? "" : "s", " \u00B7 ", c.gevonden, " gevonden"] }), _jsx(Button, { variant: "ghost", size: "sm", disabled: !c.id, onClick: () => naarComputer(c.id), children: "Printers toevoegen" })] }, c.koppelingId)))) }), _jsxs("div", { className: "text-muted-foreground mt-3 flex items-start gap-2 text-xs", children: [_jsx(Printer, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }), _jsx("span", { children: k.documentRegels.length === 0
96
101
  ? "Nog geen document aan een printer gekoppeld"
97
102
  : k.documentRegels
98
103
  .map((r) => `${documentTypeLabel(r.documenttype)} → ${printerNaam.get(r.printer_id ?? "") ?? "onbekende printer"}`)
99
104
  .join(" · ") })] }), k.bronnen.length > 0 ? (_jsx("div", { className: "mt-3 flex flex-wrap gap-1", children: Array.from(new Set(k.bronnen.map((b) => b.bron))).map((bron) => (_jsxs(Badge, { variant: "secondary", children: [k.bronnen.filter((b) => b.bron === bron).length, "\u00D7 ", bron] }, bron))) })) : null] }, k.plek.id))) })), nietGekoppeld.length > 0 ? (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "text-base", children: ["Computers zonder printplek (", nietGekoppeld.length, ")"] }), _jsx(CardDescription, { children: "Deze computers zijn aangemeld maar horen nog nergens bij. Kies hieronder waar ze staan." })] }), _jsx(CardContent, { className: "space-y-2", children: nietGekoppeld.map((c) => {
100
105
  const info = perComputer.get(c.naam);
101
106
  return (_jsxs("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border px-3 py-2 text-sm", children: [_jsx(Monitor, { className: "text-muted-foreground h-4 w-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: c.naam }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${c.online ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`, children: c.online ? "Aan" : "Uit" }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [info?.gevonden ?? c.aantalGevonden, " printers gevonden"] }), plekken.length > 0 ? (_jsxs(Select, { onValueChange: (plekId) => void koppel(plekId, c.naam), children: [_jsx(SelectTrigger, { className: "h-8 w-[170px]", children: _jsx(SelectValue, { placeholder: "Plek kiezen" }) }), _jsx(SelectContent, { children: plekken.map((p) => (_jsx(SelectItem, { value: p.id, children: p.naam }, p.id))) })] })) : (_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setWizardOpen(true), children: "Printplek maken" }))] }, c.id));
102
- }) })] })) : null, !computersLaden && computers.length === 0 && plekken.length === 0 ? (_jsx(Card, { children: _jsxs(CardContent, { className: "space-y-3 py-6 text-sm", children: [_jsx("p", { className: "font-medium", children: "Nog geen computer aangemeld" }), _jsx("p", { className: "text-muted-foreground", children: "Installeer het printprogramma op de computer waar de printers aan hangen. Zodra die zich meldt, verschijnt hij hier." }), _jsxs(Button, { onClick: () => setComputerToevoegen(true), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Computer aanmelden"] })] }) })) : null, _jsx(PrintplekWizard, { open: wizardOpen, onOpenChange: setWizardOpen, onKlaar: () => vernieuwAlles() }), _jsx(ComputersLijst, { computers: computers, loading: false, fout: null, onVernieuw: () => {
107
+ }) })] })) : null, !computersLaden && computers.length === 0 && plekken.length === 0 ? (_jsx(Card, { children: _jsxs(CardContent, { className: "space-y-3 py-6 text-sm", children: [_jsx("p", { className: "font-medium", children: "Nog geen computer aangemeld" }), _jsx("p", { className: "text-muted-foreground", children: "Installeer het printprogramma op de computer waar de printers aan hangen. Zodra die zich meldt, verschijnt hij hier." }), _jsxs(Button, { onClick: () => setComputerToevoegen(true), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Computer aanmelden"] })] }) })) : null, _jsx(PrintplekWizard, { open: wizardOpen, onOpenChange: setWizardOpen, onKlaar: () => vernieuwAlles() }), _jsx(TestprintDialog, { open: testprint !== null, onOpenChange: (v) => !v && setTestprint(null), printplekId: testprint?.id ?? null, printplekNaam: testprint?.naam ?? null }), _jsx(ComputersLijst, { computers: computers, loading: false, fout: null, onVernieuw: () => {
103
108
  void herlaadComputers();
104
109
  void zoek();
105
110
  }, onPrintersToevoegen: (naam) => {
@@ -0,0 +1,8 @@
1
+ export declare function TestprintDialog({ open, onOpenChange, printplekId, printplekNaam, werkplek, }: {
2
+ open: boolean;
3
+ onOpenChange: (v: boolean) => void;
4
+ printplekId?: string | null;
5
+ printplekNaam?: string | null;
6
+ werkplek?: string | null;
7
+ }): import("react").JSX.Element;
8
+ //# sourceMappingURL=TestprintDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestprintDialog.d.ts","sourceRoot":"","sources":["../../src/components/TestprintDialog.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,+BAoKA"}
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // ============================================================================
3
+ // src/components/TestprintDialog.tsx — controleren of elke documentsoort op de
4
+ // juiste printer uitkomt vanaf een printplek of werkplek.
5
+ // ============================================================================
6
+ import { useCallback, useEffect, useRef, useState } from "react";
7
+ import { Badge, Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@flowselections/core";
8
+ import { AlertTriangle, Check, Loader2, Printer, X } from "lucide-react";
9
+ import { volgJobStatus } from "../lib/printApi.js";
10
+ import { bepaalTestOverzicht, verstuurTestprint, } from "../lib/testprint.js";
11
+ const STATUS_LABEL = {
12
+ wachtend: "In de wachtrij",
13
+ bezig: "Wordt afgedrukt",
14
+ voltooid: "Afgedrukt",
15
+ mislukt: "Mislukt",
16
+ geannuleerd: "Geannuleerd",
17
+ };
18
+ export function TestprintDialog({ open, onOpenChange, printplekId, printplekNaam, werkplek, }) {
19
+ const [regels, setRegels] = useState([]);
20
+ const [laden, setLaden] = useState(false);
21
+ const [alles, setAlles] = useState(false);
22
+ const [statussen, setStatussen] = useState({});
23
+ const stoppers = useRef([]);
24
+ const laad = useCallback(async () => {
25
+ setLaden(true);
26
+ try {
27
+ const lijst = await bepaalTestOverzicht({
28
+ printplekId: printplekId ?? null,
29
+ werkplek: werkplek ?? null,
30
+ });
31
+ setRegels(lijst);
32
+ }
33
+ finally {
34
+ setLaden(false);
35
+ }
36
+ }, [printplekId, werkplek]);
37
+ useEffect(() => {
38
+ if (open)
39
+ void laad();
40
+ }, [open, laad]);
41
+ useEffect(() => () => {
42
+ for (const stop of stoppers.current)
43
+ stop();
44
+ stoppers.current = [];
45
+ }, []);
46
+ const test = useCallback(async (documenttype) => {
47
+ setStatussen((s) => ({ ...s, [documenttype]: { bezig: true } }));
48
+ try {
49
+ const { jobId } = await verstuurTestprint(documenttype, {
50
+ printplekId: printplekId ?? null,
51
+ werkplek: werkplek ?? null,
52
+ });
53
+ setStatussen((s) => ({ ...s, [documenttype]: { status: "wachtend" } }));
54
+ const stop = volgJobStatus(jobId, (j) => {
55
+ setStatussen((s) => ({
56
+ ...s,
57
+ [documenttype]: { status: j.status, fout: j.foutmelding },
58
+ }));
59
+ });
60
+ stoppers.current.push(stop);
61
+ }
62
+ catch (e) {
63
+ setStatussen((s) => ({
64
+ ...s,
65
+ [documenttype]: {
66
+ status: "mislukt",
67
+ fout: e instanceof Error ? e.message : "Versturen is niet gelukt.",
68
+ },
69
+ }));
70
+ }
71
+ }, [printplekId, werkplek]);
72
+ const testAlles = async () => {
73
+ setAlles(true);
74
+ try {
75
+ for (const r of regels.filter((x) => x.printerId)) {
76
+ await test(r.documenttype);
77
+ }
78
+ }
79
+ finally {
80
+ setAlles(false);
81
+ }
82
+ };
83
+ const ingesteld = regels.filter((r) => r.printerId);
84
+ const ontbreekt = regels.filter((r) => !r.printerId);
85
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "max-h-[85vh] max-w-2xl overflow-y-auto", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Testprint controleren" }), _jsxs(DialogDescription, { children: ["Elke testprint volgt precies dezelfde weg als een echt document", printplekNaam ? ` vanaf ${printplekNaam}` : werkplek ? ` vanaf ${werkplek}` : "", ". Op het vel staat welke documentsoort, plek en printer bedoeld waren."] })] }), _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("p", { className: "text-muted-foreground text-sm", children: [ingesteld.length, " documentsoort", ingesteld.length === 1 ? "" : "en", " ingesteld", ontbreekt.length ? `, ${ontbreekt.length} zonder printer` : "", "."] }), _jsxs(Button, { size: "sm", disabled: laden || alles || !ingesteld.length, onClick: () => void testAlles(), children: [alles ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Alles testen"] })] }), laden ? (_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 py-8 text-sm", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Instellingen ophalen\u2026"] })) : (_jsx("div", { className: "space-y-2", children: [...ingesteld, ...ontbreekt].map((r) => {
86
+ const st = statussen[r.documenttype];
87
+ return (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border p-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-sm font-medium", children: r.label }), r.printerId ? (_jsxs("div", { className: "text-muted-foreground text-xs", children: ["Gaat naar ", _jsx("span", { className: "font-medium", children: r.printerNaam })] })) : (_jsxs("div", { className: "text-muted-foreground flex items-center gap-1 text-xs", children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), " ", r.reden] })), st?.fout ? (_jsx("div", { className: "text-destructive mt-1 text-xs", children: st.fout })) : null] }), _jsxs("div", { className: "flex items-center gap-2", children: [st?.status ? (_jsxs(Badge, { variant: st.status === "voltooid"
88
+ ? "default"
89
+ : st.status === "mislukt" || st.status === "geannuleerd"
90
+ ? "destructive"
91
+ : "secondary", children: [st.status === "voltooid" ? _jsx(Check, { className: "mr-1 h-3 w-3" }) : null, st.status === "mislukt" ? _jsx(X, { className: "mr-1 h-3 w-3" }) : null, STATUS_LABEL[st.status] ?? st.status] })) : null, _jsxs(Button, { size: "sm", variant: "outline", disabled: !r.printerId || st?.bezig || alles, onClick: () => void test(r.documenttype), children: [st?.bezig ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : null, "Test afdrukken"] })] })] }, r.documenttype));
92
+ }) }))] }) }));
93
+ }
@@ -71,12 +71,12 @@ export function WerkplekConfiguratiePage() {
71
71
  .map((p) => p.extern_printer_id ?? null)
72
72
  .filter((e) => !!e);
73
73
  const bekendeLocaties = Array.from(new Set(printers.map((p) => p.locatie).filter((l) => !!l)));
74
- return (_jsxs("main", { className: "space-y-6 p-6", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-1 text-sm", children: [_jsx(Link, { to: "/layouts-printers/printers", className: "hover:text-foreground", children: "Printers" }), _jsx(ChevronRight, { className: "h-3.5 w-3.5" }), _jsx("span", { className: "text-foreground", children: computer?.naam ?? "Werkplek" })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-xl font-semibold", children: "Werkplek configureren" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "Kies welke printers op deze computer welke ontwerpen afdrukken." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: bijgewerktTekst(bijgewerkt) }), _jsxs(Button, { onClick: () => {
74
+ return (_jsxs("main", { className: "space-y-6 p-6", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-1 text-sm", children: [_jsx(Link, { to: "/layouts-printers/printplekken", className: "hover:text-foreground", children: "Printplekken" }), _jsx(ChevronRight, { className: "h-3.5 w-3.5" }), _jsx("span", { className: "text-foreground", children: computer?.naam ?? "Werkplek" })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-xl font-semibold", children: "Werkplek configureren" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "Kies welke printers op deze computer welke ontwerpen afdrukken." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: bijgewerktTekst(bijgewerkt) }), _jsxs(Button, { onClick: () => {
75
75
  setBewerken(null);
76
76
  setWizard(true);
77
- }, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Printer toevoegen"] })] })] }), _jsxs("div", { className: "grid gap-6 lg:grid-cols-[300px_1fr]", children: [_jsxs(Card, { className: "h-fit", children: [_jsx(CardHeader, { className: "pb-3", children: _jsx(CardTitle, { className: "text-base", children: "Werkplekken" }) }), _jsxs(CardContent, { className: "space-y-2", children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { className: "text-muted-foreground absolute top-2.5 left-3 h-4 w-4" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek werkplek", value: zoekComputer, onChange: (e) => setZoekComputer(e.target.value) })] }), zichtbareComputers.map((c) => (_jsxs(Link, { to: "/layouts-printers/printers/$computerId", params: { computerId: c.id }, className: `flex items-center gap-3 rounded-lg border p-3 text-sm transition ${c.id === computerId ? "border-primary ring-primary/20 ring-2" : "hover:bg-muted/50"}`, children: [_jsx("span", { className: `h-2 w-2 shrink-0 rounded-full ${c.online ? "bg-primary" : "bg-muted-foreground/40"}` }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium", children: c.naam }), _jsx("span", { className: "text-muted-foreground block text-xs", children: printerTellingTekst(tellingen.get(c.naam)) })] }), _jsx(ChevronRight, { className: "text-muted-foreground h-4 w-4" })] }, c.id))), zichtbareComputers.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm", children: "Geen werkplekken gevonden." }))] })] }), _jsxs("div", { className: "space-y-6", children: [_jsx(Card, { children: _jsxs(CardHeader, { className: "pb-3", children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Monitor, { className: "h-4 w-4" }), " ", computer?.naam ?? "Onbekende werkplek"] }), _jsx(CardDescription, { children: computer
77
+ }, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Printer toevoegen"] })] })] }), _jsxs("div", { className: "grid gap-6 lg:grid-cols-[300px_1fr]", children: [_jsxs(Card, { className: "h-fit", children: [_jsx(CardHeader, { className: "pb-3", children: _jsx(CardTitle, { className: "text-base", children: "Werkplekken" }) }), _jsxs(CardContent, { className: "space-y-2", children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { className: "text-muted-foreground absolute top-2.5 left-3 h-4 w-4" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek werkplek", value: zoekComputer, onChange: (e) => setZoekComputer(e.target.value) })] }), zichtbareComputers.map((c) => (_jsxs(Link, { to: "/layouts-printers/printplekken/computers/$computerId", params: { computerId: c.id }, className: `flex items-center gap-3 rounded-lg border p-3 text-sm transition ${c.id === computerId ? "border-primary ring-primary/20 ring-2" : "hover:bg-muted/50"}`, children: [_jsx("span", { className: `h-2 w-2 shrink-0 rounded-full ${c.online ? "bg-primary" : "bg-muted-foreground/40"}` }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium", children: c.naam }), _jsx("span", { className: "text-muted-foreground block text-xs", children: printerTellingTekst(tellingen.get(c.naam)) })] }), _jsx(ChevronRight, { className: "text-muted-foreground h-4 w-4" })] }, c.id))), zichtbareComputers.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm", children: "Geen werkplekken gevonden." }))] })] }), _jsxs("div", { className: "space-y-6", children: [_jsx(Card, { children: _jsxs(CardHeader, { className: "pb-3", children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(Monitor, { className: "h-4 w-4" }), " ", computer?.naam ?? "Onbekende werkplek"] }), _jsx(CardDescription, { children: computer
78
78
  ? `${computer.online ? "Aan" : "Uit"} · ${printerTellingTekst(tellingen.get(computer.naam))}`
79
- : "Deze computer is niet gevonden. Staat hij aan?" })] }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Wat print deze werkplek" }), _jsxs(CardDescription, { children: ["Kies per documentsoort de printer op deze werkplek. Staat er \"Volg routering\", dan geldt de standaardprinter uit", " ", _jsx(Link, { to: "/layouts-printers/routering", className: "text-foreground underline", children: "Routering" }), "."] })] }), _jsxs(CardContent, { className: "grid gap-2 sm:grid-cols-2", children: [DOCUMENT_TYPES.map((d) => {
79
+ : "Deze computer is niet gevonden. Staat hij aan?" })] }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Wat print deze werkplek" }), _jsxs(CardDescription, { children: ["Kies per documentsoort de printer op deze werkplek. Staat er \"Volg routering\", dan geldt de standaardprinter uit", " ", _jsx(Link, { to: "/layouts-printers/printplekken", className: "text-foreground underline", children: "Standaardregels" }), "."] })] }), _jsxs(CardContent, { className: "grid gap-2 sm:grid-cols-2", children: [DOCUMENT_TYPES.map((d) => {
80
80
  const huidig = eigenRoutering.find((r) => r.documenttype === d.value);
81
81
  return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "min-w-0 flex-1 truncate text-sm", children: documentTypeLabel(d.value) }), _jsxs(Select, { value: huidig?.printer_id ?? VOLG_ROUTERING, onValueChange: (v) => void zetDocument(d.value, v === VOLG_ROUTERING ? null : v), children: [_jsx(SelectTrigger, { className: "w-52", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: VOLG_ROUTERING, children: "Volg routering" }), rijen.map(({ printer }) => (_jsx(SelectItem, { value: printer.id, children: printer.naam }, printer.id)))] })] })] }, d.value));
82
82
  }), rijen.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm", children: "Voeg eerst een printer toe op deze werkplek." }))] })] }), _jsxs("div", { className: "grid gap-6 xl:grid-cols-[1fr_340px]", children: [_jsxs("div", { className: "space-y-3", children: [rijen.length === 0 && (_jsx(Card, { children: _jsxs(CardContent, { className: "space-y-4 py-10 text-center", children: [_jsx(Printer, { className: "text-muted-foreground mx-auto h-8 w-8" }), _jsx("p", { className: "text-sm font-medium", children: "Nog geen printers op deze werkplek" }), _jsx(Button, { onClick: () => {
@@ -12,6 +12,6 @@ export function WerkplekkenTabel({ rijen, onPrinterToevoegen, onVernieuw, }) {
12
12
  const deel = r.telling.gevonden
13
13
  ? Math.round((r.telling.ingesteld / r.telling.gevonden) * 100)
14
14
  : 0;
15
- return (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: r.naam }), _jsx(TableCell, { className: "text-muted-foreground", children: r.locatie }), _jsx(TableCell, { children: _jsxs("span", { className: "flex items-center gap-2 text-sm", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${r.online ? "bg-primary" : "bg-muted-foreground/40"}` }), r.online ? "Aan" : "Uit"] }) }), _jsx(TableCell, { children: _jsxs("div", { className: "w-40 space-y-1", children: [_jsx("span", { className: "text-sm", children: printerTellingTekst(r.telling) }), _jsx("div", { className: "bg-muted h-1.5 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-primary h-full", style: { width: `${deel}%` } }) })] }) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/layouts-printers/printers/$computerId", params: { computerId: r.id }, children: "Configureren" }) }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "sm", "aria-label": "Meer", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => onPrinterToevoegen(r.naam), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Printer toevoegen"] }), _jsxs(DropdownMenuItem, { onSelect: () => onVernieuw(), children: [_jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), " Gegevens vernieuwen"] })] })] })] }) })] }, r.id));
15
+ return (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: r.naam }), _jsx(TableCell, { className: "text-muted-foreground", children: r.locatie }), _jsx(TableCell, { children: _jsxs("span", { className: "flex items-center gap-2 text-sm", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${r.online ? "bg-primary" : "bg-muted-foreground/40"}` }), r.online ? "Aan" : "Uit"] }) }), _jsx(TableCell, { children: _jsxs("div", { className: "w-40 space-y-1", children: [_jsx("span", { className: "text-sm", children: printerTellingTekst(r.telling) }), _jsx("div", { className: "bg-muted h-1.5 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-primary h-full", style: { width: `${deel}%` } }) })] }) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/layouts-printers/printplekken/computers/$computerId", params: { computerId: r.id }, children: "Configureren" }) }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "sm", "aria-label": "Meer", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => onPrinterToevoegen(r.naam), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Printer toevoegen"] }), _jsxs(DropdownMenuItem, { onSelect: () => onVernieuw(), children: [_jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), " Gegevens vernieuwen"] })] })] })] }) })] }, r.id));
16
16
  }) })] }) }));
17
17
  }
@@ -5,13 +5,15 @@ export { PrintProgrammaUitleg, WerktHetNiet } from './components/PrintProgrammaU
5
5
  export { PrinterKaart } from './components/PrinterKaart.js';
6
6
  export { ComputersLijst, useComputers } from './components/ComputersLijst.js';
7
7
  export { PrintersPage } from './components/PrintersPage.js';
8
- export { PrintersRedirectPage } from './components/PrintersRedirectPage.js';
9
8
  export { WerkplekConfiguratiePage } from './components/WerkplekConfiguratiePage.js';
10
9
  export { WerkplekkenTabel } from './components/WerkplekkenTabel.js';
11
10
  export { PrinterStatsKaarten } from './components/PrinterStatsKaarten.js';
12
11
  export { useNetwerkPrinters } from './lib/useNetwerkPrinters.js';
13
12
  export type { GevondenPrinter } from './lib/useNetwerkPrinters.js';
14
13
  export { drukTestpaginaAf } from './lib/testpagina.js';
14
+ export { TestprintDialog } from './components/TestprintDialog.js';
15
+ export { bepaalTestOverzicht, verstuurTestprint } from './lib/testprint.js';
16
+ export type { TestprintContext, TestprintRegel, TestprintResultaat } from './lib/testprint.js';
15
17
  export { PrintQueuePage } from './components/PrintQueuePage.js';
16
18
  export { AiLayoutImportDialog } from './components/AiLayoutImportDialog.js';
17
19
  export { LogosPage, LogoThumbnail } from './components/LogosPage.js';
@@ -41,7 +43,6 @@ export type { WerkplekPrinter } from './lib/documentRoutering.js';
41
43
  export { DocumentRouteringPage } from './components/DocumentRouteringPage.js';
42
44
  export { DocumentenPage } from './components/DocumentenPage.js';
43
45
  export { PrintenPage } from './components/PrintenPage.js';
44
- export { LayoutsPrintersTabPage } from './components/LayoutsPrintersTabPage.js';
45
46
  export { ModuleTabs } from './components/ModuleTabs.js';
46
47
  export type { ModuleTab } from './components/ModuleTabs.js';
47
48
  export type { FormaatPrinter } from './lib/formaatPrinters.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,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BAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,UAkB1B,CAAC"}
package/dist-lib/index.js CHANGED
@@ -8,12 +8,13 @@ export { PrintProgrammaUitleg, WerktHetNiet } from './components/PrintProgrammaU
8
8
  export { PrinterKaart } from './components/PrinterKaart.js';
9
9
  export { ComputersLijst, useComputers } from './components/ComputersLijst.js';
10
10
  export { PrintersPage } from './components/PrintersPage.js';
11
- export { PrintersRedirectPage } from './components/PrintersRedirectPage.js';
12
11
  export { WerkplekConfiguratiePage } from './components/WerkplekConfiguratiePage.js';
13
12
  export { WerkplekkenTabel } from './components/WerkplekkenTabel.js';
14
13
  export { PrinterStatsKaarten } from './components/PrinterStatsKaarten.js';
15
14
  export { useNetwerkPrinters } from './lib/useNetwerkPrinters.js';
16
15
  export { drukTestpaginaAf } from './lib/testpagina.js';
16
+ export { TestprintDialog } from './components/TestprintDialog.js';
17
+ export { bepaalTestOverzicht, verstuurTestprint } from './lib/testprint.js';
17
18
  export { PrintQueuePage } from './components/PrintQueuePage.js';
18
19
  export { AiLayoutImportDialog } from './components/AiLayoutImportDialog.js';
19
20
  export { LogosPage, LogoThumbnail } from './components/LogosPage.js';
@@ -36,7 +37,6 @@ export { printerVoorWerkplekDocument, useWerkplekPrinters, verwijderWerkplekPrin
36
37
  export { DocumentRouteringPage } from './components/DocumentRouteringPage.js';
37
38
  export { DocumentenPage } from './components/DocumentenPage.js';
38
39
  export { PrintenPage } from './components/PrintenPage.js';
39
- export { LayoutsPrintersTabPage } from './components/LayoutsPrintersTabPage.js';
40
40
  export { ModuleTabs } from './components/ModuleTabs.js';
41
41
  export { DocumentSettingsPanel } from './components/DocumentSettingsPanel.js';
42
42
  export { DOCUMENT_TYPES, ELEMENT_STANDAARD, FLORIDAY_LAYOUT_TOELICHTING, FLORIDAY_SYSTEEM_LAYOUTS, PAPIERFORMATEN, STANDAARD_KOLOMMEN, STANDAARD_LAYOUTS, STANDAARD_LAYOUT_TOELICHTING, STANDAARD_STIJL, documentTypeLabel, isFloridayLayout } from './lib/documentTypes.js';
@@ -65,7 +65,7 @@ export { GeenPrinterFout } from './lib/printApi.js';
65
65
  export const layoutmodule = {
66
66
  id: "layout-maker",
67
67
  name: "Layouts en printers",
68
- version: "1.19.0",
68
+ version: "1.19.3",
69
69
  nav: {
70
70
  label: "Layouts en printers",
71
71
  href: "/layouts-printers",
@@ -0,0 +1,29 @@
1
+ export interface TestprintContext {
2
+ /** De printplek waarvandaan getest wordt. */
3
+ printplekId?: string | null;
4
+ /** Of de naam van de computer/werkplek. */
5
+ werkplek?: string | null;
6
+ }
7
+ export interface TestprintRegel {
8
+ documenttype: string;
9
+ label: string;
10
+ printerId: string | null;
11
+ printerNaam: string | null;
12
+ /** Uitleg wanneer er geen printer gevonden is. */
13
+ reden: string | null;
14
+ }
15
+ /**
16
+ * Bepaalt voor elke documentsoort welke printer er volgens de instellingen
17
+ * gekozen wordt vanaf deze printplek of werkplek.
18
+ */
19
+ export declare function bepaalTestOverzicht(ctx: TestprintContext): Promise<TestprintRegel[]>;
20
+ export interface TestprintResultaat {
21
+ jobId: string;
22
+ printerId: string;
23
+ }
24
+ /**
25
+ * Verstuurt één testprint via de gewone printwachtrij, zodat exact dezelfde
26
+ * routering en PrintNode-afhandeling worden gebruikt als bij echte documenten.
27
+ */
28
+ export declare function verstuurTestprint(documenttype: string, ctx: TestprintContext): Promise<TestprintResultaat>;
29
+ //# sourceMappingURL=testprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testprint.d.ts","sourceRoot":"","sources":["../../src/lib/testprint.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA4B1F;AAiBD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAyC7B"}
@@ -0,0 +1,89 @@
1
+ // ============================================================================
2
+ // src/lib/testprint.ts — controleren of élk document op de juiste printer
3
+ // uitkomt. Anders dan de gewone testpagina volgt een testprint de volledige
4
+ // beslisketen: printplek → werkplek → layout → papierformaat → PrintNode.
5
+ // ============================================================================
6
+ import { supabase } from "./supabaseClient.js";
7
+ import { DOCUMENT_TYPES, documentTypeLabel } from "./documentTypes.js";
8
+ import { printHtml, printerVoorDocumenttype } from "./printApi.js";
9
+ import { printplekNaam } from "./printplekken.js";
10
+ const arr = (v) => (Array.isArray(v) ? v : []);
11
+ /**
12
+ * Bepaalt voor elke documentsoort welke printer er volgens de instellingen
13
+ * gekozen wordt vanaf deze printplek of werkplek.
14
+ */
15
+ export async function bepaalTestOverzicht(ctx) {
16
+ const printplekId = ctx.printplekId ?? undefined;
17
+ const werkplek = ctx.werkplek ?? undefined;
18
+ const { data } = await supabase.from("printers").select("id, naam").order("naam");
19
+ const namen = new Map(arr(data).map((p) => [p.id, p.naam]));
20
+ const regels = await Promise.all(DOCUMENT_TYPES.map(async (d) => {
21
+ let printerId = null;
22
+ try {
23
+ printerId = await printerVoorDocumenttype(d.value, undefined, werkplek, printplekId);
24
+ }
25
+ catch {
26
+ printerId = null;
27
+ }
28
+ return {
29
+ documenttype: d.value,
30
+ label: d.label,
31
+ printerId,
32
+ printerNaam: printerId ? (namen.get(printerId) ?? "Printer") : null,
33
+ reden: printerId
34
+ ? null
35
+ : "Nog geen printer ingesteld voor deze documentsoort op deze plek.",
36
+ };
37
+ }));
38
+ return regels;
39
+ }
40
+ /** De HTML van de testpagina: op papier zichtbaar waar hij vandaan komt. */
41
+ function testHtml(velden) {
42
+ const rijen = Object.entries(velden)
43
+ .map(([k, v]) => `<tr><td style="padding:2mm 6mm 2mm 0;color:#555">${k}</td><td style="padding:2mm 0;font-weight:600">${v}</td></tr>`)
44
+ .join("");
45
+ return `<div style="padding:15mm;font-family:Arial,Helvetica,sans-serif;font-size:12pt">
46
+ <h1 style="font-size:20pt;margin:0 0 6mm">Testprint</h1>
47
+ <p style="margin:0 0 6mm">Komt dit vel uit de bedoelde printer op de bedoelde plek? Dan zijn de instellingen goed.</p>
48
+ <table style="border-collapse:collapse;font-size:12pt">${rijen}</table>
49
+ </div>`;
50
+ }
51
+ /**
52
+ * Verstuurt één testprint via de gewone printwachtrij, zodat exact dezelfde
53
+ * routering en PrintNode-afhandeling worden gebruikt als bij echte documenten.
54
+ */
55
+ export async function verstuurTestprint(documenttype, ctx) {
56
+ const printplekId = ctx.printplekId ?? undefined;
57
+ const werkplek = ctx.werkplek ?? undefined;
58
+ const plekNaam = printplekId ? await printplekNaam(printplekId) : null;
59
+ const printerId = await printerVoorDocumenttype(documenttype, undefined, werkplek, printplekId);
60
+ if (!printerId) {
61
+ throw new Error(plekNaam
62
+ ? `Geen printer voor ${documentTypeLabel(documenttype)} op ${plekNaam} — stel dit in bij deze printplek.`
63
+ : `Geen printer voor ${documentTypeLabel(documenttype)} — stel dit in bij Printen.`);
64
+ }
65
+ const { data } = await supabase
66
+ .from("printers")
67
+ .select("naam")
68
+ .eq("id", printerId)
69
+ .maybeSingle();
70
+ const printerNaam = data?.naam ?? "Printer";
71
+ const testId = `test-${documenttype}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
72
+ const html = testHtml({
73
+ Documentsoort: documentTypeLabel(documenttype),
74
+ Printplek: plekNaam ?? "—",
75
+ Werkplek: werkplek ?? "—",
76
+ Printer: printerNaam,
77
+ Tijdstip: new Date().toLocaleString("nl-NL"),
78
+ });
79
+ const { jobId } = await printHtml({
80
+ documenttype,
81
+ documentnaam: `Testprint ${documentTypeLabel(documenttype)}`,
82
+ html,
83
+ printerId,
84
+ ...(printplekId ? { printplekId } : {}),
85
+ ...(werkplek ? { werkplek } : {}),
86
+ payload: { test_id: testId, is_testprint: true },
87
+ });
88
+ return { jobId, printerId };
89
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/layout-maker",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "flowselections": {
5
5
  "moduleId": "layout-maker",
6
6
  "pages": [
@@ -9,14 +9,9 @@
9
9
  "route": "layouts-printers",
10
10
  "title": "Documenten"
11
11
  },
12
- {
13
- "export": "LayoutsPrintersTabPage",
14
- "route": "layouts-printers/$tab",
15
- "title": "Layouts en printers"
16
- },
17
12
  {
18
13
  "export": "WerkplekConfiguratiePage",
19
- "route": "layouts-printers/printers/$computerId",
14
+ "route": "layouts-printers/printplekken/computers/$computerId",
20
15
  "title": "Werkplek configureren"
21
16
  },
22
17
  {
@@ -1,2 +0,0 @@
1
- export declare function LayoutsPrintersTabPage(): import("react").JSX.Element;
2
- //# sourceMappingURL=LayoutsPrintersTabPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LayoutsPrintersTabPage.d.ts","sourceRoot":"","sources":["../../src/components/LayoutsPrintersTabPage.tsx"],"names":[],"mappings":"AAeA,wBAAgB,sBAAsB,gCAmBrC"}
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // ============================================================================
3
- // src/components/LayoutsPrintersTabPage.tsx — één pagina die de tabblad-URL's
4
- // van de module bedient (/layouts-printers/logos, /routering, /printers).
5
- // ============================================================================
6
- import { useEffect } from "react";
7
- import { useNavigate, useRouterState } from "@tanstack/react-router";
8
- import { DocumentenPage } from "./DocumentenPage.js";
9
- import { PrintenPage } from "./PrintenPage.js";
10
- function huidigTab(pathname) {
11
- const delen = pathname.split("/").filter(Boolean);
12
- return delen[delen.length - 1] ?? "";
13
- }
14
- export function LayoutsPrintersTabPage() {
15
- const navigate = useNavigate();
16
- const pathname = useRouterState({ select: (s) => s.location.pathname });
17
- const tab = huidigTab(pathname);
18
- const stuurDoor = tab === "printers"
19
- ? "/layouts-printers/printplekken"
20
- : tab === "logos" || tab === "routering"
21
- ? null
22
- : "/layouts-printers";
23
- useEffect(() => {
24
- if (stuurDoor)
25
- void navigate({ to: stuurDoor, replace: true });
26
- }, [stuurDoor, navigate]);
27
- if (tab === "logos")
28
- return _jsx(DocumentenPage, { tab: "logos" });
29
- if (tab === "routering")
30
- return _jsx(PrintenPage, { tab: "routering" });
31
- return _jsx("p", { className: "text-muted-foreground p-6 text-sm", children: "Doorsturen\u2026" });
32
- }