From b1e3699ca36797e224eac11f837fe574de3aeee2 Mon Sep 17 00:00:00 2001 From: David Newell Date: Thu, 21 Dec 2023 16:33:44 +0000 Subject: [PATCH] chore: remove antd from plugins (#19481) --- .../AsyncMigrations/AsyncMigrations.tsx | 8 +++--- .../src/scenes/plugins/edit/PluginField.tsx | 25 +++++++++++-------- .../scenes/plugins/source/PluginSource.tsx | 12 ++++----- .../src/scenes/surveys/SurveyAppearance.tsx | 22 +++++++++------- .../stories/How to build a form.stories.mdx | 4 +-- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/frontend/src/scenes/instance/AsyncMigrations/AsyncMigrations.tsx b/frontend/src/scenes/instance/AsyncMigrations/AsyncMigrations.tsx index 4bc890c80f38a..30ca2815d47f0 100644 --- a/frontend/src/scenes/instance/AsyncMigrations/AsyncMigrations.tsx +++ b/frontend/src/scenes/instance/AsyncMigrations/AsyncMigrations.tsx @@ -1,5 +1,5 @@ import { Link } from '@posthog/lemon-ui' -import { Button, Progress } from 'antd' +import { Progress } from 'antd' import { useActions, useValues } from 'kea' import { PageHeader } from 'lib/components/PageHeader' import { IconPlayCircle, IconRefresh, IconReplay } from 'lib/lemon-ui/icons' @@ -151,13 +151,13 @@ export function AsyncMigrations(): JSX.Element {
{status === AsyncMigrationStatus.NotStarted || status === AsyncMigrationStatus.FailedAtStartup ? ( - + ) : status === AsyncMigrationStatus.Starting || status === AsyncMigrationStatus.Running ? ( } onClick={() => { onChange(fieldConfig.default || '') @@ -58,24 +59,26 @@ export function PluginField({ }} > Reset secret {fieldConfig.type === 'attachment' ? 'attachment' : 'field'} - + ) } return fieldConfig.type === 'attachment' ? ( ) : fieldConfig.type === 'string' ? ( - + ) : fieldConfig.type === 'json' ? ( ) : fieldConfig.type === 'choice' ? ( - + { + return { label: choice, value: choice } + })} + /> ) : ( Unknown field type "{fieldConfig.type}". diff --git a/frontend/src/scenes/plugins/source/PluginSource.tsx b/frontend/src/scenes/plugins/source/PluginSource.tsx index ad47b039462bf..11c0dccb39155 100644 --- a/frontend/src/scenes/plugins/source/PluginSource.tsx +++ b/frontend/src/scenes/plugins/source/PluginSource.tsx @@ -2,7 +2,7 @@ import './PluginSource.scss' import { useMonaco } from '@monaco-editor/react' import { Link } from '@posthog/lemon-ui' -import { Button, Skeleton } from 'antd' +import { Skeleton } from 'antd' import { useActions, useValues } from 'kea' import { Form } from 'kea-forms' import { CodeEditor } from 'lib/components/CodeEditors' @@ -81,13 +81,11 @@ export function PluginSource({ title={pluginSourceLoading ? 'Loading...' : `Edit App: ${name}`} placement={placement ?? 'left'} footer={ -
- - +
} > diff --git a/frontend/src/scenes/surveys/SurveyAppearance.tsx b/frontend/src/scenes/surveys/SurveyAppearance.tsx index ef0d568f3ceb4..dbf5349ad3f8f 100644 --- a/frontend/src/scenes/surveys/SurveyAppearance.tsx +++ b/frontend/src/scenes/surveys/SurveyAppearance.tsx @@ -56,7 +56,7 @@ interface ButtonProps { children: React.ReactNode } -const Button = ({ +const SurveyButton = ({ link, type, onSubmit, @@ -351,7 +351,7 @@ export function BaseAppearance({
- +
{!preview && !appearance.whiteLabel && ( @@ -572,13 +572,13 @@ export function SurveyRatingAppearance({
- +
{!preview && !appearance.whiteLabel && ( @@ -739,9 +739,13 @@ export function SurveyMultipleChoiceAppearance({
- +
{!preview && !appearance.whiteLabel && ( @@ -797,9 +801,9 @@ export function SurveyThankYou({ appearance }: { appearance: SurveyAppearanceTyp className="thank-you-message-body" dangerouslySetInnerHTML={{ __html: sanitizeHTML(appearance?.thankYouMessageDescription || '') }} /> - + {!appearance.whiteLabel && ( Survey by {posthogLogoSVG} diff --git a/frontend/src/stories/How to build a form.stories.mdx b/frontend/src/stories/How to build a form.stories.mdx index 37b69133ab6eb..504cd7714e08c 100644 --- a/frontend/src/stories/How to build a form.stories.mdx +++ b/frontend/src/stories/How to build a form.stories.mdx @@ -163,7 +163,7 @@ export function FeatureFlag({ id }: { id?: string } = {}): JSX.Element { )} - + ) }