diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycleTooltip/FeatureLifecycleTooltip.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycleTooltip/FeatureLifecycleTooltip.tsx new file mode 100644 index 000000000000..09967e7aceae --- /dev/null +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycleTooltip/FeatureLifecycleTooltip.tsx @@ -0,0 +1,76 @@ +import { Box, styled, Typography } from '@mui/material'; +import { Badge } from '../../../../common/Badge/Badge'; +import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip'; +import type { FC } from 'react'; +import type * as React from 'react'; + +const TimeLabel = styled('span')(({ theme }) => ({ + color: theme.palette.text.secondary, +})); + +const InfoText = styled('p')(({ theme }) => ({ + paddingBottom: theme.spacing(1), +})); + +const MainLifecycleRow = styled(Box)(({ theme }) => ({ + display: 'flex', + justifyContent: 'space-between', + marginBottom: theme.spacing(2), +})); + +const TimeLifecycleRow = styled(Box)(({ theme }) => ({ + display: 'flex', + justifyContent: 'space-between', + marginBottom: theme.spacing(1.5), +})); + +export const FeatureLifecycleTooltip: FC<{ + children: React.ReactElement; +}> = ({ children }) => ( + + ({ padding: theme.spacing(2) })}> + + Lifecycle + Initial + + + Stage entered at + 14/01/2024 + + + Time spent in stage + 3 days + + + ({ + backgroundColor: theme.palette.primary.main, + color: theme.palette.primary.contrastText, + borderRadius: theme.spacing(0, 0, 1, 1), // has to match the parent tooltip container + margin: theme.spacing(-1, -1.5), // has to match the parent tooltip container + p: theme.spacing(2, 3), + })} + > + + This feature toggle is currently in the initial phase of + it's life cycle. + + + This means that the flag has been created, but it has + not yet been seen in any environment. + + + Once we detect metrics for a non-production environment + it will move into pre-live. + + + + } + > + {children} + +); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx index 50ca2ed8ef9d..11b7416cd3a9 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx @@ -7,6 +7,8 @@ import Edit from '@mui/icons-material/Edit'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; +import { useUiFlag } from 'hooks/useUiFlag'; +import { FeatureLifecycleTooltip } from '../FeatureLifecycleTooltip/FeatureLifecycleTooltip'; const StyledContainer = styled('div')(({ theme }) => ({ borderRadius: theme.shape.borderRadiusLarge, @@ -63,6 +65,7 @@ const FeatureOverviewMetaData = () => { const featureId = useRequiredPathParam('featureId'); const { feature } = useFeature(projectId, featureId); const { project, description, type } = feature; + const featureLifecycleEnabled = useUiFlag('featureLifecycle'); const IconComponent = getFeatureTypeIcons(type); @@ -88,6 +91,18 @@ const FeatureOverviewMetaData = () => { Project: {project} + + Lifecycle:{' '} + + Initial + + + } + /> +