* ST-1243: F1 schema + propagateStatusUpwards-helper voor sprint-flow Schema-uitbreidingen voor de sprint-niveau jobflow (PBI-46): - TaskStatus, StoryStatus, PbiStatus, SprintStatus krijgen FAILED - Nieuwe enums: SprintRunStatus, PrStrategy - Nieuw SprintRun-model dat per-task ClaudeJobs groepeert - ClaudeJob.sprint_run_id koppeling + index - Product.pr_strategy (default SPRINT) - Bijhorende Prisma-migratie propagateStatusUpwards vervangt updateTaskStatusWithStoryPromotion en herevalueert de keten Task → Story → PBI → Sprint → SprintRun bij elke task-statuswijziging. Bij FAILED cancelt het sibling-jobs in dezelfde SprintRun. PBI-status BLOCKED blijft handmatig en wordt niet overschreven. Status-mappers + theme krijgen failed-token + label-uitbreidingen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ST-1244: F2 sprint-runs actions + deprecate per-task enqueues actions/sprint-runs.ts (nieuw): - startSprintRunAction met pre-flight (impl_plan / open ClaudeQuestion / PBI BLOCKED|FAILED) - Maakt SprintRun + ClaudeJobs in PBI→Story→Task volgorde - resumeSprintAction zet FAILED tasks/stories/PBIs terug en start nieuwe SprintRun - cancelSprintRunAction breekt lopende SprintRun af zonder cascade actions/claude-jobs.ts: - enqueueClaudeJobAction, enqueueAllTodoJobsAction, previewEnqueueAllAction, enqueueClaudeJobsBatchAction nu deprecation-stubs (UI-cleanup volgt in F4) - cancelClaudeJobAction blijft beschikbaar voor losse jobs Tests bijgewerkt: 11 nieuwe sprint-runs tests, claude-jobs(-batch) tests herzien naar deprecation-asserties. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ST-1246: F4 UI Start/Resume/Cancel sprint + pr_strategy dropdown - components/sprint/sprint-run-controls.tsx: knoppen Start Sprint (sprintStatus=ACTIVE), Hervat sprint (sprintStatus=FAILED) en Annuleer sprint-run (lopende run). Pre-flight blocker-modal toont blockers met directe links naar de relevante pagina's. - components/products/pr-strategy-select.tsx: dropdown SPRINT|STORY in product-settings, met optimistic update + sonner-toast op fail. - actions/products.ts: updatePrStrategyAction (eigenaar-only, demo-block). - Sprint-page: query op actieve SprintRun + tonen van controls-balk. Live cascade-visualisatie (T-634) staat als follow-up genoteerd — huidige sprint-board statusbadges volstaan voor MVP. De Solo-board "Voer uit"-knoppen zijn niet expliciet verwijderd; ze tonen nu de deprecation-error van de gestubde actions tot de Solo-flow opnieuw ontworpen wordt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
'use client'
|
|
|
|
import { useState, useTransition } from 'react'
|
|
import { toast } from 'sonner'
|
|
import { updatePrStrategyAction } from '@/actions/products'
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
} from '@/components/ui/select'
|
|
|
|
type PrStrategy = 'SPRINT' | 'STORY'
|
|
|
|
interface PrStrategySelectProps {
|
|
productId: string
|
|
initialValue: PrStrategy
|
|
}
|
|
|
|
const STRATEGY_LABELS: Record<PrStrategy, string> = {
|
|
SPRINT: 'Per sprint — één PR voor de hele sprint, klaar voor review aan eind',
|
|
STORY: 'Per story — auto-merge na CI groen, één PR per story',
|
|
}
|
|
|
|
export function PrStrategySelect({ productId, initialValue }: PrStrategySelectProps) {
|
|
const [value, setValue] = useState<PrStrategy>(initialValue)
|
|
const [isPending, startTransition] = useTransition()
|
|
|
|
function handleChange(next: string | null) {
|
|
if (next !== 'SPRINT' && next !== 'STORY') return
|
|
if (next === value) return
|
|
const previous = value
|
|
setValue(next)
|
|
startTransition(async () => {
|
|
const result = await updatePrStrategyAction(productId, next)
|
|
if ('error' in result && result.error) {
|
|
setValue(previous)
|
|
toast.error(typeof result.error === 'string' ? result.error : 'Opslaan mislukt')
|
|
}
|
|
})
|
|
}
|
|
|
|
return (
|
|
<div className="flex flex-col gap-2">
|
|
<Select value={value} onValueChange={handleChange} disabled={isPending}>
|
|
<SelectTrigger className="w-full max-w-xl">
|
|
{STRATEGY_LABELS[value]}
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="SPRINT">{STRATEGY_LABELS.SPRINT}</SelectItem>
|
|
<SelectItem value="STORY">{STRATEGY_LABELS.STORY}</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</div>
|
|
)
|
|
}
|