fix(categories): align taxonomy moderation
This commit is contained in:
+14
-14
@@ -50,7 +50,7 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example all
|
* @example active
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
state?: "active" | "archived" | "trashed" | "all" | null;
|
state?: "active" | "archived" | "trashed" | "all" | null;
|
||||||
@@ -539,7 +539,7 @@ export interface paths {
|
|||||||
*/
|
*/
|
||||||
language_code?: string;
|
language_code?: string;
|
||||||
/**
|
/**
|
||||||
* @example published
|
* @example draft
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
status?: "draft" | "awaiting_publish" | "published";
|
status?: "draft" | "awaiting_publish" | "published";
|
||||||
@@ -4371,7 +4371,7 @@ export interface paths {
|
|||||||
/** @example architecto */
|
/** @example architecto */
|
||||||
status?: string | null;
|
status?: string | null;
|
||||||
/**
|
/**
|
||||||
* @example manual_selection
|
* @example instant_accept
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
dispatch_mode?: "instant_accept" | "quote" | "scheduled_booking" | "manual_selection" | null;
|
dispatch_mode?: "instant_accept" | "quote" | "scheduled_booking" | "manual_selection" | null;
|
||||||
@@ -4685,7 +4685,7 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example taken_by_other
|
* @example ignored
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
status?: "sent" | "delivered" | "viewed" | "accepted" | "rejected" | "ignored" | "expired" | "taken_by_other" | null;
|
status?: "sent" | "delivered" | "viewed" | "accepted" | "rejected" | "ignored" | "expired" | "taken_by_other" | null;
|
||||||
@@ -4879,7 +4879,7 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example consumed
|
* @example created
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
status?: "created" | "confirmed" | "started" | "consumed" | "paid" | "fulfilled" | "canceled" | null;
|
status?: "created" | "confirmed" | "started" | "consumed" | "paid" | "fulfilled" | "canceled" | null;
|
||||||
@@ -5163,13 +5163,13 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example busy
|
* @example offline
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
status?: "offline" | "online" | "inactive" | "busy" | null;
|
status?: "offline" | "online" | "inactive" | "busy" | null;
|
||||||
/** @example true */
|
/** @example false */
|
||||||
is_disabled?: boolean | null;
|
is_disabled?: boolean | null;
|
||||||
/** @example true */
|
/** @example false */
|
||||||
is_verified?: boolean | null;
|
is_verified?: boolean | null;
|
||||||
/**
|
/**
|
||||||
* @description Must be at least 1.
|
* @description Must be at least 1.
|
||||||
@@ -5448,12 +5448,12 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example friends
|
* @example public
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
visibility?: "public" | "friends" | "private" | null;
|
visibility?: "public" | "friends" | "private" | null;
|
||||||
/**
|
/**
|
||||||
* @example visible
|
* @example all
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
status?: "blocked" | "visible" | "all" | null;
|
status?: "blocked" | "visible" | "all" | null;
|
||||||
@@ -5779,7 +5779,7 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example pending
|
* @example blocked
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
status?: "pending" | "blocked" | "all" | null;
|
status?: "pending" | "blocked" | "all" | null;
|
||||||
@@ -7664,7 +7664,7 @@ export interface paths {
|
|||||||
* @example b
|
* @example b
|
||||||
*/
|
*/
|
||||||
q?: string | null;
|
q?: string | null;
|
||||||
/** @example false */
|
/** @example true */
|
||||||
status?: boolean | null;
|
status?: boolean | null;
|
||||||
/** @example true */
|
/** @example true */
|
||||||
is_robot?: boolean | null;
|
is_robot?: boolean | null;
|
||||||
@@ -10107,11 +10107,11 @@ export interface paths {
|
|||||||
content: {
|
content: {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
/**
|
/**
|
||||||
* @example android
|
* @example web
|
||||||
* @enum {string|null}
|
* @enum {string|null}
|
||||||
*/
|
*/
|
||||||
platform?: "ios" | "android" | "web" | "desktop" | null;
|
platform?: "ios" | "android" | "web" | "desktop" | null;
|
||||||
/** @example true */
|
/** @example false */
|
||||||
is_online?: boolean | null;
|
is_online?: boolean | null;
|
||||||
/**
|
/**
|
||||||
* @description Must be at least 1.
|
* @description Must be at least 1.
|
||||||
|
|||||||
+2
-2
@@ -204,8 +204,8 @@ export interface Category {
|
|||||||
sort_order: number
|
sort_order: number
|
||||||
is_active: boolean
|
is_active: boolean
|
||||||
visibility?: string
|
visibility?: string
|
||||||
approval_status?: 'pending' | 'approved' | 'rejected' | string
|
approval_status?: 'pending' | 'approved' | 'rejected' | 'merged'
|
||||||
source?: string
|
source?: 'platform' | 'admin' | 'user'
|
||||||
created_by_uid?: string | null
|
created_by_uid?: string | null
|
||||||
approved_by_uid?: string | null
|
approved_by_uid?: string | null
|
||||||
approved_at?: string | null
|
approved_at?: string | null
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export function CategoryFormDialog({ open, onOpenChange, category, parent }: Cat
|
|||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
mutationFn: (values: FormValues) => {
|
mutationFn: (values: FormValues) => {
|
||||||
const translations: NonNullable<CategoryPayload['translations']> = [
|
const translations: NonNullable<CategoryPayload['translations']> = [
|
||||||
{ locale: 'zh-CN', name: values.name_zh, description: values.description_zh || null },
|
{ locale: 'zh-Hans', name: values.name_zh, description: values.description_zh || null },
|
||||||
]
|
]
|
||||||
if (values.name_en) {
|
if (values.name_en) {
|
||||||
translations.push({
|
translations.push({
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ function TreeNode({
|
|||||||
{!node.is_active && <Badge variant="secondary">未启用</Badge>}
|
{!node.is_active && <Badge variant="secondary">未启用</Badge>}
|
||||||
{node.approval_status === 'pending' && <Badge variant="outline">待审核</Badge>}
|
{node.approval_status === 'pending' && <Badge variant="outline">待审核</Badge>}
|
||||||
<span className="ml-auto hidden items-center gap-1 group-hover:flex">
|
<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="新建子分类">
|
<Button variant="ghost" size="icon-sm" onClick={() => onCreateChild(node)} aria-label="新建子分类">
|
||||||
<Plus className="size-4" />
|
<Plus className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -154,7 +154,15 @@ function MergeDialog({
|
|||||||
enabled: source !== null,
|
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 () => {
|
const submit = async () => {
|
||||||
if (!source || !targetId) return
|
if (!source || !targetId) return
|
||||||
|
|||||||
Reference in New Issue
Block a user