1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-01 13:47:27 +02:00

feat: hide feature env variants in the UI

This commit is contained in:
kwasniew 2024-05-14 15:03:54 +02:00
parent 9112662c31
commit ac247ea61d
No known key found for this signature in database
GPG Key ID: 43A7CBC24C119560
2 changed files with 14 additions and 1 deletions

View File

@ -48,6 +48,7 @@ import { ReactComponent as ParentLinkIcon } from 'assets/icons/link-parent.svg';
import { ChildrenTooltip } from './FeatureOverview/FeatureOverviewMetaData/ChildrenTooltip';
import copy from 'copy-to-clipboard';
import useToast from 'hooks/useToast';
import { useUiFlag } from '../../../hooks/useUiFlag';
const StyledHeader = styled('div')(({ theme }) => ({
backgroundColor: theme.palette.background.paper,
@ -145,6 +146,9 @@ export const FeatureView = () => {
const [openStaleDialog, setOpenStaleDialog] = useState(false);
const [isFeatureNameCopied, setIsFeatureNameCopied] = useState(false);
const smallScreen = useMediaQuery(`(max-width:${500}px)`);
const hideFeatureEnvironmentVariants = useUiFlag(
'hideFeatureEnvironmentVariants',
);
const { feature, loading, error, status } = useFeature(
projectId,
@ -168,7 +172,15 @@ export const FeatureView = () => {
path: `${basePath}/metrics`,
name: 'Metrics',
},
{ title: 'Variants', path: `${basePath}/variants`, name: 'Variants' },
...(hideFeatureEnvironmentVariants
? []
: [
{
title: 'Variants',
path: `${basePath}/variants`,
name: 'Variants',
},
]),
{ title: 'Settings', path: `${basePath}/settings`, name: 'Settings' },
{
title: 'Event log',

View File

@ -71,6 +71,7 @@ export type UiFlags = {
executiveDashboardUI?: boolean;
feedbackComments?: Variant;
displayUpgradeEdgeBanner?: boolean;
hideFeatureEnvironmentVariants?: boolean;
showInactiveUsers?: boolean;
featureSearchFeedbackPosting?: boolean;
userAccessUIEnabled?: boolean;