Skip to content

Commit

Permalink
feat(web-analytics): Add web analytics to posthog3000 (#18194)
Browse files Browse the repository at this point in the history
* Add web analytics to posthog 3000

* Use IconPieChart for web analytics
  • Loading branch information
robbie-c authored Oct 26, 2023
1 parent 15e3e85 commit 09def82
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
24 changes: 17 additions & 7 deletions frontend/src/layout/navigation-3000/navigationLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ import { sceneLogic } from 'scenes/sceneLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import {
IconHome,
IconApps,
IconDashboard,
IconDatabase,
IconApps,
IconGraph,
IconHome,
IconLive,
IconPeople,
IconPerson,
IconPieChart,
IconQuestion,
IconPeople,
IconRewindPlay,
IconTestTube,
IconToggle,
IconRewindPlay,
IconGraph,
IconToolbar,
IconLive,
} from '@posthog/icons'
import { urls } from 'scenes/urls'
import { annotationsSidebarLogic } from './sidebars/annotations'
Expand All @@ -36,6 +37,7 @@ import { featureFlagsSidebarLogic } from './sidebars/featureFlags'
import { insightsSidebarLogic } from './sidebars/insights'
import { personsAndGroupsSidebarLogic } from './sidebars/personsAndGroups'
import { toolbarSidebarLogic } from './sidebars/toolbar'
import { isNotNil } from 'lib/utils'

/** Multi-segment item keys are joined using this separator for easy comparisons. */
export const ITEM_KEY_PART_SEPARATOR = '::'
Expand Down Expand Up @@ -330,6 +332,14 @@ export const navigation3000Logic = kea<navigation3000LogicType>([
logic: isUsingSidebar ? insightsSidebarLogic : undefined,
to: isUsingSidebar ? undefined : urls.savedInsights(),
},
featureFlags[FEATURE_FLAGS.WEB_ANALYTICS]
? {
identifier: Scene.WebAnalytics,
label: 'Web Analytics',
icon: <IconPieChart />,
to: isUsingSidebar ? undefined : urls.webAnalytics(),
}
: null,
{
identifier: Scene.Replay,
label: 'Session Replay',
Expand Down Expand Up @@ -357,7 +367,7 @@ export const navigation3000Logic = kea<navigation3000LogicType>([
logic: isUsingSidebar ? toolbarSidebarLogic : undefined,
to: isUsingSidebar ? undefined : urls.toolbarLaunch(),
},
],
].filter(isNotNil),
[
{
identifier: Scene.Apps,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@medv/finder": "^2.1.0",
"@microlink/react-json-view": "^1.21.3",
"@monaco-editor/react": "4.4.6",
"@posthog/icons": "0.1.4",
"@posthog/icons": "0.1.21",
"@posthog/plugin-scaffold": "^1.4.3",
"@react-hook/size": "^2.1.2",
"@rrweb/types": "^2.0.0-alpha.11",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 09def82

Please sign in to comment.