mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-13 13:48:59 +02:00
feat: add "cleanup" action to other flag lifecycle stages (#10471)
This commit is contained in:
parent
ac67a50693
commit
98bbf85421
@ -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();
|
||||
|
@ -213,7 +213,7 @@ export const CleanupReminder: FC<{
|
||||
disabled={loading}
|
||||
projectId={feature.project}
|
||||
>
|
||||
Revert to production
|
||||
Revert to previous stage
|
||||
</PermissionButton>
|
||||
</ActionsBox>
|
||||
}
|
||||
|
@ -164,6 +164,33 @@ const LiveStageAction: FC<{
|
||||
);
|
||||
};
|
||||
|
||||
const ReadyForCleanupAction: FC<{
|
||||
onComplete: () => void;
|
||||
loading: boolean;
|
||||
project: string;
|
||||
}> = ({ onComplete, loading, project }) => {
|
||||
return (
|
||||
<StyledStageAction>
|
||||
<StyledStageActionTitle>Ready for cleanup?</StyledStageActionTitle>
|
||||
<InfoText sx={{ mb: 1 }}>
|
||||
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.
|
||||
</InfoText>
|
||||
<PermissionButton
|
||||
variant='outlined'
|
||||
permission={UPDATE_FEATURE}
|
||||
size='small'
|
||||
onClick={onComplete}
|
||||
disabled={loading}
|
||||
projectId={project}
|
||||
>
|
||||
Mark ready for cleanup
|
||||
</PermissionButton>
|
||||
</StyledStageAction>
|
||||
);
|
||||
};
|
||||
|
||||
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
|
||||
</PermissionButton>
|
||||
<PermissionButton
|
||||
variant='outlined'
|
||||
@ -223,7 +250,7 @@ const ActivelyUsed: FC<{
|
||||
</InfoText>
|
||||
<InfoText>
|
||||
If you think this feature was completed too early you can revert to
|
||||
the live stage.
|
||||
the previous stage.
|
||||
</InfoText>
|
||||
<PermissionButton
|
||||
variant='outlined'
|
||||
@ -233,7 +260,7 @@ const ActivelyUsed: FC<{
|
||||
onClick={onUncomplete}
|
||||
disabled={loading}
|
||||
>
|
||||
Revert to production
|
||||
Revert to previous stage
|
||||
</PermissionButton>
|
||||
</StyledStageAction>
|
||||
);
|
||||
@ -421,6 +448,15 @@ export const FeatureLifecycleTooltip: FC<{
|
||||
project={project}
|
||||
/>
|
||||
) : null}
|
||||
{(stage.name === 'initial' ||
|
||||
stage.name === 'pre-live') &&
|
||||
onComplete ? (
|
||||
<ReadyForCleanupAction
|
||||
onComplete={onComplete}
|
||||
loading={loading}
|
||||
project={project}
|
||||
/>
|
||||
) : null}
|
||||
</StyledFooter>
|
||||
) : null}
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user