Add isParent boolean to tags

This commit is contained in:
2025-12-21 21:57:16 +01:00
parent d1adb07f40
commit 48114f391a
10 changed files with 46 additions and 8 deletions

View File

@ -22,11 +22,7 @@ const artworkItems = [
{
title: "Tags",
href: "/tags",
},
{
title: "Animals",
href: "/animals",
},
}
]
// const portfolioItems = [

View File

@ -25,6 +25,7 @@ export default function EditTagForm({ tag, categories, allTags }: { tag: ArtTag
description: tag.description || "",
categoryIds: tag.categories?.map(cat => cat.id) ?? [],
parentId: (tag as any).parentId ?? null,
isParent: tag.isParent ?? false,
showOnAnimalPage: tag.showOnAnimalPage ?? false,
aliases: tag.aliases?.map(a => a.alias) ?? []
}
@ -149,6 +150,23 @@ export default function EditTagForm({ tag, categories, allTags }: { tag: ArtTag
</FormItem>
)}
/>
<div className="flex">
<FormField
control={form.control}
name="isParent"
render={({ field }) => (
<FormItem className="flex items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Is parent tag</FormLabel>
<FormDescription></FormDescription>
</div>
<FormControl>
<Switch checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
</FormItem>
)}
/>
</div>
<div className="flex">
<FormField
control={form.control}

View File

@ -26,6 +26,7 @@ export default function NewTagForm({ categories, allTags }: { categories: ArtCat
description: "",
categoryIds: [],
parentId: null,
isParent: false,
showOnAnimalPage: false,
aliases: [],
}
@ -150,6 +151,23 @@ export default function NewTagForm({ categories, allTags }: { categories: ArtCat
</FormItem>
)}
/>
<div className="flex">
<FormField
control={form.control}
name="isParent"
render={({ field }) => (
<FormItem className="flex items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Is parent tag</FormLabel>
<FormDescription></FormDescription>
</div>
<FormControl>
<Switch checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
</FormItem>
)}
/>
</div>
<div className="flex">
<FormField
control={form.control}