Skip to content

Commit

Permalink
fix: Only show names as changed when titles have changed. (#3843)
Browse files Browse the repository at this point in the history
Related to [linear task
1-954](https://linear.app/unleash/issue/1-954/disabling-last-strategy-in-change-request-shows-strikethrough).

This PR changes the display logic for showing titles as changed: it
previously fell back to always being `true` if there was a custom title
set for a strategy. This PR makes it so that it only shows as changed if
the title has actually changed, either from one custom title to another,
or to and from the display name.

To accommodate the last bit, it also shows display names with a
strikethrough if the strategy had no title previously, but now it does. This is consistent with how it displays the strategy name if you delete a title from a strategy.


Here's a number of different examples: 


![image](https://github.com/Unleash/unleash/assets/17786332/034bcc01-8715-4052-afec-56caf7edea51)
  • Loading branch information
thomasheartman committed May 23, 2023
1 parent 2152a04 commit f700664
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -80,12 +80,13 @@ export const StrategyTooltipLink: FC<IStrategyTooltipLinkProps> = ({
<ConditionallyRender
condition={Boolean(
(previousTitle && previousTitle !== change.payload.title) ||
true
(!previousTitle && change.payload.title)
)}
show={
<Truncated>
<Typography component="s" color="text.secondary">
{previousTitle}
{previousTitle ||
formatStrategyName(change.payload.name)}
</Typography>{' '}
</Truncated>
}
Expand Down

0 comments on commit f700664

Please sign in to comment.