Skip to content

Commit

Permalink
chore: lint all links
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Oct 26, 2023
1 parent 539f063 commit 6b6cd8c
Show file tree
Hide file tree
Showing 41 changed files with 231 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { KEY_MAPPING, keyMappingKeys } from 'lib/taxonomy'
import { PropertyKeyInfo } from '../PropertyKeyInfo'
import { Dropdown, Input, Menu, Popconfirm } from 'antd'
import { isURL } from 'lib/utils'
import { IconDeleteForever, IconOpenInNew } from 'lib/lemon-ui/icons'
import { IconDeleteForever } from 'lib/lemon-ui/icons'
import './PropertiesTable.scss'
import { LemonTable, LemonTableColumns, LemonTableProps } from 'lib/lemon-ui/LemonTable'
import { CopyToClipboardInline } from '../CopyToClipboard'
Expand Down Expand Up @@ -93,9 +93,8 @@ function ValueDisplay({
{!isURL(value) ? (
valueString
) : (
<Link to={value} target="_blank" className="value-link">
<span>{valueString}</span>
<IconOpenInNew />
<Link to={value} target="_blank" className="value-link" targetBlankIcon>
{valueString}
</Link>
)}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { dayjs } from 'lib/dayjs'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect'
import { subscriptionLogic } from '../subscriptionLogic'
import { UserActivityIndicator } from 'lib/components/UserActivityIndicator/UserActivityIndicator'
import { IconChevronLeft, IconOpenInNew } from 'lib/lemon-ui/icons'
import { IconChevronLeft } from 'lib/lemon-ui/icons'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { subscriptionsLogic } from '../subscriptionsLogic'
import {
Expand Down Expand Up @@ -162,8 +162,9 @@ export function EditSubscription({
to="https://posthog.com/docs/configuring-posthog/environment-variables?utm_medium=in-product&utm_campaign=subcriptions-system-status-site-url-misconfig"
target="_blank"
rel="noopener"
targetBlankIcon
>
Learn more <IconOpenInNew />
Learn more
</Link>
</>
</LemonBanner>
Expand All @@ -188,9 +189,9 @@ export function EditSubscription({
to="https://posthog.com/docs/self-host/configure/email"
target="_blank"
rel="noopener"
targetBlankIcon
>
configured&nbsp;to&nbsp;send&nbsp;emails&nbsp;
<IconOpenInNew />
</Link>
.
</>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/annotations/Annotations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LemonTable, LemonTableColumns, LemonTableColumn } from 'lib/lemon-ui/Le
import { createdAtColumn } from 'lib/lemon-ui/LemonTable/columnUtils'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag'
import { IconEdit, IconOpenInNew } from 'lib/lemon-ui/icons'
import { IconEdit } from 'lib/lemon-ui/icons'
import { Link } from '@posthog/lemon-ui'
import { urls } from 'scenes/urls'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
Expand Down Expand Up @@ -80,9 +80,9 @@ export function Annotations(): JSX.Element {
to={urls.insightView(annotation.insight_short_id as InsightShortId)}
className="flex items-center"
target="_blank"
targetBlankIcon
>
{scopeName}
<IconOpenInNew className="ml-1" />
</Link>
) : (
scopeName
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/scenes/data-warehouse/DataWarehouseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useActions, useValues } from 'kea'
import { Form } from 'kea-forms'
import { PageHeader } from 'lib/components/PageHeader'
import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { LemonButton, LemonDivider, LemonInput, LemonSelect } from '@posthog/lemon-ui'
import { LemonButton, LemonDivider, LemonInput, LemonSelect, Link } from '@posthog/lemon-ui'
import { router } from 'kea-router'
import { urls } from 'scenes/urls'
import { Field } from 'lib/forms/Field'
Expand Down Expand Up @@ -61,12 +61,12 @@ export function TableForm({ id }: { id: string }): JSX.Element {
caption={
<div>
External tables are supported through object storage systems like S3.{' '}
<a
href="https://posthog.com/docs/data/data-warehouse#step-1-creating-a-bucket-in-s3"
<Link
to="https://posthog.com/docs/data/data-warehouse#step-1-creating-a-bucket-in-s3"
target="_blank"
>
Learn how to set up your data
</a>
</Link>
</div>
}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonTag } from '@posthog/lemon-ui'
import { LemonButton, LemonTag, Link } from '@posthog/lemon-ui'
import { PageHeader } from 'lib/components/PageHeader'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
Expand Down Expand Up @@ -43,11 +43,11 @@ export function DataWarehouseExternalScene(): JSX.Element {
caption={
<div>
These are external data sources you can query under SQL insights with{' '}
<a href="https://posthog.com/manual/hogql" target="_blank">
<Link to="https://posthog.com/manual/hogql" target="_blank">
HogQL
</a>
</Link>
. Connect your own tables from S3 to query data from outside posthog.{' '}
<a href="https://posthog.com/docs/data/data-warehouse">Learn more</a>
<Link to="https://posthog.com/docs/data/data-warehouse">Learn more</Link>
</div>
}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonTag } from '@posthog/lemon-ui'
import { LemonButton, LemonTag, Link } from '@posthog/lemon-ui'
import { PageHeader } from 'lib/components/PageHeader'
import { SceneExport } from 'scenes/sceneTypes'
import { databaseSceneLogic } from 'scenes/data-management/database/databaseSceneLogic'
Expand Down Expand Up @@ -32,9 +32,9 @@ export function DataWarehousePosthogScene(): JSX.Element {
caption={
<div>
These are the database tables you can query under SQL insights with{' '}
<a href="https://posthog.com/manual/hogql" target="_blank">
<Link to="https://posthog.com/manual/hogql" target="_blank">
HogQL
</a>
</Link>
.
</div>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonTag } from '@posthog/lemon-ui'
import { LemonButton, LemonTag, Link } from '@posthog/lemon-ui'
import { PageHeader } from 'lib/components/PageHeader'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
Expand Down Expand Up @@ -49,9 +49,9 @@ export function DataWarehouseSavedQueriesScene(): JSX.Element {
caption={
<div>
These are the saved views you can query under SQL insights with{' '}
<a href="https://posthog.com/manual/hogql" target="_blank">
<Link to="https://posthog.com/manual/hogql" target="_blank">
HogQL
</a>
</Link>
. Views can be used as tables in other queries.
</div>
}
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/scenes/early-access-features/EarlyAccessFeature.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonDivider, LemonInput, LemonSkeleton, LemonTag, LemonTextArea } from '@posthog/lemon-ui'
import { LemonButton, LemonDivider, LemonInput, LemonSkeleton, LemonTag, LemonTextArea, Link } from '@posthog/lemon-ui'
import { BindLogic, useActions, useValues } from 'kea'
import { PageHeader } from 'lib/components/PageHeader'
import { Field, PureField } from 'lib/forms/Field'
Expand Down Expand Up @@ -326,9 +326,9 @@ export function PersonList({ earlyAccessFeature }: PersonListProps): JSX.Element
emptyState={
<div>
No manual opt-ins. Manually opted-in people will appear here. Start by{' '}
<a onClick={toggleImplementOptInInstructionsModal}>
<Link onClick={toggleImplementOptInInstructionsModal}>
implementing public opt-in
</a>
</Link>
</div>
}
/>
Expand All @@ -350,9 +350,9 @@ export function PersonList({ earlyAccessFeature }: PersonListProps): JSX.Element
emptyState={
<div>
No manual opt-outs. Manually opted-out people will appear here. Start by{' '}
<a onClick={toggleImplementOptInInstructionsModal}>
<Link onClick={toggleImplementOptInInstructionsModal}>
implementing public opt-out
</a>
</Link>
</div>
}
/>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/scenes/experiments/Experiment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,13 @@ export function Experiment(): JSX.Element {
Ensure that you're using the latest PostHog client libraries, and make
sure you manually send feature flag information for server-side
libraries if necessary.{' '}
<a
href="https://posthog.com/docs/integrate/server/python#capture"
<Link
to="https://posthog.com/docs/integrate/server/python#capture"
target="_blank"
>
{' '}
Read the docs for how to do this for server-side libraries.
</a>
</Link>
</LemonBanner>
)}

Expand Down Expand Up @@ -660,10 +660,10 @@ export function Experiment(): JSX.Element {
{significanceBannerDetails}{' '}
{experiment?.end_date ? '' : "We don't recommend ending this experiment yet."} See
our{' '}
<a href="https://posthog.com/docs/user-guides/experimentation#funnel-experiment-calculations">
<Link to="https://posthog.com/docs/user-guides/experimentation#funnel-experiment-calculations">
{' '}
experimentation guide{' '}
</a>
</Link>
for more information.{' '}
</Col>
<Col span={1}>
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/scenes/feature-flags/FeatureFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { featureFlagLogic } from './featureFlagLogic'
import { featureFlagLogic as enabledFeaturesLogic } from 'lib/logic/featureFlagLogic'
import { PageHeader } from 'lib/components/PageHeader'
import './FeatureFlag.scss'
import { IconOpenInNew, IconDelete, IconPlus, IconUnfoldLess, IconUnfoldMore } from 'lib/lemon-ui/icons'
import { IconDelete, IconPlus, IconUnfoldLess, IconUnfoldMore } from 'lib/lemon-ui/icons'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { SceneExport } from 'scenes/sceneTypes'
import { UTM_TAGS } from 'scenes/feature-flags/FeatureFlagSnippets'
Expand Down Expand Up @@ -263,14 +263,15 @@ export function FeatureFlag({ id }: { id?: string } = {}): JSX.Element {
hasKeyChanged && id !== 'new' ? (
<span className="text-warning">
<b>Warning! </b>Changing this key will
<a
href={`https://posthog.com/docs/features/feature-flags${UTM_TAGS}#feature-flag-persistence`}
<Link
to={`https://posthog.com/docs/features/feature-flags${UTM_TAGS}#feature-flag-persistence`}
target="_blank"
rel="noopener"
targetBlankIcon
>
{' '}
affect the persistence of your flag <IconOpenInNew />
</a>
affect the persistence of your flag
</Link>
</span>
) : undefined
}
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/scenes/feature-flags/FeatureFlagInstructions.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useEffect, useState } from 'react'
import { useActions, useValues } from 'kea'
import { IconInfo, IconOpenInNew } from 'lib/lemon-ui/icons'
import { IconInfo } from 'lib/lemon-ui/icons'
import './FeatureFlagInstructions.scss'
import { LemonCheckbox, LemonSelect } from '@posthog/lemon-ui'
import { LemonCheckbox, LemonSelect, Link } from '@posthog/lemon-ui'
import { FeatureFlagType } from '~/types'
import {
BOOTSTRAPPING_OPTIONS,
Expand All @@ -24,9 +24,15 @@ function FeatureFlagInstructionsFooter({ documentationLink }: { documentationLin
return (
<div className="mt-4">
Need more information?{' '}
<a data-attr="feature-flag-doc-link" target="_blank" rel="noopener" href={documentationLink}>
Check the docs <IconOpenInNew />
</a>
<Link
data-attr="feature-flag-doc-link"
target="_blank"
rel="noopener"
to={documentationLink}
targetBlankIcon
>
Check the docs
</Link>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { INSTANTLY_AVAILABLE_PROPERTIES } from 'lib/constants'
import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag'
import { allOperatorsToHumanName } from 'lib/components/DefinitionPopover/utils'
import { cohortsModel } from '~/models/cohortsModel'
import { LemonSelect } from '@posthog/lemon-ui'
import { LemonSelect, Link } from '@posthog/lemon-ui'
import { isPropertyFilterWithOperator } from 'lib/components/PropertyFilters/utils'
import clsx from 'clsx'

Expand Down Expand Up @@ -126,10 +126,10 @@ export function FeatureFlagReleaseConditions({
These properties aren't immediately available on first page load for unidentified persons.
This feature flag requires that at least one event is sent prior to becoming available to
your product or website.{' '}
<a href="https://posthog.com/docs/integrate/client/js#bootstrapping-flags" target="_blank">
<Link to="https://posthog.com/docs/integrate/client/js#bootstrapping-flags" target="_blank">
{' '}
Learn more about how to make feature flags available instantly.
</a>
</Link>
</LemonBanner>
)}

Expand Down Expand Up @@ -159,15 +159,15 @@ export function FeatureFlagReleaseConditions({
) : null}

{property.type === 'cohort' ? (
<a
href={urls.cohort(property.value)}
<Link
to={urls.cohort(property.value)}
target="_blank"
rel="noopener"
className="simple-tag tag-light-blue text-primary-alt display-value"
>
{(property.value && cohortsById[property.value]?.name) ||
`ID ${property.value}`}
</a>
</Link>
) : (
[
...(Array.isArray(property.value) ? property.value : [property.value]),
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/scenes/feedback/InAppFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonCollapse, LemonDivider, LemonModal } from '@posthog/lemon-ui'
import { LemonButton, LemonCollapse, LemonDivider, LemonModal, Link } from '@posthog/lemon-ui'

import { urls } from '@posthog/apps-common'
import { useActions, useValues } from 'kea'
Expand Down Expand Up @@ -143,13 +143,13 @@ export function InAppFeedback(): JSX.Element {
{!eventsLoading && events.length === 0 && (
<div>
No events found.{' '}
<a
<Link
onClick={() => {
toggleInAppFeedbackInstructions()
}}
>
Send feedback
</a>{' '}
</Link>{' '}
to use this feature.
</div>
)}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/scenes/feedback/UserInterviewScheduler.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonCollapse, LemonInput, LemonModal, LemonTextArea } from '@posthog/lemon-ui'
import { LemonButton, LemonCollapse, LemonInput, LemonModal, LemonTextArea, Link } from '@posthog/lemon-ui'

import { urls } from '@posthog/apps-common'
import { useActions, useValues } from 'kea'
Expand Down Expand Up @@ -102,9 +102,9 @@ export function SchedulerInstructions(): JSX.Element {
<div>
<div>
1. Create a custom popup in your webapp or mobile app based on{' '}
<a href="https://github.com/PostHog/user-interview-app/blob/main/site.ts">
<Link to="https://github.com/PostHog/user-interview-app/blob/main/site.ts">
PostHog's open-source popup code
</a>
</Link>
</div>
<div className="ml-4 my-4">
<ul className="list-disc ml-4">
Expand Down
Loading

0 comments on commit 6b6cd8c

Please sign in to comment.