mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: explain stickiness (#7248)
This commit is contained in:
		
							parent
							
								
									7952d7e240
								
							
						
					
					
						commit
						7021763973
					
				| @ -77,6 +77,9 @@ export const StrategyExecution: VFC<IStrategyExecutionProps> = ({ | ||||
|     strategy, | ||||
| }) => { | ||||
|     const { parameters, constraints = [] } = strategy; | ||||
|     const stickiness = parameters?.stickiness; | ||||
|     const explainStickiness = | ||||
|         typeof stickiness === 'string' && stickiness !== 'default'; | ||||
|     const { strategies } = useStrategies(); | ||||
|     const { segments } = useSegments(); | ||||
|     const strategySegments = segments?.filter((segment) => { | ||||
| @ -112,6 +115,15 @@ export const StrategyExecution: VFC<IStrategyExecutionProps> = ({ | ||||
|                             <div> | ||||
|                                 <Badge color={badgeType}>{percentage}%</Badge>{' '} | ||||
|                                 <span>of your base</span>{' '} | ||||
|                                 <span> | ||||
|                                     {explainStickiness ? ( | ||||
|                                         <> | ||||
|                                             with <strong>{stickiness}</strong> | ||||
|                                         </> | ||||
|                                     ) : ( | ||||
|                                         '' | ||||
|                                     )}{' '} | ||||
|                                 </span> | ||||
|                                 <span> | ||||
|                                     {constraints.length > 0 | ||||
|                                         ? 'who match constraints' | ||||
|  | ||||
| @ -34,6 +34,9 @@ export const PlaygroundResultStrategyExecutionParameters = ({ | ||||
|     input, | ||||
|     disabled = false, | ||||
| }: PlaygroundResultStrategyExecutionParametersProps) => { | ||||
|     const stickiness = parameters?.stickiness; | ||||
|     const explainStickiness = | ||||
|         typeof stickiness === 'string' && stickiness !== 'default'; | ||||
|     return ( | ||||
|         <> | ||||
|             {Object.keys(parameters).map((key) => { | ||||
| @ -81,6 +84,16 @@ export const PlaygroundResultStrategyExecutionParameters = ({ | ||||
|                                         {percentage}% | ||||
|                                     </Badge>{' '} | ||||
|                                     of your base{' '} | ||||
|                                     <span> | ||||
|                                         {explainStickiness ? ( | ||||
|                                             <> | ||||
|                                                 with{' '} | ||||
|                                                 <strong>{stickiness}</strong> | ||||
|                                             </> | ||||
|                                         ) : ( | ||||
|                                             '' | ||||
|                                         )}{' '} | ||||
|                                     </span> | ||||
|                                     {constraints.length > 0 | ||||
|                                         ? 'who match constraints' | ||||
|                                         : ''}{' '} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user