-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/drop-constraint-for-well-known-users
- Loading branch information
Showing
72 changed files
with
1,540 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+165 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-historical-trends-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-180 Bytes
(100%)
...tend/__snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+513 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+87 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-time-to-convert-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-83 Bytes
(100%)
...tend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-92 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+209 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--stickiness-edit--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.43 KB
(110%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-filtering-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.4 KB
(110%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-landing-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+112 KB
...tend/__snapshots__/scenes-app-pipeline--pipeline-transformations-page-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+69.9 KB
(230%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-transformations-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
frontend/src/layout/navigation-3000/sidepanel/components/SidePanelPane.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { LemonButton, Tooltip } from '@posthog/lemon-ui' | ||
import { useActions } from 'kea' | ||
import { IconClose } from 'lib/lemon-ui/icons' | ||
import { sidePanelStateLogic } from '../sidePanelStateLogic' | ||
|
||
export function SidePanelPaneHeader({ children }: { children: React.ReactNode }): JSX.Element { | ||
const { closeSidePanel } = useActions(sidePanelStateLogic) | ||
|
||
return ( | ||
<header className="border-b flex-0 p-1 flex items-center justify-end gap-1 h-10"> | ||
{children} | ||
<Tooltip placement="bottomRight" title="Close this side panel"> | ||
<LemonButton size="small" sideIcon={<IconClose />} onClick={() => closeSidePanel()} /> | ||
</Tooltip> | ||
</header> | ||
) | ||
} |
99 changes: 92 additions & 7 deletions
99
frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelDocs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,98 @@ | ||
import { useValues } from 'kea' | ||
import { sidePanelDocsLogic } from './sidePanelDocsLogic' | ||
import { useActions, useValues } from 'kea' | ||
import { POSTHOG_WEBSITE_ORIGIN, sidePanelDocsLogic } from './sidePanelDocsLogic' | ||
import { useEffect, useRef, useState } from 'react' | ||
import clsx from 'clsx' | ||
import { SidePanelPaneHeader } from '../components/SidePanelPane' | ||
import { LemonButton, LemonSkeleton } from '@posthog/lemon-ui' | ||
import { IconExternal } from '@posthog/icons' | ||
import { themeLogic } from '../../themeLogic' | ||
|
||
function SidePanelDocsSkeleton(): JSX.Element { | ||
return ( | ||
<div className="absolute inset-0 p-4 space-y-2"> | ||
<LemonSkeleton className="w-full h-10 mb-12" /> | ||
<LemonSkeleton className="w-1/3 h-8" /> | ||
<LemonSkeleton className="w-1/2 h-4 mb-10" /> | ||
<LemonSkeleton className="w-full h-4" /> | ||
<LemonSkeleton className="w-full h-4 opacity-80" /> | ||
<LemonSkeleton className="w-full h-4 opacity-60" /> | ||
<LemonSkeleton className="w-full h-4 opacity-40" /> | ||
<LemonSkeleton className="w-1/2 h-4 opacity-20" /> | ||
</div> | ||
) | ||
} | ||
|
||
export const SidePanelDocs = (): JSX.Element => { | ||
const { path } = useValues(sidePanelDocsLogic) | ||
const { iframeSrc, currentUrl } = useValues(sidePanelDocsLogic) | ||
const { updatePath, unmountIframe, closeSidePanel, handleExternalUrl } = useActions(sidePanelDocsLogic) | ||
const ref = useRef<HTMLIFrameElement>(null) | ||
const [ready, setReady] = useState(false) | ||
const { isDarkModeOn } = useValues(themeLogic) | ||
|
||
useEffect(() => { | ||
ref.current?.contentWindow?.postMessage( | ||
{ | ||
type: 'theme-toggle', | ||
isDarkModeOn, | ||
}, | ||
'*' | ||
) | ||
}, [isDarkModeOn, ref.current]) | ||
|
||
useEffect(() => { | ||
const onMessage = (event: MessageEvent): void => { | ||
if (event.origin === POSTHOG_WEBSITE_ORIGIN) { | ||
if (event.data.type === 'internal-navigation') { | ||
updatePath(event.data.url) | ||
return | ||
} | ||
if (event.data.type === 'docs-ready') { | ||
setReady(true) | ||
return | ||
} | ||
|
||
if (event.data.type === 'external-navigation') { | ||
// This should only be triggered for app|eu.posthog.com links | ||
handleExternalUrl(event.data.url) | ||
return | ||
} | ||
|
||
console.warn('Unhandled iframe message from Docs:', event.data) | ||
} | ||
} | ||
|
||
window.addEventListener('message', onMessage) | ||
|
||
return () => window.removeEventListener('message', onMessage) | ||
}, [ref.current]) | ||
|
||
useEffect(() => { | ||
window.addEventListener('beforeunload', unmountIframe) | ||
|
||
return () => { | ||
window.removeEventListener('beforeunload', unmountIframe) | ||
unmountIframe() | ||
} | ||
}, []) | ||
|
||
// NOTE: Currently we can't detect url changes from the iframe | ||
return ( | ||
<div className="w-full h-full overflow-hidden"> | ||
<iframe src={`https://posthog.com${path ?? ''}`} title="Docs" className="w-full h-full" /> | ||
</div> | ||
<> | ||
<SidePanelPaneHeader> | ||
<LemonButton | ||
size="small" | ||
sideIcon={<IconExternal />} | ||
to={currentUrl} | ||
targetBlank | ||
onClick={() => closeSidePanel()} | ||
> | ||
Open in new tab | ||
</LemonButton> | ||
</SidePanelPaneHeader> | ||
<div className="relative flex-1"> | ||
<iframe src={iframeSrc} title="Docs" className={clsx('w-full h-full', !ready && 'hidden')} ref={ref} /> | ||
|
||
{!ready && <SidePanelDocsSkeleton />} | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.