From 66063f035af45b0dff643f06ffbace5bda2ab9b7 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Sun, 26 Apr 2026 20:36:47 +0200 Subject: [PATCH] feat(ST-507): add code input to Product, Pbi and Story forms Co-Authored-By: Claude Opus 4.7 (1M context) --- app/(app)/products/[id]/settings/page.tsx | 1 + components/backlog/pbi-dialog.tsx | 36 +++++++++++----- components/backlog/story-dialog.tsx | 44 ++++++++++++++------ components/products/product-form.tsx | 50 ++++++++++++++++------- 4 files changed, 93 insertions(+), 38 deletions(-) diff --git a/app/(app)/products/[id]/settings/page.tsx b/app/(app)/products/[id]/settings/page.tsx index 8150163..1ab3593 100644 --- a/app/(app)/products/[id]/settings/page.tsx +++ b/app/(app)/products/[id]/settings/page.tsx @@ -48,6 +48,7 @@ export default async function ProductSettingsPage({ params }: Props) { defaultValues={{ id: product.id, name: product.name, + code: product.code, description: product.description ?? '', repo_url: product.repo_url ?? '', definition_of_done: product.definition_of_done, diff --git a/components/backlog/pbi-dialog.tsx b/components/backlog/pbi-dialog.tsx index 166bb12..8174f27 100644 --- a/components/backlog/pbi-dialog.tsx +++ b/components/backlog/pbi-dialog.tsx @@ -23,6 +23,7 @@ export interface PbiDialogPbi { title: string priority: number description?: string | null + code?: string | null } type CreateState = { mode: 'create'; productId: string; defaultPriority?: number } @@ -101,17 +102,30 @@ export function PbiDialog({ state, onClose }: PbiDialogProps) { {!isEdit && } -
- - +
+
+ + +
+
+ + +
diff --git a/components/backlog/story-dialog.tsx b/components/backlog/story-dialog.tsx index 5077d5d..068d47f 100644 --- a/components/backlog/story-dialog.tsx +++ b/components/backlog/story-dialog.tsx @@ -124,7 +124,14 @@ export function StoryDialog({ state, onClose, isDemo = false }: StoryDialogProps { if (!open) onClose() }}> - {isEdit ? story!.title : 'Nieuwe story'} +
+ {isEdit ? story!.title : 'Nieuwe story'} + {isEdit && story!.code && ( + + {story!.code} + + )} +
{isEdit && (
@@ -154,17 +161,30 @@ export function StoryDialog({ state, onClose, isDemo = false }: StoryDialogProps
{showForm ? (
-
- - - {fieldError('title') &&

{fieldError('title')}

} +
+
+ + + {fieldError('code') &&

{fieldError('code')}

} +
+
+ + + {fieldError('title') &&

{fieldError('title')}

} +
diff --git a/components/products/product-form.tsx b/components/products/product-form.tsx index f8910df..aa1d280 100644 --- a/components/products/product-form.tsx +++ b/components/products/product-form.tsx @@ -5,6 +5,7 @@ import { useFormStatus } from 'react-dom' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Textarea } from '@/components/ui/textarea' +import { cn } from '@/lib/utils' type FieldErrors = Record type ActionResult = { error?: string | FieldErrors; success?: boolean } | undefined @@ -34,6 +35,7 @@ interface ProductFormProps { defaultValues?: { id?: string name?: string + code?: string | null description?: string repo_url?: string definition_of_done?: string @@ -52,21 +54,39 @@ export function ProductForm({ action, submitLabel, defaultValues }: ProductFormP )} -
- - - {fieldError('name') && ( -

{fieldError('name')}

- )} +
+
+ + + {fieldError('code') && ( +

{fieldError('code')}

+ )} +
+
+ + + {fieldError('name') && ( +

{fieldError('name')}

+ )} +