fix(workflow) : couleurs par defaut par categorie + migration de correction du workflow Standard

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-05-21 09:51:27 +02:00
parent 0a5fe300eb
commit caf19c8fd7
2 changed files with 49 additions and 1 deletions

View File

@@ -95,6 +95,7 @@
<script setup lang="ts">
import type { Workflow, StatusCategory } from '~/services/dto/workflow'
import { STATUS_CATEGORY_COLOR } from '~/services/dto/workflow'
import type { TaskStatusWrite } from '~/services/dto/task-status'
import { useWorkflowService } from '~/services/workflows'
import { useTaskStatusService } from '~/services/task-statuses'
@@ -169,10 +170,20 @@ watch(() => props.modelValue, (open) => {
touched.name = false
})
watch(() => form.statuses.map(s => s.category), (cats, prev) => {
if (!prev) return
cats.forEach((cat, i) => {
const s = form.statuses[i]
if (s && cat !== prev[i] && s.color === STATUS_CATEGORY_COLOR[prev[i] as StatusCategory]) {
s.color = STATUS_CATEGORY_COLOR[cat as StatusCategory]
}
})
})
function addStatus() {
form.statuses.push({
label: '',
color: '#222783',
color: STATUS_CATEGORY_COLOR.todo,
position: form.statuses.length,
isFinal: false,
category: 'todo',