From 74d63512a4d818f0257993673164494f0644a4bb Mon Sep 17 00:00:00 2001 From: David Newell Date: Wed, 8 Nov 2023 22:08:18 +0000 Subject: [PATCH] chore: stop people using new antd icons (#18494) --- .eslintrc.js | 4 ++++ .../src/lib/components/Cards/InsightCard/InsightMeta.tsx | 1 + frontend/src/lib/components/CloseButton.tsx | 1 + frontend/src/lib/components/ObjectTags/ObjectTags.tsx | 1 + .../src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx | 5 ++--- frontend/src/lib/components/SelectGradientOverflow.tsx | 3 ++- .../src/lib/components/SmoothingFilter/SmoothingFilter.tsx | 1 + frontend/src/lib/components/TZLabel/index.tsx | 7 ++++--- frontend/src/scenes/PreflightCheck/PreflightCheck.tsx | 5 ++--- frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx | 1 + .../data-warehouse/settings/DataWarehouseSettingsScene.tsx | 5 ++--- frontend/src/scenes/experiments/Experiment.tsx | 1 + frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx | 1 + .../scenes/insights/filters/RetentionReferencePicker.tsx | 1 + .../views/Funnels/FunnelCorrelationSkewWarning.tsx | 1 + .../src/scenes/insights/views/Funnels/FunnelVizType.tsx | 6 ++++-- .../views/InsightsTable/columns/AggregationColumn.tsx | 1 + .../src/scenes/insights/views/Paths/PathStepPicker.tsx | 1 + frontend/src/scenes/persons/NewPropertyComponent.tsx | 1 + frontend/src/scenes/persons/PersonScene.tsx | 1 + .../plugins/edit/interface-jobs/PluginJobConfiguration.tsx | 4 ++-- .../src/scenes/plugins/tabs/apps/AppManagementView.tsx | 5 ++--- frontend/src/scenes/project/Settings/TeamMembers.tsx | 1 + 23 files changed, 38 insertions(+), 20 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9d6792f0fd652..426bddae3c5ba 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -82,6 +82,10 @@ module.exports = { name: 'dayjs', message: 'Do not directly import dayjs. Only import the dayjs exported from lib/dayjs.', }, + { + name: '@ant-design/icons', + message: 'Please use icons from the @posthog/icons package instead', + }, ], }, ], diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx index fd45ba5fed66d..73d5b42ac3841 100644 --- a/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx +++ b/frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx @@ -18,6 +18,7 @@ import { mathsLogic } from 'scenes/trends/mathsLogic' import { ExportButton } from 'lib/components/ExportButton/ExportButton' import { CardMeta } from 'lib/components/Cards/CardMeta' import { DashboardPrivilegeLevel } from 'lib/constants' +// eslint-disable-next-line no-restricted-imports import { PieChartFilled } from '@ant-design/icons' import { Tooltip } from 'lib/lemon-ui/Tooltip' import { TopHeading } from 'lib/components/Cards/InsightCard/TopHeading' diff --git a/frontend/src/lib/components/CloseButton.tsx b/frontend/src/lib/components/CloseButton.tsx index c75a598bd5dcd..abd6ca7d2ef77 100644 --- a/frontend/src/lib/components/CloseButton.tsx +++ b/frontend/src/lib/components/CloseButton.tsx @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-restricted-imports import { CloseOutlined } from '@ant-design/icons' // TODO: Remove, but de-ant PropertyFilterButton and SelectGradientOverflow first diff --git a/frontend/src/lib/components/ObjectTags/ObjectTags.tsx b/frontend/src/lib/components/ObjectTags/ObjectTags.tsx index d4f291368d264..00d447b71ff0c 100644 --- a/frontend/src/lib/components/ObjectTags/ObjectTags.tsx +++ b/frontend/src/lib/components/ObjectTags/ObjectTags.tsx @@ -1,6 +1,7 @@ import { Tag, Select } from 'antd' import { colorForString } from 'lib/utils' import { CSSProperties, useMemo } from 'react' +// eslint-disable-next-line no-restricted-imports import { SyncOutlined, CloseOutlined } from '@ant-design/icons' import { SelectGradientOverflow } from '../SelectGradientOverflow' import { useActions, useValues } from 'kea' diff --git a/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx b/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx index 1df2bf9437018..87d3a501c15ac 100644 --- a/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx +++ b/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx @@ -1,7 +1,6 @@ import { useState, useCallback, Dispatch, SetStateAction } from 'react' import { Table, Popconfirm } from 'antd' import { useActions, useValues } from 'kea' -import { ExclamationCircleOutlined } from '@ant-design/icons' import { personalAPIKeysLogic } from './personalAPIKeysLogic' import { PersonalAPIKeyType } from '~/types' import { humanFriendlyDetailedTime } from 'lib/utils' @@ -10,7 +9,7 @@ import { ColumnsType } from 'antd/lib/table' import { LemonButton } from 'lib/lemon-ui/LemonButton' import { LemonInput, LemonModal, Link } from '@posthog/lemon-ui' import { LemonBanner } from 'lib/lemon-ui/LemonBanner' -import { IconPlus } from 'lib/lemon-ui/icons' +import { IconErrorOutline, IconPlus } from 'lib/lemon-ui/icons' function CreateKeyModal({ isOpen, @@ -88,7 +87,7 @@ function RowActionsCreator( title={`Permanently delete key "${personalAPIKey.label}"?`} okText="Delete Key" okType="danger" - icon={} + icon={} placement="left" onConfirm={() => { deleteKey(personalAPIKey) diff --git a/frontend/src/lib/components/SelectGradientOverflow.tsx b/frontend/src/lib/components/SelectGradientOverflow.tsx index 253e645227d3b..1623c08976ae3 100644 --- a/frontend/src/lib/components/SelectGradientOverflow.tsx +++ b/frontend/src/lib/components/SelectGradientOverflow.tsx @@ -1,3 +1,5 @@ +// eslint-disable-next-line no-restricted-imports +import { LoadingOutlined } from '@ant-design/icons' import { ReactElement, RefObject, useEffect, useRef, useState } from 'react' import { ConfigProvider, Empty, Select, Tag } from 'antd' import { RefSelectProps, SelectProps } from 'antd/lib/select' @@ -7,7 +9,6 @@ import { Tooltip } from 'lib/lemon-ui/Tooltip' import './SelectGradientOverflow.scss' import { useValues } from 'kea' import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel' -import { LoadingOutlined } from '@ant-design/icons' interface DropdownGradientRendererProps { updateScrollGradient: () => void diff --git a/frontend/src/lib/components/SmoothingFilter/SmoothingFilter.tsx b/frontend/src/lib/components/SmoothingFilter/SmoothingFilter.tsx index 9460168ba9fd4..d21d6a9bb6808 100644 --- a/frontend/src/lib/components/SmoothingFilter/SmoothingFilter.tsx +++ b/frontend/src/lib/components/SmoothingFilter/SmoothingFilter.tsx @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-restricted-imports import { FundOutlined } from '@ant-design/icons' import { smoothingOptions } from './smoothings' import { useActions, useValues } from 'kea' diff --git a/frontend/src/lib/components/TZLabel/index.tsx b/frontend/src/lib/components/TZLabel/index.tsx index 497a06012da9d..1ad2ed478bb83 100644 --- a/frontend/src/lib/components/TZLabel/index.tsx +++ b/frontend/src/lib/components/TZLabel/index.tsx @@ -1,6 +1,7 @@ import './index.scss' import { useActions, useValues } from 'kea' -import { ProjectOutlined, LaptopOutlined, GlobalOutlined } from '@ant-design/icons' +// eslint-disable-next-line no-restricted-imports +import { ProjectOutlined, LaptopOutlined } from '@ant-design/icons' import { humanFriendlyDetailedTime, shortTimeZone } from 'lib/utils' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { teamLogic } from '../../../scenes/teamLogic' @@ -8,7 +9,7 @@ import { dayjs } from 'lib/dayjs' import clsx from 'clsx' import React, { useCallback, useEffect, useMemo, useState } from 'react' import { LemonButton, LemonDivider, LemonDropdown, LemonDropdownProps } from '@posthog/lemon-ui' -import { IconSettings } from 'lib/lemon-ui/icons' +import { IconSettings, IconWeb } from 'lib/lemon-ui/icons' import { urls } from 'scenes/urls' const BASE_OUTPUT_FORMAT = 'ddd, MMM D, YYYY h:mm A' @@ -67,7 +68,7 @@ const TZLabelPopoverContent = React.memo(function TZLabelPopoverContent({ {currentTeam?.timezone !== 'UTC' && (
- UTC + UTC
{time.tz('UTC').format(DATE_OUTPUT_FORMAT)}
diff --git a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx index 0dc09b3607e8f..dfbadfeb38a13 100644 --- a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx +++ b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx @@ -1,5 +1,4 @@ import { useValues, useActions } from 'kea' -import { LoadingOutlined } from '@ant-design/icons' import { PreflightCheckStatus, PreflightItem, preflightLogic } from './preflightLogic' import './PreflightCheck.scss' import { capitalizeFirstLetter } from 'lib/utils' @@ -18,7 +17,7 @@ import { LemonRow } from 'lib/lemon-ui/LemonRow' import { AnimatedCollapsible } from 'lib/components/AnimatedCollapsible' import { LemonDivider } from 'lib/lemon-ui/LemonDivider' import { BridgePage } from 'lib/components/BridgePage/BridgePage' -import { Link } from '@posthog/lemon-ui' +import { Link, Spinner } from '@posthog/lemon-ui' export const scene: SceneExport = { component: PreflightCheck, @@ -27,7 +26,7 @@ export const scene: SceneExport = { function PreflightCheckIcon({ status, loading }: { status: PreflightCheckStatus; loading?: boolean }): JSX.Element { if (loading) { - return + return } if (status === 'validated') { return diff --git a/frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx b/frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx index e7a29f4cfa63b..0b3dc1735d610 100644 --- a/frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx +++ b/frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx @@ -1,6 +1,7 @@ import { useActions } from 'kea' import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic' import { Card } from 'antd' +// eslint-disable-next-line no-restricted-imports import { AppstoreAddOutlined } from '@ant-design/icons' export const NoDashboards = (): JSX.Element => { diff --git a/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx b/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx index 575ac0d373ee8..eb158c2f97c52 100644 --- a/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx +++ b/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx @@ -1,4 +1,4 @@ -import { LemonButton, LemonTable, LemonTag } from '@posthog/lemon-ui' +import { LemonButton, LemonTable, LemonTag, Spinner } from '@posthog/lemon-ui' import { PageHeader } from 'lib/components/PageHeader' import { SceneExport } from 'scenes/sceneTypes' import { dataWarehouseSettingsLogic } from './dataWarehouseSettingsLogic' @@ -8,7 +8,6 @@ import SourceModal from '../external/SourceModal' import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { FEATURE_FLAGS } from 'lib/constants' import { More } from 'lib/lemon-ui/LemonButton/More' -import { LoadingOutlined } from '@ant-design/icons' export const scene: SceneExport = { component: DataWarehouseSettingsScene, @@ -89,7 +88,7 @@ export function DataWarehouseSettingsScene(): JSX.Element {
{sourceReloadingById[source.id] ? (
- +
) : (
diff --git a/frontend/src/scenes/experiments/Experiment.tsx b/frontend/src/scenes/experiments/Experiment.tsx index dd1646ad8dfb7..8d692a97a6234 100644 --- a/frontend/src/scenes/experiments/Experiment.tsx +++ b/frontend/src/scenes/experiments/Experiment.tsx @@ -8,6 +8,7 @@ import { AvailableFeature, FunnelStep, InsightType } from '~/types' import './Experiment.scss' import { experimentLogic, ExperimentLogicProps } from './experimentLogic' import { IconDelete, IconPlusMini } from 'lib/lemon-ui/icons' +// eslint-disable-next-line no-restricted-imports import { CloseOutlined } from '@ant-design/icons' import { CopyToClipboardInline } from 'lib/components/CopyToClipboard' import { dayjs } from 'lib/dayjs' diff --git a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx index b84b8f875ee8b..747a093413c06 100644 --- a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx +++ b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx @@ -1,4 +1,5 @@ import { useActions, useValues } from 'kea' +// eslint-disable-next-line no-restricted-imports import { PlusCircleOutlined, ThunderboltFilled } from '@ant-design/icons' import { IconErrorOutline, IconInfo, IconOpenInNew, IconPlus } from 'lib/lemon-ui/icons' import { entityFilterLogic } from 'scenes/insights/filters/ActionFilter/entityFilterLogic' diff --git a/frontend/src/scenes/insights/filters/RetentionReferencePicker.tsx b/frontend/src/scenes/insights/filters/RetentionReferencePicker.tsx index be670f9abc8c5..a5f9d72f2b649 100644 --- a/frontend/src/scenes/insights/filters/RetentionReferencePicker.tsx +++ b/frontend/src/scenes/insights/filters/RetentionReferencePicker.tsx @@ -1,4 +1,5 @@ import { Select } from 'antd' +// eslint-disable-next-line no-restricted-imports import { PercentageOutlined } from '@ant-design/icons' import { insightLogic } from 'scenes/insights/insightLogic' import { useActions, useValues } from 'kea' diff --git a/frontend/src/scenes/insights/views/Funnels/FunnelCorrelationSkewWarning.tsx b/frontend/src/scenes/insights/views/Funnels/FunnelCorrelationSkewWarning.tsx index 3b62284e9ec2c..587c33aefa508 100644 --- a/frontend/src/scenes/insights/views/Funnels/FunnelCorrelationSkewWarning.tsx +++ b/frontend/src/scenes/insights/views/Funnels/FunnelCorrelationSkewWarning.tsx @@ -4,6 +4,7 @@ import { Card } from 'antd' import { insightLogic } from 'scenes/insights/insightLogic' import { IconFeedback } from 'lib/lemon-ui/icons' +// eslint-disable-next-line no-restricted-imports import { CloseOutlined } from '@ant-design/icons' import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic' diff --git a/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx b/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx index b53ba5ac1b304..d66db5a0855f9 100644 --- a/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx +++ b/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx @@ -1,11 +1,13 @@ import { useActions, useValues } from 'kea' -import { ClockCircleOutlined, LineChartOutlined, FunnelPlotOutlined } from '@ant-design/icons' +// eslint-disable-next-line no-restricted-imports +import { ClockCircleOutlined, LineChartOutlined } from '@ant-design/icons' import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic' import { FunnelVizType as VizType, EditorFilterProps } from '~/types' import { DropdownSelector } from 'lib/components/DropdownSelector/DropdownSelector' import { FunnelsFilter } from '~/queries/schema' +import { IconFunnels } from '@posthog/icons' export function FunnelVizType({ insightProps }: Pick): JSX.Element | null { const { aggregationTargetLabel } = useValues(funnelDataLogic(insightProps)) @@ -19,7 +21,7 @@ export function FunnelVizType({ insightProps }: Pick, + icon: , }, { key: VizType.TimeToConvert, diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx b/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx index 901839a9601a2..ba2ec9f539329 100644 --- a/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx +++ b/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx @@ -1,5 +1,6 @@ import { useValues, useActions } from 'kea' import { Dropdown, Menu } from 'antd' +// eslint-disable-next-line no-restricted-imports import { DownOutlined } from '@ant-design/icons' import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel' diff --git a/frontend/src/scenes/insights/views/Paths/PathStepPicker.tsx b/frontend/src/scenes/insights/views/Paths/PathStepPicker.tsx index 737a5c5975af0..74fcf78ea4515 100644 --- a/frontend/src/scenes/insights/views/Paths/PathStepPicker.tsx +++ b/frontend/src/scenes/insights/views/Paths/PathStepPicker.tsx @@ -1,5 +1,6 @@ import { useActions, useValues } from 'kea' import { Select } from 'antd' +// eslint-disable-next-line no-restricted-imports import { BarsOutlined } from '@ant-design/icons' import { ANTD_TOOLTIP_PLACEMENTS } from 'lib/utils' diff --git a/frontend/src/scenes/persons/NewPropertyComponent.tsx b/frontend/src/scenes/persons/NewPropertyComponent.tsx index 0459b20e36517..ccef80b506090 100644 --- a/frontend/src/scenes/persons/NewPropertyComponent.tsx +++ b/frontend/src/scenes/persons/NewPropertyComponent.tsx @@ -1,5 +1,6 @@ import { useState } from 'react' import { Input, Radio } from 'antd' +// eslint-disable-next-line no-restricted-imports import { SaveOutlined, StopOutlined, CheckOutlined } from '@ant-design/icons' import Modal from 'antd/lib/modal/Modal' import { LemonButton } from 'lib/lemon-ui/LemonButton' diff --git a/frontend/src/scenes/persons/PersonScene.tsx b/frontend/src/scenes/persons/PersonScene.tsx index eaf3f7643c93e..0b42216549f38 100644 --- a/frontend/src/scenes/persons/PersonScene.tsx +++ b/frontend/src/scenes/persons/PersonScene.tsx @@ -1,4 +1,5 @@ import { Dropdown, Menu, Tag } from 'antd' +// eslint-disable-next-line no-restricted-imports import { DownOutlined } from '@ant-design/icons' import { useActions, useValues } from 'kea' import { personsLogic } from './personsLogic' diff --git a/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx b/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx index a37c965436e06..0372b12afd83b 100644 --- a/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx +++ b/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx @@ -1,5 +1,4 @@ import { useMemo } from 'react' -import { CheckOutlined } from '@ant-design/icons' import { Tooltip, Radio, InputNumber } from 'antd' import { ChildFunctionProps, Form } from 'kea-forms' import { Field } from 'lib/forms/Field' @@ -16,6 +15,7 @@ import { formatDate, formatDateRange } from 'lib/utils' import { DatePicker } from 'lib/components/DatePicker' import { CodeEditor } from 'lib/components/CodeEditors' import { IconClose, IconPlayCircle, IconSettings } from 'lib/lemon-ui/icons' +import { IconCheck } from '@posthog/icons' // keep in sync with plugin-server's export-historical-events.ts export const HISTORICAL_EXPORT_JOB_NAME = 'Export historical events' @@ -126,7 +126,7 @@ function FieldInput({ onChange={(e) => onChange(e.target.value)} > - True + True False diff --git a/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx b/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx index 1b978f0bbb47b..4d0bc00644da6 100644 --- a/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx +++ b/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx @@ -1,6 +1,6 @@ import { LemonButton, Link } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' -import { IconCheckmark, IconCloudDownload, IconDelete, IconReplay } from 'lib/lemon-ui/icons' +import { IconCheckmark, IconCloudDownload, IconDelete, IconReplay, IconWeb } from 'lib/lemon-ui/icons' import { PluginImage } from 'scenes/plugins/plugin/PluginImage' import { pluginsLogic } from 'scenes/plugins/pluginsLogic' import { PluginTypeWithConfig, PluginRepositoryEntry, PluginInstallationType } from 'scenes/plugins/types' @@ -8,7 +8,6 @@ import { PluginType } from '~/types' import { PluginTags } from './components' import { Tooltip } from 'lib/lemon-ui/Tooltip' import { Popconfirm } from 'antd' -import { GlobalOutlined } from '@ant-design/icons' import { canGloballyManagePlugins } from 'scenes/plugins/access' import { userLogic } from 'scenes/userLogic' @@ -111,7 +110,7 @@ export function AppManagementView({ } + icon={} onClick={() => patchPlugin(plugin.id, { is_global: true })} > Make global diff --git a/frontend/src/scenes/project/Settings/TeamMembers.tsx b/frontend/src/scenes/project/Settings/TeamMembers.tsx index bd2a76793aff1..9fe4add45ea5d 100644 --- a/frontend/src/scenes/project/Settings/TeamMembers.tsx +++ b/frontend/src/scenes/project/Settings/TeamMembers.tsx @@ -1,5 +1,6 @@ import { useValues, useActions } from 'kea' import { MINIMUM_IMPLICIT_ACCESS_LEVEL, teamMembersLogic } from './teamMembersLogic' +// eslint-disable-next-line no-restricted-imports import { CloseCircleOutlined, LogoutOutlined, CrownFilled } from '@ant-design/icons' import { humanFriendlyDetailedTime } from 'lib/utils' import { OrganizationMembershipLevel, TeamMembershipLevel } from 'lib/constants'