From 51ff54497ec4ddd127a70b135e3f8d03014a9082 Mon Sep 17 00:00:00 2001 From: FredrikOseberg Date: Fri, 24 Oct 2025 09:13:32 +0200 Subject: [PATCH] feat: show draft automation inline in release plans MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding automation to a milestone in change request environments, the automation now displays inline with a "Modified in draft" badge instead of just showing the "Add automation" button. Changes: - Fix action name check from non-existent 'createMilestoneProgression' to 'changeMilestoneProgression' - Differentiate create vs update by checking if milestone originally has transitionCondition - Don't reset form state when adding to draft, allowing inline display - Show "Modified in draft" badge for both creates and updates in draft 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../ReleasePlanMilestoneItem/MilestoneAutomation.tsx | 8 ++++++-- .../ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx | 3 ++- .../ReleasePlanMilestoneItem/pendingProgressionChanges.ts | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/MilestoneAutomation.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/MilestoneAutomation.tsx index 4b2d520903..660d9c69b4 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/MilestoneAutomation.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/MilestoneAutomation.tsx @@ -82,16 +82,20 @@ export const MilestoneAutomation = ({ return null; } + // When milestone has no original transitionCondition but has a pending changeMilestoneProgression, it's a create + const isOriginallyEmpty = !milestone.transitionCondition; const hasPendingCreate = - pendingProgressionChange?.action === 'createMilestoneProgression'; + isOriginallyEmpty && + pendingProgressionChange?.action === 'changeMilestoneProgression'; const hasPendingChange = + !isOriginallyEmpty && pendingProgressionChange?.action === 'changeMilestoneProgression'; const hasPendingDelete = pendingProgressionChange?.action === 'deleteMilestoneProgression'; const badge = hasPendingDelete ? ( Deleted in draft - ) : hasPendingChange ? ( + ) : hasPendingChange || hasPendingCreate ? ( Modified in draft ) : undefined; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx index eaff57ffdc..cdfc7401c4 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx @@ -97,7 +97,8 @@ export const ReleasePlanMilestoneItem = ({ sourceMilestone: milestone.id, }, }); - return { shouldReset: true }; + handleCloseProgressionForm(); + return {}; } try { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/pendingProgressionChanges.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/pendingProgressionChanges.ts index f37c6d3788..3d5c4a6f7d 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/pendingProgressionChanges.ts +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/pendingProgressionChanges.ts @@ -15,10 +15,10 @@ export const getPendingProgressionData = ( ): PendingProgressionChangeResult => { const pendingProgressionChange = getPendingProgressionChange(milestone.id); - // Determine effective transition condition (use pending create if exists) + // Determine effective transition condition (use pending change if exists) let effectiveTransitionCondition = milestone.transitionCondition; if ( - pendingProgressionChange?.action === 'createMilestoneProgression' && + pendingProgressionChange?.action === 'changeMilestoneProgression' && 'transitionCondition' in pendingProgressionChange.payload && pendingProgressionChange.payload.transitionCondition ) {