-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flags): Add FeatureFlagStatusIndicator to detail view for flags (#…
…26412) Co-authored-by: Dylan Martin <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9e610db
commit ee20bdc
Showing
9 changed files
with
151 additions
and
32 deletions.
There are no files selected for viewing
Binary file modified
BIN
+42 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
frontend/src/scenes/feature-flags/FeatureFlagStatusIndicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { LemonTag } from 'lib/lemon-ui/LemonTag' | ||
import { Tooltip } from 'lib/lemon-ui/Tooltip' | ||
|
||
import { FeatureFlagStatus, FeatureFlagStatusResponse } from '~/types' | ||
|
||
export function FeatureFlagStatusIndicator({ | ||
flagStatus, | ||
}: { | ||
flagStatus: FeatureFlagStatusResponse | null | ||
}): JSX.Element | null { | ||
if ( | ||
!flagStatus || | ||
[FeatureFlagStatus.ACTIVE, FeatureFlagStatus.DELETED, FeatureFlagStatus.UNKNOWN].includes(flagStatus.status) | ||
) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Tooltip | ||
title={ | ||
<> | ||
<div className="text-sm">{flagStatus.reason}</div> | ||
<div className="text-xs"> | ||
{flagStatus.status === FeatureFlagStatus.STALE && | ||
'Make sure to remove any references to this flag in your code before deleting it.'} | ||
{flagStatus.status === FeatureFlagStatus.INACTIVE && | ||
'It is probably not being used in your code, but be sure to remove any references to this flag before deleting it.'} | ||
</div> | ||
</> | ||
} | ||
placement="right" | ||
> | ||
<span> | ||
<LemonTag type="warning" className="uppercase cursor-default"> | ||
{flagStatus.status} | ||
</LemonTag> | ||
</span> | ||
</Tooltip> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters