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