mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
feat: change CR strategy title and name behaviour (#4004)
This commit is contained in:
parent
16a3f6069c
commit
54654c6368
@ -48,6 +48,36 @@ export const StrategyDiff: FC<{
|
|||||||
</StyledCodeSection>
|
</StyledCodeSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const StrategyName: FC<{
|
||||||
|
change:
|
||||||
|
| IChangeRequestAddStrategy
|
||||||
|
| IChangeRequestUpdateStrategy
|
||||||
|
| IChangeRequestDeleteStrategy;
|
||||||
|
previousTitle: string | undefined;
|
||||||
|
}> = ({ change, previousTitle }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={Boolean(
|
||||||
|
previousTitle && previousTitle !== change.payload.title
|
||||||
|
)}
|
||||||
|
show={
|
||||||
|
<Truncated>
|
||||||
|
<Typography component="span" color="text.secondary">
|
||||||
|
{previousTitle ||
|
||||||
|
formatStrategyName(change.payload.name)}
|
||||||
|
</Typography>{' '}
|
||||||
|
</Truncated>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Truncated>
|
||||||
|
<Typography component="span">{change.payload.title}</Typography>
|
||||||
|
</Truncated>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
interface IStrategyTooltipLinkProps {
|
interface IStrategyTooltipLinkProps {
|
||||||
change:
|
change:
|
||||||
| IChangeRequestAddStrategy
|
| IChangeRequestAddStrategy
|
||||||
@ -76,21 +106,6 @@ export const StrategyTooltipLink: FC<IStrategyTooltipLinkProps> = ({
|
|||||||
}) => (
|
}) => (
|
||||||
<StyledContainer>
|
<StyledContainer>
|
||||||
<GetFeatureStrategyIcon strategyName={change.payload.name} />
|
<GetFeatureStrategyIcon strategyName={change.payload.name} />
|
||||||
<Truncated>
|
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(
|
|
||||||
(previousTitle && previousTitle !== change.payload.title) ||
|
|
||||||
(!previousTitle && change.payload.title)
|
|
||||||
)}
|
|
||||||
show={
|
|
||||||
<Truncated>
|
|
||||||
<Typography component="s" color="text.secondary">
|
|
||||||
{previousTitle ||
|
|
||||||
formatStrategyName(change.payload.name)}
|
|
||||||
</Typography>{' '}
|
|
||||||
</Truncated>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Truncated>
|
<Truncated>
|
||||||
<TooltipLink
|
<TooltipLink
|
||||||
tooltip={children}
|
tooltip={children}
|
||||||
@ -100,11 +115,10 @@ export const StrategyTooltipLink: FC<IStrategyTooltipLinkProps> = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography component="span">
|
<Typography component="span">
|
||||||
{change.payload.title ||
|
{formatStrategyName(change.payload.name)}
|
||||||
formatStrategyName(change.payload.name)}
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TooltipLink>
|
</TooltipLink>
|
||||||
</Truncated>
|
{<StrategyName change={change} previousTitle={previousTitle} />}
|
||||||
</Truncated>
|
</Truncated>
|
||||||
</StyledContainer>
|
</StyledContainer>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user