diff --git a/client/public/locales/en/common.json b/client/public/locales/en/common.json index 0bceaad..ea1e272 100644 --- a/client/public/locales/en/common.json +++ b/client/public/locales/en/common.json @@ -82,7 +82,7 @@ "title": "QR Code Printing", "textSize": "Content Text Size", "showSpoolmanIcon": "Show Spoolman Icon", - "showContent": "Show QR Code Content" + "showContent": "Print Label" }, "spoolSelect": { "title": "Select Spools", diff --git a/client/src/components/printing/printingDialog.tsx b/client/src/components/printing/printingDialog.tsx index b95ed87..674c884 100644 --- a/client/src/components/printing/printingDialog.tsx +++ b/client/src/components/printing/printingDialog.tsx @@ -160,14 +160,10 @@ const PrintingDialog: React.FC = ({
diff --git a/client/src/components/printing/qrCodePrintingDialog.tsx b/client/src/components/printing/qrCodePrintingDialog.tsx index 9ad30b2..0983a44 100644 --- a/client/src/components/printing/qrCodePrintingDialog.tsx +++ b/client/src/components/printing/qrCodePrintingDialog.tsx @@ -5,7 +5,7 @@ import { useTranslate } from "@refinedev/core"; interface QRCodeData { value: string; - label?: string; + label?: JSX.Element; errorLevel?: "L" | "M" | "Q" | "H"; } @@ -26,7 +26,7 @@ const QRCodePrintingDialog: React.FC = ({ "print-showContent", true ); - const [textSize, setTextSize] = useSavedState("print-textSize", 5); + const [textSize, setTextSize] = useSavedState("print-textSize", 3); const [showSpoolmanIcon, setShowSpoolmanIcon] = useSavedState( "print-showSpoolmanIcon", true @@ -34,7 +34,15 @@ const QRCodePrintingDialog: React.FC = ({ const elements = items.map((item) => { return ( - <> +
= ({ {showContent && (
{item.label ?? item.value}
)} - +
); }); @@ -74,8 +82,8 @@ const QRCodePrintingDialog: React.FC = ({ `${value} mm` }} - min={3} - max={15} + min={2} + max={7} value={textSize} step={0.1} onChange={(value) => { @@ -113,6 +121,7 @@ const QRCodePrintingDialog: React.FC = ({ } .print-page .print-qrcode-title { + width: 100%; font-size: ${textSize}mm; } diff --git a/client/src/components/selectAndPrintDialog.tsx b/client/src/components/selectAndPrintDialog.tsx index 01f11e6..6d84887 100644 --- a/client/src/components/selectAndPrintDialog.tsx +++ b/client/src/components/selectAndPrintDialog.tsx @@ -7,12 +7,26 @@ import { Button } from "antd"; import { ISpool } from "../pages/spools/model"; import { PrinterOutlined } from "@ant-design/icons"; import { useTranslate } from "@refinedev/core"; +import { IFilament } from "../pages/filaments/model"; const SelectAndPrint: React.FC = () => { const t = useTranslate(); const [step, setStep] = React.useState(0); const [selectedSpools, setSelectedSpools] = React.useState([]); + + const formatFilament = (filament: IFilament) => { + let vendorPrefix = ""; + if (filament.vendor) { + vendorPrefix = `${filament.vendor.name} - `; + } + let name = filament.name; + if (!name) { + name = `ID: ${filament.id}`; + } + return `${vendorPrefix}${name}`; + }; + return ( <>