-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experiments): holdout groups UI (#25772)
- Loading branch information
1 parent
94aafdf
commit c61b3a9
Showing
19 changed files
with
545 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.08 KB
(100%)
...tend/__snapshots__/scenes-app-experiments--complete-funnel-experiment--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+827 Bytes
(100%)
...end/__snapshots__/scenes-app-experiments--complete-funnel-experiment--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+732 Bytes
(100%)
frontend/__snapshots__/scenes-app-experiments--running-trend-experiment--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+935 Bytes
(100%)
frontend/__snapshots__/scenes-app-experiments--running-trend-experiment--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+785 Bytes
(100%)
...hots__/scenes-app-experiments--running-trend-experiment-many-variants--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+949 Bytes
(100%)
...ots__/scenes-app-experiments--running-trend-experiment-many-variants--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
frontend/src/scenes/experiments/ExperimentView/HoldoutSelector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { IconInfo } from '@posthog/icons' | ||
import { LemonSelect, Tooltip } from '@posthog/lemon-ui' | ||
import { useActions, useValues } from 'kea' | ||
|
||
import { experimentLogic } from '../experimentLogic' | ||
|
||
export function HoldoutSelector(): JSX.Element { | ||
const { experiment, holdouts, isExperimentRunning } = useValues(experimentLogic) | ||
const { setExperiment, updateExperiment } = useActions(experimentLogic) | ||
|
||
const holdoutOptions = holdouts.map((holdout) => ({ | ||
value: holdout.id, | ||
label: holdout.name, | ||
})) | ||
holdoutOptions.unshift({ value: null, label: 'No holdout' }) | ||
|
||
return ( | ||
<div className="mt-3"> | ||
<div className="inline-flex space-x-1"> | ||
<h4 className="font-semibold mb-0">Holdout group</h4> | ||
<Tooltip title="Exclude a stable group of users from the experiment. This cannot be changed once the experiment is launched."> | ||
<IconInfo className="text-muted-alt text-base" /> | ||
</Tooltip> | ||
</div> | ||
<div className="mt-1"> | ||
<LemonSelect | ||
disabledReason={ | ||
isExperimentRunning && | ||
!experiment.end_date && | ||
'The holdout group cannot be changed once the experiment is launched.' | ||
} | ||
size="xsmall" | ||
options={holdoutOptions} | ||
value={experiment.holdout_id || null} | ||
onChange={(value) => { | ||
setExperiment({ | ||
...experiment, | ||
holdout_id: value, | ||
}) | ||
updateExperiment({ holdout_id: value }) | ||
}} | ||
data-attr="experiment-holdout-selector" | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.