fix(categories): align taxonomy moderation
This commit is contained in:
@@ -141,7 +141,7 @@ function TreeNode({
|
||||
{!node.is_active && <Badge variant="secondary">未启用</Badge>}
|
||||
{node.approval_status === 'pending' && <Badge variant="outline">待审核</Badge>}
|
||||
<span className="ml-auto hidden items-center gap-1 group-hover:flex">
|
||||
{canCreate && (
|
||||
{canCreate && node.level < 3 && (
|
||||
<Button variant="ghost" size="icon-sm" onClick={() => onCreateChild(node)} aria-label="新建子分类">
|
||||
<Plus className="size-4" />
|
||||
</Button>
|
||||
|
||||
@@ -154,7 +154,15 @@ function MergeDialog({
|
||||
enabled: source !== null,
|
||||
})
|
||||
|
||||
const options = flattenTree(tree.data?.data ?? []).filter((c) => c.id !== source?.id)
|
||||
const options = flattenTree(tree.data?.data ?? []).filter(
|
||||
(category) =>
|
||||
category.id !== source?.id &&
|
||||
category.level === source?.level &&
|
||||
category.parent_id === source?.parent_id &&
|
||||
category.is_active &&
|
||||
category.visibility === 'public' &&
|
||||
category.approval_status === 'approved',
|
||||
)
|
||||
|
||||
const submit = async () => {
|
||||
if (!source || !targetId) return
|
||||
|
||||
Reference in New Issue
Block a user