- TaskDialog: code-input boven titel (font-mono, optional, placeholder "auto"), CodeBadge in dialog header bij edit - EditTaskLoader: select code uit DB voor de dialog - Solo page: vervang inline deriveTaskCode-logica door directe task.code uit DB - Sprint page + TaskList + SprintBoardClient: Task-type krijgt verplicht code-veld; TaskList laat ongebruikte storyCode prop vallen omdat code-derivatie niet meer nodig is Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
48 lines
944 B
TypeScript
48 lines
944 B
TypeScript
import { redirect } from 'next/navigation'
|
|
import { prisma } from '@/lib/prisma'
|
|
import { productAccessFilter } from '@/lib/product-access'
|
|
import { TaskDialog } from './task-dialog'
|
|
|
|
interface EditTaskLoaderProps {
|
|
taskId: string
|
|
userId: string
|
|
productId: string
|
|
closePath: string
|
|
isDemo: boolean
|
|
}
|
|
|
|
export async function EditTaskLoader({
|
|
taskId,
|
|
userId,
|
|
productId,
|
|
closePath,
|
|
isDemo,
|
|
}: EditTaskLoaderProps) {
|
|
const task = await prisma.task.findFirst({
|
|
where: {
|
|
id: taskId,
|
|
story: { product: productAccessFilter(userId) },
|
|
},
|
|
select: {
|
|
id: true,
|
|
code: true,
|
|
title: true,
|
|
description: true,
|
|
implementation_plan: true,
|
|
priority: true,
|
|
status: true,
|
|
created_at: true,
|
|
},
|
|
})
|
|
|
|
if (!task) redirect(closePath)
|
|
|
|
return (
|
|
<TaskDialog
|
|
task={task}
|
|
productId={productId}
|
|
closePath={closePath}
|
|
isDemo={isDemo}
|
|
/>
|
|
)
|
|
}
|