Skip to content

Commit

Permalink
chore: add release management to new in unleash (#9257)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois authored Feb 7, 2025
1 parent 13ac056 commit c07fb58
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 14 deletions.
22 changes: 22 additions & 0 deletions frontend/src/assets/img/releaseManagementPreview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 15 additions & 13 deletions frontend/src/component/common/Truncator/Truncator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect, useRef } from 'react';
import { useState, useEffect, useRef, type CSSProperties } from 'react';
import {
Box,
type BoxProps,
Expand All @@ -8,18 +8,20 @@ import {
} from '@mui/material';

const StyledTruncatorContainer = styled(Box, {
shouldForwardProp: (prop) => prop !== 'lines',
})<{ lines: number }>(({ lines }) => ({
lineClamp: `${lines}`,
WebkitLineClamp: lines,
display: '-webkit-box',
boxOrient: 'vertical',
textOverflow: 'ellipsis',
overflow: 'hidden',
alignItems: 'flex-start',
WebkitBoxOrient: 'vertical',
wordBreak: 'break-word',
}));
shouldForwardProp: (prop) => prop !== 'lines' && prop !== 'wordBreak',
})<{ lines: number; wordBreak?: CSSProperties['wordBreak'] }>(
({ lines, wordBreak = 'break-all' }) => ({
lineClamp: `${lines}`,
WebkitLineClamp: lines,
display: '-webkit-box',
boxOrient: 'vertical',
textOverflow: 'ellipsis',
overflow: 'hidden',
alignItems: 'flex-start',
WebkitBoxOrient: 'vertical',
wordBreak,
}),
);

type OverridableTooltipProps = Omit<TooltipProps, 'children'>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import LifecycleStagesImage from 'assets/img/lifecycle-stages.png';
import MonitorHeartIcon from '@mui/icons-material/MonitorHeartOutlined';
import { useNavigate } from 'react-router-dom';
import { formatAssetPath } from 'utils/formatPath';
import FactCheckOutlinedIcon from '@mui/icons-material/FactCheckOutlined';
import { ReactComponent as ReleaseManagementPreview } from 'assets/img/releaseManagementPreview.svg';

const StyledNewInUnleash = styled('div')(({ theme }) => ({
margin: theme.spacing(2, 0, 1, 0),
Expand Down Expand Up @@ -73,6 +75,12 @@ const StyledSignalsIcon = styled(Signals)(({ theme }) => ({
color: theme.palette.primary.main,
}));

const StyledReleaseManagementIcon = styled(FactCheckOutlinedIcon)(
({ theme }) => ({
color: theme.palette.primary.main,
}),
);

const StyledImg = styled('img')(() => ({
maxWidth: '100%',
}));
Expand All @@ -94,6 +102,7 @@ export const NewInUnleash = ({
);
const { isEnterprise } = useUiConfig();
const signalsEnabled = useUiFlag('signals');
const releasePlansEnabled = useUiFlag('releasePlans');

const items: NewInUnleashItemDetails[] = [
{
Expand Down Expand Up @@ -154,6 +163,27 @@ export const NewInUnleash = ({
</>
),
},
{
label: 'Release management',
summary: 'Save time with release plans',
icon: <StyledReleaseManagementIcon />,
preview: <ReleaseManagementPreview />,
onCheckItOut: () => navigate('/release-management'),
show: isEnterprise() && releasePlansEnabled,
longDescription: (
<>
<p>
Instead of having to set up the same strategies again
and again, you can now create templates with milestones
of how you want to rollout features to your users.
</p>
<p>
Once you have set it up, just apply your release plan to
a flag, and you are ready to rollout!
</p>
</>
),
},
];

const visibleItems = items.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Close from '@mui/icons-material/Close';
import { NewInUnleashTooltip } from './NewInUnleashTooltip';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { Badge } from 'component/common/Badge/Badge';
import { Truncator } from 'component/common/Truncator/Truncator';

export type NewInUnleashItemDetails = {
label: string;
Expand All @@ -34,6 +35,10 @@ const StyledItemButton = styled(ListItemButton)(({ theme }) => ({
alignItems: 'start',
gap: theme.spacing(1),
fontSize: theme.fontSizes.smallBody,
'& > svg': {
width: theme.spacing(3),
height: theme.spacing(3),
},
}));

const LabelWithSummary = styled('div')(({ theme }) => ({
Expand Down Expand Up @@ -114,7 +119,9 @@ export const NewInUnleashItem = ({
<LabelWithSummary>
<StyledItemTitle>
<Typography fontWeight='bold' fontSize='small'>
{label}
<Truncator title={label} arrow>
{label}
</Truncator>
</Typography>
<ConditionallyRender
condition={beta}
Expand Down

0 comments on commit c07fb58

Please sign in to comment.