Add isParent boolean to tags
This commit is contained in:
@ -22,11 +22,7 @@ const artworkItems = [
|
||||
{
|
||||
title: "Tags",
|
||||
href: "/tags",
|
||||
},
|
||||
{
|
||||
title: "Animals",
|
||||
href: "/animals",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
// const portfolioItems = [
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -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}
|
||||
|
||||
Reference in New Issue
Block a user