From e824d83f93193b6cd48f94c5cae1a65df25c8855 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 22 Jun 2023 13:51:38 +0200 Subject: [PATCH] feat: link to strategy edit screens from playground strategy results (#4063) This PR adds links from the strategy evaluation results directly to the strategy edit screen. If the code doesn't find any links, nothing changes. The link text will be the name of the strategy and the title (if it exists). ![image](https://github.com/Unleash/unleash/assets/17786332/10ddbee2-2b19-46b8-a8be-994233f759ea) --- .../StrategyItemContainer.tsx | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx b/frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx index 8e330f44b4..2cfcad6ee5 100644 --- a/frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx +++ b/frontend/src/component/common/StrategyItemContainer/StrategyItemContainer.tsx @@ -11,6 +11,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import { PlaygroundStrategySchema } from 'openapi'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { Badge } from '../Badge/Badge'; +import { Link } from 'react-router-dom'; interface IStrategyItemContainerProps { strategy: IFeatureStrategy | PlaygroundStrategySchema; @@ -106,6 +107,11 @@ export const StrategyItemContainer: FC = ({ const Icon = getFeatureStrategyIcon(strategy.name); const { uiConfig } = useUiConfig(); + const StrategyHeaderLink: React.FC = + 'links' in strategy + ? ({ children }) => {children} + : ({ children }) => <> {children} ; + return ( = ({ }} /> - - - {formatStrategyName(String(strategy.title))} - - } - /> + + + + {formatStrategyName( + String(strategy.title) + )} + + } + /> +