1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

fix: Only show names as changed when titles have changed. (#3843)

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)
This commit is contained in:
Thomas Heartman 2023-05-23 14:16:20 +02:00 committed by GitHub
parent 2152a04a85
commit f7006642a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>
}