1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: completed stage lists all environments (#7007)

This commit is contained in:
Mateusz Kwasniewski 2024-05-08 14:16:10 +02:00 committed by GitHub
parent 95ac2e6b8d
commit f6e85171d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 9 deletions

View File

@ -315,8 +315,8 @@ const SafeToArchive: FC<{
mb: 1,
}}
>
We havent seen this feature flag in production for at least two
days. Its likely that its safe to archive this flag.
We havent seen this feature flag in any environment for at
least two days. Its likely that its safe to archive this flag.
</InfoText>
<Box
sx={{
@ -362,8 +362,18 @@ const ActivelyUsed: FC<{
}}
>
This feature has been successfully completed, but we are still
seeing usage in production. Clean up the feature flag from your code
before archiving it:
seeing usage. Clean up the feature flag from your code before
archiving it:
</InfoText>
{children}
<InfoText
sx={{
mt: 1,
mb: 1,
}}
>
If you think this feature was completed too early you can revert to
the live stage:
</InfoText>
<PermissionButton
color='inherit'
@ -376,7 +386,6 @@ const ActivelyUsed: FC<{
>
Revert to live
</PermissionButton>
{children}
</>
);

View File

@ -58,12 +58,16 @@ describe('populateCurrentStage', () => {
lifecycle: { stage: 'completed', enteredStageAt },
environments: [
{ name: 'prod', type: 'production', lastSeenAt: '2022-08-01' },
{ name: 'dev', type: 'development', lastSeenAt: '2022-08-01' },
],
} as IFeatureToggle;
const expected = {
name: 'completed',
status: 'kept',
environments: [{ name: 'prod', lastSeenAt: '2022-08-01' }],
environments: [
{ name: 'prod', lastSeenAt: '2022-08-01' },
{ name: 'dev', lastSeenAt: '2022-08-01' },
],
enteredStageAt,
};
const result = populateCurrentStage(feature);

View File

@ -40,9 +40,7 @@ export const populateCurrentStage = (
return {
name: 'completed',
status: 'kept',
environments: getFilteredEnvironments(
(type) => type === 'production',
),
environments: getFilteredEnvironments(() => true),
enteredStageAt,
};
case 'archived':