Skip to content

Commit

Permalink
chore: Temp disable the auto linking docs (#19442)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Dec 20, 2023
1 parent 3c7575b commit 47a6a1f
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions frontend/src/lib/lemon-ui/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import './Link.scss'

import clsx from 'clsx'
import { useActions } from 'kea'
import { router } from 'kea-router'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { isExternalLink } from 'lib/utils'
import React from 'react'
import { useNotebookDrag } from 'scenes/notebooks/AddToNotebook/DraggableToNotebook'

import { sidePanelDocsLogic } from '~/layout/navigation-3000/sidepanel/panels/sidePanelDocsLogic'

import { IconOpenInNew } from '../icons'
import { Tooltip } from '../Tooltip'

Expand Down Expand Up @@ -54,9 +50,10 @@ const isPostHogDomain = (url: string): boolean => {
return /^https:\/\/((www|app|eu)\.)?posthog\.com/.test(url)
}

const isPostHogComDocs = (url: string): boolean => {
return /^https:\/\/(www\.)?posthog\.com\/docs/.test(url)
}
// NOTE: Temporarily disabled - owner @corywatilo
// const isPostHogComDocs = (url: string): boolean => {
// return /^https:\/\/(www\.)?posthog\.com\/docs/.test(url)
// }

/**
* Link
Expand Down Expand Up @@ -87,8 +84,9 @@ export const Link: React.FC<LinkProps & React.RefAttributes<HTMLElement>> = Reac
href: typeof to === 'string' ? to : undefined,
})

const is3000 = useFeatureFlag('POSTHOG_3000', 'test')
const { openDocsPage } = useActions(sidePanelDocsLogic)
// NOTE: Temporarily disabled - owner @corywatilo
// const is3000 = useFeatureFlag('POSTHOG_3000', 'test')
// const { openDocsPage } = useActions(sidePanelDocsLogic)

const onClick = (event: React.MouseEvent<HTMLElement>): void => {
if (event.metaKey || event.ctrlKey) {
Expand All @@ -103,11 +101,12 @@ export const Link: React.FC<LinkProps & React.RefAttributes<HTMLElement>> = Reac
return
}

if (typeof to === 'string' && is3000 && isPostHogComDocs(to)) {
event.preventDefault()
openDocsPage(to)
return
}
// NOTE: Temporarily disabled - owner @corywatilo
// if (typeof to === 'string' && is3000 && isPostHogComDocs(to)) {
// event.preventDefault()
// openDocsPage(to)
// return
// }

if (!target && to && !isExternalLink(to) && !disableClientSideRouting && !shouldForcePageLoad(to)) {
event.preventDefault()
Expand Down

0 comments on commit 47a6a1f

Please sign in to comment.