From 59e836f5ab498ee4711a8f88a01ca2747a0e45db Mon Sep 17 00:00:00 2001 From: David Newell Date: Wed, 8 Nov 2023 16:53:47 +0000 Subject: [PATCH] stop people using new antd icons --- .eslintrc.js | 4 ++++ frontend/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 | 1 + frontend/src/lib/components/SelectGradientOverflow.tsx | 3 ++- .../src/lib/components/SmoothingFilter/SmoothingFilter.tsx | 1 + frontend/src/lib/components/TZLabel/index.tsx | 1 + frontend/src/scenes/PreflightCheck/PreflightCheck.tsx | 1 + frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx | 1 + .../data-warehouse/settings/DataWarehouseSettingsScene.tsx | 1 + frontend/src/scenes/experiments/Experiment.tsx | 1 + frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx | 1 + .../src/scenes/insights/filters/RetentionReferencePicker.tsx | 1 + .../insights/views/Funnels/FunnelCorrelationSkewWarning.tsx | 1 + frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx | 1 + .../views/InsightsTable/columns/AggregationColumn.tsx | 1 + frontend/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 | 1 + frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx | 1 + frontend/src/scenes/project/Settings/TeamMembers.tsx | 1 + 23 files changed, 27 insertions(+), 1 deletion(-) 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..feb57ffc62a1b 100644 --- a/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx +++ b/frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx @@ -1,6 +1,7 @@ import { useState, useCallback, Dispatch, SetStateAction } from 'react' import { Table, Popconfirm } from 'antd' import { useActions, useValues } from 'kea' +// eslint-disable-next-line no-restricted-imports import { ExclamationCircleOutlined } from '@ant-design/icons' import { personalAPIKeysLogic } from './personalAPIKeysLogic' import { PersonalAPIKeyType } from '~/types' 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..89be79db137af 100644 --- a/frontend/src/lib/components/TZLabel/index.tsx +++ b/frontend/src/lib/components/TZLabel/index.tsx @@ -1,5 +1,6 @@ import './index.scss' import { useActions, useValues } from 'kea' +// eslint-disable-next-line no-restricted-imports import { ProjectOutlined, LaptopOutlined, GlobalOutlined } from '@ant-design/icons' import { humanFriendlyDetailedTime, shortTimeZone } from 'lib/utils' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' diff --git a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx index 0dc09b3607e8f..b700cebc8832f 100644 --- a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx +++ b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx @@ -1,4 +1,5 @@ import { useValues, useActions } from 'kea' +// eslint-disable-next-line no-restricted-imports import { LoadingOutlined } from '@ant-design/icons' import { PreflightCheckStatus, PreflightItem, preflightLogic } from './preflightLogic' import './PreflightCheck.scss' 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..ecbc003af1dea 100644 --- a/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx +++ b/frontend/src/scenes/data-warehouse/settings/DataWarehouseSettingsScene.tsx @@ -8,6 +8,7 @@ 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' +// eslint-disable-next-line no-restricted-imports import { LoadingOutlined } from '@ant-design/icons' export const scene: SceneExport = { 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..5518e695cbdbc 100644 --- a/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx +++ b/frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx @@ -1,4 +1,5 @@ import { useActions, useValues } from 'kea' +// eslint-disable-next-line no-restricted-imports import { ClockCircleOutlined, LineChartOutlined, FunnelPlotOutlined } from '@ant-design/icons' import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic' 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..403fbba05114b 100644 --- a/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx +++ b/frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx @@ -1,4 +1,5 @@ import { useMemo } from 'react' +// eslint-disable-next-line no-restricted-imports import { CheckOutlined } from '@ant-design/icons' import { Tooltip, Radio, InputNumber } from 'antd' import { ChildFunctionProps, Form } from 'kea-forms' diff --git a/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx b/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx index 1b978f0bbb47b..8f838e0e07653 100644 --- a/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx +++ b/frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx @@ -8,6 +8,7 @@ import { PluginType } from '~/types' import { PluginTags } from './components' import { Tooltip } from 'lib/lemon-ui/Tooltip' import { Popconfirm } from 'antd' +// eslint-disable-next-line no-restricted-imports import { GlobalOutlined } from '@ant-design/icons' import { canGloballyManagePlugins } from 'scenes/plugins/access' import { userLogic } from 'scenes/userLogic' 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'