Refactor menu code and add tests.

This commit is contained in:
Dermot Duffy
2024-02-02 18:12:03 -08:00
parent 7ddafa086f
commit 8a6640a512
9 changed files with 2596 additions and 2103 deletions
+2 -2
View File
@@ -326,7 +326,7 @@ const actionsSchema = z.object({
});
const elementsBaseSchema = actionsBaseSchema.extend({
style: z.object({}).passthrough().optional(),
style: z.record(z.string().nullable()).optional(),
title: z.string().nullable().optional(),
});
@@ -1255,7 +1255,7 @@ const hiddenButtonSchema = menuBaseSchema.extend({
priority: menuBaseSchema.shape.priority.default(hiddenButtonDefault.priority),
});
const menuConfigSchema = z
export const menuConfigSchema = z
.object({
style: z.enum(FRIGATE_MENU_STYLES).default(menuConfigDefault.style),
position: z.enum(FRIGATE_MENU_POSITIONS).default(menuConfigDefault.position),