Skip to content

Commit

Permalink
chore: stop people using new antd icons (#18494)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Nov 8, 2023
1 parent ec71894 commit 74d6351
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/CloseButton.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/ObjectTags/ObjectTags.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down Expand Up @@ -88,7 +87,7 @@ function RowActionsCreator(
title={`Permanently delete key "${personalAPIKey.label}"?`}
okText="Delete Key"
okType="danger"
icon={<ExclamationCircleOutlined style={{ color: 'var(--danger)' }} />}
icon={<IconErrorOutline style={{ color: 'var(--danger)' }} />}
placement="left"
onConfirm={() => {
deleteKey(personalAPIKey)
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/components/SelectGradientOverflow.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/lib/components/TZLabel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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'
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'
Expand Down Expand Up @@ -67,7 +68,7 @@ const TZLabelPopoverContent = React.memo(function TZLabelPopoverContent({
{currentTeam?.timezone !== 'UTC' && (
<div className="TZLabelPopover__row">
<div>
<GlobalOutlined /> UTC
<IconWeb /> UTC
</div>
<div />
<div>{time.tz('UTC').format(DATE_OUTPUT_FORMAT)}</div>
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/scenes/PreflightCheck/PreflightCheck.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand All @@ -27,7 +26,7 @@ export const scene: SceneExport = {

function PreflightCheckIcon({ status, loading }: { status: PreflightCheckStatus; loading?: boolean }): JSX.Element {
if (loading) {
return <LoadingOutlined style={{ color: 'var(--primary)' }} />
return <Spinner textColored className="text-primary" />
}
if (status === 'validated') {
return <IconCheckCircleOutline />
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/dashboard/dashboards/NoDashboards.tsx
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down Expand Up @@ -89,7 +88,7 @@ export function DataWarehouseSettingsScene(): JSX.Element {
<div className="flex flex-row justify-end">
{sourceReloadingById[source.id] ? (
<div>
<LoadingOutlined />
<Spinner />
</div>
) : (
<div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/experiments/Experiment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/scenes/insights/views/Funnels/FunnelVizType.tsx
Original file line number Diff line number Diff line change
@@ -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<EditorFilterProps, 'insightProps'>): JSX.Element | null {
const { aggregationTargetLabel } = useValues(funnelDataLogic(insightProps))
Expand All @@ -19,7 +21,7 @@ export function FunnelVizType({ insightProps }: Pick<EditorFilterProps, 'insight
key: VizType.Steps,
label: 'Conversion steps',
description: `Track ${aggregationTargetLabel.plural} progress between steps of the funnel`,
icon: <FunnelPlotOutlined />,
icon: <IconFunnels />,
},
{
key: VizType.TimeToConvert,
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/persons/NewPropertyComponent.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/persons/PersonScene.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -126,7 +126,7 @@ function FieldInput({
onChange={(e) => onChange(e.target.value)}
>
<Radio.Button value={true} defaultChecked>
<CheckOutlined /> True
<IconCheck /> True
</Radio.Button>
<Radio.Button value={false}>
<IconClose /> False
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/scenes/plugins/tabs/apps/AppManagementView.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
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'
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'

Expand Down Expand Up @@ -111,7 +110,7 @@ export function AppManagementView({
<LemonButton
type="secondary"
size="small"
icon={<GlobalOutlined />}
icon={<IconWeb />}
onClick={() => patchPlugin(plugin.id, { is_global: true })}
>
Make global
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/project/Settings/TeamMembers.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 74d6351

Please sign in to comment.