mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
Mechanically re-derived: bin/debrand runs over a fresh import of posthog/posthog@fa1a9a60d4 (2026-08-06). The pipeline (.hanzo/workflows), the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md and the squashed initial migration are restored from the shipped tree, same as the previous import. The prune's import-closure guard kept 21 products the new core now imports; dropping them is a refactor now, recorded rather than forced.
92 lines
4.8 KiB
TypeScript
92 lines
4.8 KiB
TypeScript
import { combineUrl } from 'kea-router'
|
|
import insights from 'insights-js'
|
|
|
|
import { FEATURE_FLAGS } from 'lib/constants'
|
|
import { urls } from 'scenes/urls'
|
|
|
|
import { ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'
|
|
import { ProductManifest } from '~/types'
|
|
|
|
export const manifest: ProductManifest = {
|
|
name: 'Customer analytics',
|
|
scenes: {
|
|
CustomerAnalytics: {
|
|
import: () => import('./frontend/CustomerAnalyticsScene'),
|
|
projectBased: true,
|
|
name: 'Customer analytics',
|
|
description: 'Understand how your customers interact with your product ',
|
|
iconType: 'cohort',
|
|
},
|
|
CustomerAnalyticsConfiguration: {
|
|
import: () =>
|
|
import('./frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene'),
|
|
projectBased: true,
|
|
name: 'Customer analytics configuration',
|
|
},
|
|
CustomerJourneyBuilder: {
|
|
import: () => import('./frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene'),
|
|
projectBased: true,
|
|
name: 'New journey',
|
|
},
|
|
CustomerJourneyTemplates: {
|
|
import: () => import('./frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene'),
|
|
projectBased: true,
|
|
name: 'New journey',
|
|
},
|
|
},
|
|
routes: {
|
|
'/customer_analytics/dashboard': ['CustomerAnalytics', 'customerAnalyticsDashboard'],
|
|
'/customer_analytics/accounts': ['CustomerAnalytics', 'customerAnalyticsAccounts'],
|
|
// Deep-link to a single account (filtered + expanded), optionally on a given tab. Same scene key
|
|
// as the list so the accounts tab activates; accountsLogic reads the params.
|
|
'/customer_analytics/accounts/:accountId': ['CustomerAnalytics', 'customerAnalyticsAccounts'],
|
|
'/customer_analytics/accounts/:accountId/:tab': ['CustomerAnalytics', 'customerAnalyticsAccounts'],
|
|
'/customer_analytics/notes': ['CustomerAnalytics', 'customerAnalyticsNotes'],
|
|
'/customer_analytics/announcements': ['CustomerAnalytics', 'customerAnalyticsAnnouncements'],
|
|
'/customer_analytics/feed': ['CustomerAnalytics', 'customerAnalyticsFeed'],
|
|
'/customer_analytics/journeys/new': ['CustomerJourneyBuilder', 'customerJourneyBuilder'],
|
|
'/customer_analytics/journeys/templates': ['CustomerJourneyTemplates', 'customerJourneyTemplates'],
|
|
'/customer_analytics/journeys/:id/edit': ['CustomerJourneyBuilder', 'customerJourneyEdit'],
|
|
'/customer_analytics/journeys': ['CustomerAnalytics', 'customerAnalyticsJourneys'],
|
|
'/customer_analytics/configuration': ['CustomerAnalyticsConfiguration', 'customerAnalyticsConfiguration'],
|
|
},
|
|
redirects: {
|
|
'/customer_analytics': (_params, searchParams, hashParams) => {
|
|
const defaultTab = insights.getFeatureFlag(FEATURE_FLAGS.CUSTOMER_ANALYTICS_CSP)
|
|
? '/customer_analytics/accounts'
|
|
: '/customer_analytics/dashboard'
|
|
return combineUrl(defaultTab, searchParams, hashParams).url
|
|
},
|
|
},
|
|
urls: {
|
|
customerAnalytics: (): string => '/customer_analytics',
|
|
customerAnalyticsDashboard: (): string => '/customer_analytics/dashboard',
|
|
customerAnalyticsAccounts: (): string => '/customer_analytics/accounts',
|
|
// Path-based deep link to one account: filters the list to it, expands it, opens `tab`.
|
|
customerAnalyticsAccount: (accountId: string, tab?: string): string =>
|
|
`/customer_analytics/accounts/${accountId}${tab ? `/${tab}` : ''}`,
|
|
customerAnalyticsNotes: (): string => '/customer_analytics/notes',
|
|
customerAnalyticsAnnouncements: (): string => '/customer_analytics/announcements',
|
|
customerAnalyticsFeed: (): string => '/customer_analytics/feed',
|
|
customerAnalyticsJourneys: (): string => '/customer_analytics/journeys',
|
|
customerAnalyticsConfiguration: (tab?: string): string =>
|
|
`/customer_analytics/configuration${tab ? `?tab=${tab}` : ''}`,
|
|
customerJourneyBuilder: (): string => '/customer_analytics/journeys/new',
|
|
customerJourneyTemplates: (): string => '/customer_analytics/journeys/templates',
|
|
customerJourneyEdit: (id: string): string => `/customer_analytics/journeys/${id}/edit`,
|
|
},
|
|
treeItemsProducts: [
|
|
{
|
|
path: 'Customer analytics',
|
|
intents: [ProductKey.CUSTOMER_ANALYTICS],
|
|
category: ProductItemCategory.ANALYTICS,
|
|
iconType: 'cohort',
|
|
href: urls.customerAnalytics(),
|
|
tags: ['beta'],
|
|
flag: FEATURE_FLAGS.CUSTOMER_ANALYTICS,
|
|
sceneKey: 'CustomerAnalytics',
|
|
sceneKeys: ['CustomerAnalytics', 'CustomerJourneyTemplates', 'CustomerJourneyBuilder'],
|
|
},
|
|
],
|
|
}
|