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 c640e778e8505..2d6a0dd22fbb2 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/experiments/SecondaryMetrics.tsx b/frontend/src/scenes/experiments/SecondaryMetrics.tsx index 75d22a10d19ec..9c22022c5efa4 100644 --- a/frontend/src/scenes/experiments/SecondaryMetrics.tsx +++ b/frontend/src/scenes/experiments/SecondaryMetrics.tsx @@ -1,4 +1,3 @@ -import { Col, Row } from 'antd' import { useActions, useValues } from 'kea' import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types' import { Form } from 'kea-forms' @@ -163,11 +162,11 @@ export function SecondaryMetrics({ {experimentId == 'new' || editingExistingExperiment ? ( - - +
+
{metrics.map((metric, idx) => ( - - +
+
{metric.name}
@@ -185,7 +184,7 @@ export function SecondaryMetrics({ onClick={() => deleteMetric(idx)} />
- +
{metric.filters.insight === InsightType.FUNNELS && ( )} -
+
))} {metrics && !(metrics.length > 2) && ( - -
- - Add metric - -
- +
+ + Add metric + +
)} - - +
+ ) : ( <>
Secondary metrics
diff --git a/frontend/src/scenes/feature-flags/FeatureFlag.scss b/frontend/src/scenes/feature-flags/FeatureFlag.scss index 730181e4ad083..dcc1363bde5fd 100644 --- a/frontend/src/scenes/feature-flags/FeatureFlag.scss +++ b/frontend/src/scenes/feature-flags/FeatureFlag.scss @@ -1,4 +1,4 @@ -.variant-form-list { +.VariantFormList { font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius); @@ -19,6 +19,10 @@ align-items: center; } } + + .VariantFormList__row { + grid-template-columns: repeat(24, minmax(0, 1fr)); + } } .feature-flag-property-display { diff --git a/frontend/src/scenes/feature-flags/FeatureFlag.tsx b/frontend/src/scenes/feature-flags/FeatureFlag.tsx index 1118c87a2b31d..50443d8cb83b7 100644 --- a/frontend/src/scenes/feature-flags/FeatureFlag.tsx +++ b/frontend/src/scenes/feature-flags/FeatureFlag.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { Form, Group } from 'kea-forms' -import { Row, Col, Radio, Popconfirm, Skeleton, Card } from 'antd' +import { Radio, Popconfirm, Skeleton, Card } from 'antd' import { useActions, useValues } from 'kea' import { alphabet, capitalizeFirstLetter } from 'lib/utils' import { featureFlagLogic } from './featureFlagLogic' @@ -78,7 +78,7 @@ export const scene: SceneExport = { function focusVariantKeyField(index: number): void { setTimeout( - () => document.querySelector(`.variant-form-list input[data-key-index="${index}"]`)?.focus(), + () => document.querySelector(`.VariantFormList input[data-key-index="${index}"]`)?.focus(), 50 ) } @@ -732,17 +732,17 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element { <>

Variant keys

- - Key - Description - Payload - Rollout - +
+
Key
+
Description
+
Payload
+
Rollout
+
{variants.map((variant, index) => (
- - +
+
{variant.key} - - +
+
{variant.name || 'There is no description for this variant key'} - - +
+
{featureFlag.filters.payloads?.[index] ? ( )} - - {variant.rollout_percentage}% - +
+
{variant.rollout_percentage}%
+
{index !== variants.length - 1 && }
))} @@ -874,24 +874,22 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element { No payload associated with this flag ) ) : ( - - -
- Specify a payload to be returned when the served value is{' '} - - true - -
- - - - - - -
+
+
+ Specify a payload to be returned when the served value is{' '} + + true + +
+ + + + + +
)}
)} @@ -899,33 +897,33 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element {

Variant keys

The rollout percentage of feature flag variants must add up to 100% -
- - - Variant key - Description - -
+
+
+
+
Variant key
+
Description
+
+
Payload - + Specify return payload when the variant key matches
- - - Rollout +
+
+ Rollout (Redistribute) - - +
+
{variants.map((variant, index) => ( - - +
+
- - +
+
- - +
+
- - +
+
{({ value, onChange }) => { return ( @@ -966,8 +964,8 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element { ) }} - - +
+
{({ value, onChange }) => (
@@ -1012,28 +1010,25 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element {
)}
- - - - {variants.length > 1 && ( - } - status="primary-alt" - data-attr={`delete-prop-filter-${index}`} - noPadding - onClick={() => removeVariant(index)} - disabledReason={ - featureFlag.experiment_set && - featureFlag.experiment_set?.length > 0 - ? 'Cannot delete variants from a feature flag that is part of an experiment' - : undefined - } - tooltipPlacement="topRight" - /> - )} - - - +
+
+ {variants.length > 1 && ( + } + status="primary-alt" + data-attr={`delete-prop-filter-${index}`} + noPadding + onClick={() => removeVariant(index)} + disabledReason={ + featureFlag.experiment_set && featureFlag.experiment_set?.length > 0 + ? 'Cannot delete variants from a feature flag that is part of an experiment' + : undefined + } + tooltipPlacement="topRight" + /> + )} +
+
))} {variants.length > 0 && !areVariantRolloutsValid && ( diff --git a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx index 1282a80c8c9d6..b7f21572aca70 100644 --- a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx +++ b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx @@ -1,4 +1,4 @@ -import { Row, Col, InputNumber, Select } from 'antd' +import { InputNumber, Select } from 'antd' import { useActions, useValues } from 'kea' import { capitalizeFirstLetter, humanFriendlyNumber } from 'lib/utils' import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters' @@ -75,7 +75,7 @@ export function FeatureFlagReleaseConditions({ const renderReleaseConditionGroup = (group: FeatureFlagGroupType, index: number): JSX.Element => { return ( - +
{index > 0 &&
OR
}
@@ -314,7 +314,7 @@ export function FeatureFlagReleaseConditions({ )}
- +
) } @@ -327,7 +327,7 @@ export function FeatureFlagReleaseConditions({ const hasMatchingEarlyAccessFeature = featureFlag.features?.find((f: any) => f.flagKey === featureFlag.key) return ( - +
{index > 0 &&
OR
}
@@ -386,7 +386,7 @@ export function FeatureFlagReleaseConditions({
- +
) } @@ -456,11 +456,11 @@ export function FeatureFlagReleaseConditions({
)}
- +
{filterGroups.map((group, index) => isSuper ? renderSuperReleaseConditionGroup(group, index) : renderReleaseConditionGroup(group, index) )} - +
{!readOnly && ( }> Add condition set