From 118f46e992053e42dc66cd3e864f7bc742d4e803 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Mon, 7 Jul 2025 19:10:13 +0700 Subject: [PATCH] uberf-9485: fix state description save (#9483) Signed-off-by: Alexey Zinoviev --- .../components/state/CreateStatePopup.svelte | 20 +++++++++++++------ plugins/task/src/index.ts | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/task-resources/src/components/state/CreateStatePopup.svelte b/plugins/task-resources/src/components/state/CreateStatePopup.svelte index c03ab24fd8..110091035d 100644 --- a/plugins/task-resources/src/components/state/CreateStatePopup.svelte +++ b/plugins/task-resources/src/components/state/CreateStatePopup.svelte @@ -59,17 +59,24 @@ export let selectableStates: Status[] = [] export let readonly: boolean = true - $: _taskType = $taskTypeStore.get(taskType._id) as TaskType - $: _type = $typeStore.get(type._id) as ProjectType - value = status?.name ?? valuePattern ?? '' const client = getClient() - let description: string | undefined = status?.description + let description: string | undefined + $: _taskType = $taskTypeStore.get(taskType._id) as TaskType + $: _typeId = type._id + $: _type = $typeStore.get(_typeId) as ProjectType + $: projectStatus = _type.statuses.find((s) => s._id === status?._id) + $: finalColor = projectStatus?.color ?? status?.color + $: finalDescription = projectStatus?.description ?? status?.description $: allowEditCategory = status === undefined + $: if (_typeId !== undefined) { + description = finalDescription + } + let total: number = 0 const query = createQuery() @@ -91,8 +98,8 @@ $: needUpdate = (status === undefined || status.name.trim() !== value.trim() || - description !== status?.description || - color !== status.color) && + description !== finalDescription || + color !== finalColor) && value.trim() !== '' && !selectableStates.some((it) => it.name === value) @@ -164,6 +171,7 @@ if (status._id === _id) { status.color = color status.icon = icon as any // Fix me + status.description = description found = true } } diff --git a/plugins/task/src/index.ts b/plugins/task/src/index.ts index a2ec1e99c6..412161345c 100644 --- a/plugins/task/src/index.ts +++ b/plugins/task/src/index.ts @@ -75,6 +75,7 @@ export interface KanbanCard extends Class { export interface ProjectStatus extends IconProps { _id: Ref taskType: Ref + description?: string } /**