From f7006642a6e8baf0ed4078e5953af7fa880ee477 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 23 May 2023 14:16:20 +0200 Subject: [PATCH] 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) --- .../StrategyTooltipLink/StrategyTooltipLink.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/changeRequest/ChangeRequest/StrategyTooltipLink/StrategyTooltipLink.tsx b/frontend/src/component/changeRequest/ChangeRequest/StrategyTooltipLink/StrategyTooltipLink.tsx index affef02b31..8e8afaf751 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/StrategyTooltipLink/StrategyTooltipLink.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/StrategyTooltipLink/StrategyTooltipLink.tsx @@ -80,12 +80,13 @@ export const StrategyTooltipLink: FC = ({ - {previousTitle} + {previousTitle || + formatStrategyName(change.payload.name)} {' '} }