diff --git a/frontend/__snapshots__/scenes-app-feature-flags--new-feature-flag.png b/frontend/__snapshots__/scenes-app-feature-flags--new-feature-flag.png index cb7249e0ab666..d67e7c8956499 100644 Binary files a/frontend/__snapshots__/scenes-app-feature-flags--new-feature-flag.png and b/frontend/__snapshots__/scenes-app-feature-flags--new-feature-flag.png differ diff --git a/frontend/src/scenes/feature-flags/FeatureFlag.tsx b/frontend/src/scenes/feature-flags/FeatureFlag.tsx index 3a212f4990141..6c60124c8a2ec 100644 --- a/frontend/src/scenes/feature-flags/FeatureFlag.tsx +++ b/frontend/src/scenes/feature-flags/FeatureFlag.tsx @@ -1,6 +1,7 @@ import './FeatureFlag.scss' -import { Card, Popconfirm, Radio, Skeleton } from 'antd' +import { LemonSegmentedButton } from '@posthog/lemon-ui' +import { Card, Popconfirm, Skeleton } from 'antd' import { useActions, useValues } from 'kea' import { Form, Group } from 'kea-forms' import { router } from 'kea-router' @@ -26,7 +27,6 @@ import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea' import { Lettermark, LettermarkColor } from 'lib/lemon-ui/Lettermark' import { Link } from 'lib/lemon-ui/Link' import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner' -import { Tooltip } from 'lib/lemon-ui/Tooltip' import { featureFlagLogic as enabledFeaturesLogic } from 'lib/logic/featureFlagLogic' import { alphabet, capitalizeFirstLetter } from 'lib/utils' import { PostHogFeature } from 'posthog-js/react' @@ -828,54 +828,41 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element { okText="OK" cancelText="Cancel" > - 0 - ), + ? 'This feature flag is associated with an experiment.' + : undefined, }, { - label: ( - -
- {!hasAvailableFeature(AvailableFeature.MULTIVARIATE_FLAGS) && ( - - - - )} - Multiple variants with rollout percentages (A/B test) -
-
+ label: !hasAvailableFeature(AvailableFeature.MULTIVARIATE_FLAGS) ? ( + + + Multiple variants with rollout percentages (A/B test) + + ) : ( + Multiple variants with rollout percentages (A/B test) ), - value: true, - disabled: !hasAvailableFeature(AvailableFeature.MULTIVARIATE_FLAGS), + value: 'multivariate', + disabledReason: !hasAvailableFeature(AvailableFeature.MULTIVARIATE_FLAGS) + ? 'This feature is not available on your current plan.' + : undefined, }, ]} - onChange={(e) => { - const { value } = e.target - if (value === false && nonEmptyVariants.length) { + onChange={(value) => { + if (value === 'boolean' && nonEmptyVariants.length) { setShowVariantDiscardWarning(true) } else { - setMultivariateEnabled(value) + setMultivariateEnabled(value === 'multivariate') focusVariantKeyField(0) } }} - value={multivariateEnabled} - optionType="button" + value={multivariateEnabled ? 'multivariate' : 'boolean'} />