diff --git a/.eslintrc.js b/.eslintrc.js index 23591985e5a81..a9eaca7209d46 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -191,6 +191,10 @@ module.exports = { element: 'Badge', message: 'use LemonBadge instead', }, + { + element: 'InputNumber', + message: 'use LemonInput with type="number" instead', + }, { element: 'Collapse', message: 'use instead', diff --git a/cypress/e2e/surveys.cy.ts b/cypress/e2e/surveys.cy.ts index 1f9d7aef72049..9a75337b67356 100644 --- a/cypress/e2e/surveys.cy.ts +++ b/cypress/e2e/surveys.cy.ts @@ -96,7 +96,7 @@ describe('Surveys', () => { cy.get('[data-attr=prop-val] .ant-select-selector').click({ force: true }) cy.get('[data-attr=prop-val-0]').click({ force: true }) - cy.get('.ant-input-number-input-wrap>input').type('{backspace}') + cy.get('[data-attr="rollout-percentage"]').type('{backspace}') // save cy.get('[data-attr="save-survey"]').click() diff --git a/frontend/src/scenes/experiments/ExperimentPreview.tsx b/frontend/src/scenes/experiments/ExperimentPreview.tsx index 66aa3298e1cc3..60f11d15ae769 100644 --- a/frontend/src/scenes/experiments/ExperimentPreview.tsx +++ b/frontend/src/scenes/experiments/ExperimentPreview.tsx @@ -1,5 +1,5 @@ -import { LemonButton, LemonDivider, LemonModal, Tooltip } from '@posthog/lemon-ui' -import { InputNumber, Slider } from 'antd' +import { LemonButton, LemonDivider, LemonInput, LemonModal, Tooltip } from '@posthog/lemon-ui' +import { Slider } from 'antd' import { useActions, useValues } from 'kea' import { Field, Form } from 'kea-forms' import { InsightLabel } from 'lib/components/InsightLabel' @@ -136,12 +136,12 @@ export function ExperimentPreview({ tipFormatter={(value) => `${value}%`} /> - `${value}%`} - style={{ margin: '0 16px' }} + suffix={%} value={minimumDetectableChange} onChange={(value) => { setExperiment({ diff --git a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx index a3231e269c30d..56bc21f278694 100644 --- a/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx +++ b/frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx @@ -1,7 +1,7 @@ import './FeatureFlag.scss' -import { LemonSelect, Link } from '@posthog/lemon-ui' -import { InputNumber, Select } from 'antd' +import { LemonInput, LemonSelect, Link } from '@posthog/lemon-ui' +import { Select } from 'antd' import { useActions, useValues } from 'kea' import { router } from 'kea-router' import { allOperatorsToHumanName } from 'lib/components/DefinitionPopover/utils' @@ -242,15 +242,17 @@ export function FeatureFlagReleaseConditions({
Roll out to{' '} - { - updateConditionSet(index, value) + updateConditionSet(index, value || 100) }} value={group.rollout_percentage != null ? group.rollout_percentage : 100} min={0} max={100} - addonAfter="%" + suffix={%} />{' '} of {aggregationTargetName} in this set.{' '}
diff --git a/frontend/src/scenes/insights/EditorFilters/PathsAdvanced.tsx b/frontend/src/scenes/insights/EditorFilters/PathsAdvanced.tsx index 624045ea8c957..62bdb68617160 100644 --- a/frontend/src/scenes/insights/EditorFilters/PathsAdvanced.tsx +++ b/frontend/src/scenes/insights/EditorFilters/PathsAdvanced.tsx @@ -1,5 +1,4 @@ -import { LemonDivider } from '@posthog/lemon-ui' -import { InputNumber } from 'antd' +import { LemonDivider, LemonInput } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { PayGateMini } from 'lib/components/PayGateMini/PayGateMini' import { IconSettings } from 'lib/lemon-ui/icons' @@ -42,7 +41,8 @@ export function PathsAdvanced({ insightProps, ...rest }: EditorFilterProps): JSX Maximum number of paths -
Between - @@ -76,7 +77,8 @@ export function PathsAdvanced({ insightProps, ...rest }: EditorFilterProps): JSX onPressEnter={updateEdgeParameters} /> and - setLocalEdgeParameters((state) => ({ ...state, diff --git a/frontend/src/scenes/insights/views/Funnels/FunnelBinsPicker.tsx b/frontend/src/scenes/insights/views/Funnels/FunnelBinsPicker.tsx index b10dd04e1e45a..cfa19f26624dd 100644 --- a/frontend/src/scenes/insights/views/Funnels/FunnelBinsPicker.tsx +++ b/frontend/src/scenes/insights/views/Funnels/FunnelBinsPicker.tsx @@ -1,4 +1,5 @@ -import { InputNumber, Select } from 'antd' +import { LemonInput } from '@posthog/lemon-ui' +import { Select } from 'antd' import clsx from 'clsx' import { useActions, useValues } from 'kea' import { BIN_COUNT_AUTO } from 'lib/constants' @@ -63,9 +64,9 @@ export function FunnelBinsPicker({ disabled }: FunnelBinsPickerProps): JSX.Eleme <> {menu}
-