From 98bbf85421ba3d7886c26f21ae181da30892a7c8 Mon Sep 17 00:00:00 2001
From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
Date: Thu, 7 Aug 2025 11:54:33 +0200
Subject: [PATCH] feat: add "cleanup" action to other flag lifecycle stages
(#10471)
---
.../CleanupReminder/CleanupReminder.test.tsx | 2 +-
.../CleanupReminder/CleanupReminder.tsx | 2 +-
.../FeatureLifecycleTooltip.tsx | 42 +++++++++++++++++--
3 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.test.tsx b/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.test.tsx
index 1f100e8608..7955a1b39f 100644
--- a/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.test.tsx
+++ b/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.test.tsx
@@ -59,7 +59,7 @@ test('render remove flag from code reminder', async () => {
});
await screen.findByText('Time to remove flag from code?');
- await screen.findByText('Revert to production');
+ await screen.findByText('Revert to previous stage');
const reminder = await screen.findByText('Remind me later');
reminder.click();
diff --git a/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.tsx b/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.tsx
index a7ca02255e..f8f136ef27 100644
--- a/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.tsx
+++ b/frontend/src/component/feature/FeatureView/CleanupReminder/CleanupReminder.tsx
@@ -213,7 +213,7 @@ export const CleanupReminder: FC<{
disabled={loading}
projectId={feature.project}
>
- Revert to production
+ Revert to previous stage
}
diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx
index f4055c3533..99992b7b77 100644
--- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx
+++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx
@@ -164,6 +164,33 @@ const LiveStageAction: FC<{
);
};
+const ReadyForCleanupAction: FC<{
+ onComplete: () => void;
+ loading: boolean;
+ project: string;
+}> = ({ onComplete, loading, project }) => {
+ return (
+
+ Ready for cleanup?
+
+ If this flag is no longer needed and ready to be removed from
+ the code, you can mark it as ready for cleanup. This helps
+ reduce technical debt.
+
+
+ Mark ready for cleanup
+
+
+ );
+};
+
const SafeToArchive: FC<{
onArchive: () => void;
onUncomplete: () => void;
@@ -194,7 +221,7 @@ const SafeToArchive: FC<{
disabled={loading}
projectId={project}
>
- Revert to production
+ Revert to previous stage
If you think this feature was completed too early you can revert to
- the live stage.
+ the previous stage.
- Revert to production
+ Revert to previous stage
);
@@ -421,6 +448,15 @@ export const FeatureLifecycleTooltip: FC<{
project={project}
/>
) : null}
+ {(stage.name === 'initial' ||
+ stage.name === 'pre-live') &&
+ onComplete ? (
+
+ ) : null}
) : null}