uberf-9485: fix state description save (#9483)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-07-07 19:10:13 +07:00
committed by GitHub
parent 46448e3ae8
commit 118f46e992
2 changed files with 15 additions and 6 deletions
@@ -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
}
}