Allow hiding the printed URL on guest signs
This commit is contained in:
@@ -4,7 +4,7 @@ import { savedSignSchema } from "./sign";
|
||||
test("text sizing survives saved design round trips and rejects invalid scales", () => {
|
||||
const base = { title: "Event", headline: "Share", message: "Welcome", paper: "letter", ink: "indigo" };
|
||||
expect(savedSignSchema.parse(base).headlineScale).toBeUndefined();
|
||||
const sized = { ...base, headlineScale: 150, messageScale: 125, titleScale: 75 };
|
||||
const sized = { ...base, headlineScale: 150, messageScale: 125, titleScale: 75, showUrl: false };
|
||||
expect(savedSignSchema.parse(JSON.parse(JSON.stringify(sized)))).toEqual(sized);
|
||||
for (const key of ["headlineScale", "messageScale", "titleScale"]) {
|
||||
for (const value of [0, 74, 151, Infinity, NaN, "125"]) expect(savedSignSchema.safeParse({ ...base, [key]: value }).success).toBe(false);
|
||||
|
||||
@@ -39,6 +39,7 @@ export const savedSignSchema = z.object({
|
||||
accent: z.string().regex(/^#[a-f0-9]{6}$/i).optional(), font: z.enum(["funnel", "inter", "geologica"]).optional(),
|
||||
decoration: z.enum(["arch", "frame", "minimal"]).optional(), showBrand: z.boolean().optional(),
|
||||
backgroundImage: image, logoImage: image,
|
||||
showUrl: z.boolean().optional(),
|
||||
}).strict().superRefine((design, ctx) => {
|
||||
if (design.paper !== "custom") return;
|
||||
const divisor = design.unit === "mm" ? 25.4 : 1;
|
||||
|
||||
Reference in New Issue
Block a user