Skip to content

Commit

Permalink
fix(argocd): fix argocd commit message visibility (janus-idp#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eswaraiahsapram authored and kim-tsao committed Nov 13, 2024
1 parent 74d5f33 commit 7492a68
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const useCardStyles = makeStyles<Theme>(theme =>
marginRight: theme.spacing(2.5),
maxWidth: '300px',
},
commitMessage: {
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
},
}),
);

Expand Down Expand Up @@ -147,9 +152,25 @@ const DeploymentLifecycleCard: React.FC<DeploymentLifecycleCardProps> = ({
color="primary"
label={latestRevision?.revision.slice(0, 7)}
/>
<Typography variant="body2" color="textSecondary">
<Typography
variant="body2"
color="textSecondary"
className={classes.commitMessage}
>
{revisionsMap?.[latestRevision?.revision] ? (
<>{revisionsMap?.[latestRevision?.revision]?.message}</>
<Tooltip
data-testid={`${latestRevision?.revision?.slice(
0,
5,
)}-commit-message`}
title={
revisionsMap?.[latestRevision?.revision]?.message
}
>
<span>
{revisionsMap?.[latestRevision?.revision]?.message}
</span>
</Tooltip>
) : (
<Skeleton />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const useDrawerStyles = makeStyles<Theme>(theme =>
justifyContent: 'space-between',
alignItems: 'baseline',
},
commitMessage: {
wordBreak: 'break-word',
},
}),
);
const DeploymentLifecycleDrawer: React.FC<DeploymentLifecycleDrawerProps> = ({
Expand Down Expand Up @@ -167,7 +170,10 @@ const DeploymentLifecycleDrawer: React.FC<DeploymentLifecycleDrawerProps> = ({
}}
label={latestRevision?.revision.slice(0, 7)}
/>
<Typography color="textSecondary">
<Typography
color="textSecondary"
className={classes.commitMessage}
>
{revisionsMap?.[latestRevision?.revision] ? (
<>
{revisionsMap?.[latestRevision?.revision]?.message} by{' '}
Expand All @@ -193,7 +199,11 @@ const DeploymentLifecycleDrawer: React.FC<DeploymentLifecycleDrawerProps> = ({
Deployment
</Typography>

<Typography variant="body2" color="textSecondary">
<Typography
variant="body2"
color="textSecondary"
className={classes.commitMessage}
>
Image{' '}
<Link
href={`https://${app?.status?.summary?.images?.[0]}`}
Expand Down Expand Up @@ -257,7 +267,11 @@ const DeploymentLifecycleDrawer: React.FC<DeploymentLifecycleDrawerProps> = ({
Deployment
</Typography>

<Typography variant="body2" color="textSecondary">
<Typography
variant="body2"
color="textSecondary"
className={classes.commitMessage}
>
{revisionsMap[dep.revision]?.message}{' '}
<Link
aria-disabled={!!commitUrl}
Expand Down

0 comments on commit 7492a68

Please sign in to comment.