diff --git a/__tests__/lib/idea-status.test.ts b/__tests__/lib/idea-status.test.ts index 0dfc3dc..7adfbd4 100644 --- a/__tests__/lib/idea-status.test.ts +++ b/__tests__/lib/idea-status.test.ts @@ -53,9 +53,9 @@ describe('canTransition', () => { expect(canTransition('PLAN_FAILED', 'GRILLED')).toBe(true) }) - it('only allows PLANNED → PLAN_READY (relink path)', () => { + it('allows PLANNED → PLAN_READY (relink) and PLANNED → GRILLING (re-grill)', () => { expect(canTransition('PLANNED', 'PLAN_READY')).toBe(true) - expect(canTransition('PLANNED', 'GRILLING')).toBe(false) + expect(canTransition('PLANNED', 'GRILLING')).toBe(true) expect(canTransition('PLANNED', 'DRAFT')).toBe(false) }) diff --git a/actions/ideas.ts b/actions/ideas.ts index dbfa806..1cdab96 100644 --- a/actions/ideas.ts +++ b/actions/ideas.ts @@ -338,7 +338,7 @@ export async function downloadIdeaMdAction( // --------------------------------------------------------------------------- // Job-triggers (Grill Me / Make Plan / Cancel) -const GRILL_TRIGGERABLE_FROM: IdeaStatus[] = ['DRAFT', 'GRILLED', 'GRILL_FAILED', 'PLAN_READY'] +const GRILL_TRIGGERABLE_FROM: IdeaStatus[] = ['DRAFT', 'GRILLED', 'GRILL_FAILED', 'PLAN_READY', 'PLANNED'] const MAKE_PLAN_TRIGGERABLE_FROM: IdeaStatus[] = ['GRILLED', 'PLAN_FAILED', 'PLAN_READY'] export async function startGrillJobAction(id: string): Promise> { diff --git a/lib/idea-status.ts b/lib/idea-status.ts index c972a38..1cc94b2 100644 --- a/lib/idea-status.ts +++ b/lib/idea-status.ts @@ -54,7 +54,7 @@ const ALLOWED_TRANSITIONS: Record> = { PLANNING: ['PLAN_READY', 'PLAN_FAILED'], PLAN_FAILED: ['PLANNING', 'GRILLED'], PLAN_READY: ['PLANNING', 'PLANNED'], - PLANNED: ['PLAN_READY'], // alleen via relinkIdeaPlanAction (PBI deleted) + PLANNED: ['PLAN_READY', 'GRILLING'], // PLAN_READY via relinkIdeaPlanAction; GRILLING via startGrillJobAction } export function canTransition(from: IdeaStatus, to: IdeaStatus): boolean {