Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(frontend): inline Kea types batch 1 (#71455)

Marius Andraee4e1cc8cb64
diff --git a/.kearc b/.kearc
index 5bcbc69a762d..ef9897a9f85a 100644
--- a/.kearc
+++ b/.kearc
@@ -5,7 +5,7 @@
"writePaths": true,
"inlinePaths": [
"./frontend/src/scenes/notebooks",
- "./.kea-inline-batch-01-slot-01",
+ "./frontend/src/lib",
"./.kea-inline-separator-01",
"./.kea-inline-separator-01-b",
"./frontend/src/scenes/StripeConfirmInstall",
diff --git a/frontend/src/lib/approvals/approvalsGateLogic.ts b/frontend/src/lib/approvals/approvalsGateLogic.ts
index e1190381ebff..b43dd335f82b 100644
--- a/frontend/src/lib/approvals/approvalsGateLogic.ts
+++ b/frontend/src/lib/approvals/approvalsGateLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,54 @@ import { userLogic } from 'scenes/userLogic'
import { ApprovalPolicy, AvailableFeature } from '~/types'
-import type { approvalsGateLogicType } from './approvalsGateLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface approvalsGateLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ activePolicies: ApprovalPolicy[]
+ activePoliciesLoading: boolean
+ isApprovalRequired: (actionKey: string) => boolean
+ isApprovalsFeatureEnabled: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface approvalsGateLogicActions {
+ loadActivePolicies: () => any
+ loadActivePoliciesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadActivePoliciesSuccess: (
+ activePolicies: ApprovalPolicy[],
+ payload?: any
+ ) => {
+ activePolicies: ApprovalPolicy[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface approvalsGateLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isApprovalsFeatureEnabled: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ isApprovalRequired: (
+ isApprovalsFeatureEnabled: boolean,
+ activePolicies: ApprovalPolicy[]
+ ) => (actionKey: string) => boolean
+ }
+}
+
+export type approvalsGateLogicType = MakeLogicType<
+ approvalsGateLogicValues,
+ approvalsGateLogicActions,
+ Record<string, any>,
+ approvalsGateLogicMeta
+>
export const approvalsGateLogic = kea<approvalsGateLogicType>([
path(['lib', 'approvals', 'approvalsGateLogic']),
@@ -41,7 +88,8 @@ export const approvalsGateLogic = kea<approvalsGateLogicType>([
selectors({
isApprovalsFeatureEnabled: [
(s) => [s.hasAvailableFeature],
- (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.APPROVALS),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean): boolean =>
+ hasAvailableFeature(AvailableFeature.APPROVALS),
],
isApprovalRequired: [
diff --git a/frontend/src/lib/components/Account/newAccountMenuLogic.ts b/frontend/src/lib/components/Account/newAccountMenuLogic.ts
index d8bd4e2cc055..e96402ddf925 100644
--- a/frontend/src/lib/components/Account/newAccountMenuLogic.ts
+++ b/frontend/src/lib/components/Account/newAccountMenuLogic.ts
@@ -1,6 +1,41 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
-import type { newAccountMenuLogicType } from './newAccountMenuLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface newAccountMenuLogicValues {
+ isAccountMenuOpen: boolean
+ isOrgSwitcherOpen: boolean
+ isProjectSwitcherOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface newAccountMenuLogicActions {
+ closeOrgSwitcher: () => {
+ value: true
+ }
+ closeProjectSwitcher: () => {
+ value: true
+ }
+ openOrgSwitcher: () => {
+ value: true
+ }
+ openProjectSwitcher: () => {
+ value: true
+ }
+ setAccountMenuOpen: (isOpen: boolean) => {
+ isOpen: boolean
+ }
+ toggleAccountMenu: () => {
+ value: true
+ }
+ toggleOrgSwitcher: () => {
+ value: true
+ }
+ toggleProjectSwitcher: () => {
+ value: true
+ }
+}
+
+export type newAccountMenuLogicType = MakeLogicType<newAccountMenuLogicValues, newAccountMenuLogicActions>
export const newAccountMenuLogic = kea<newAccountMenuLogicType>([
path(['lib', 'components', 'Account', 'accountMenuLogic']),
diff --git a/frontend/src/lib/components/Account/pendingInvitesLogic.ts b/frontend/src/lib/components/Account/pendingInvitesLogic.ts
index 487d9ef059b6..77b7b8d6203a 100644
--- a/frontend/src/lib/components/Account/pendingInvitesLogic.ts
+++ b/frontend/src/lib/components/Account/pendingInvitesLogic.ts
@@ -1,19 +1,42 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { userLogic } from 'scenes/userLogic'
import { PendingInviteForCurrentUser } from '~/types'
-import type { pendingInvitesLogicType } from './pendingInvitesLogicType'
+import type { UserType } from '../../../types'
export type { PendingInviteForCurrentUser }
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pendingInvitesLogicValues {
+ user: UserType | null // userLogic
+ pendingInvites: PendingInviteForCurrentUser[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pendingInvitesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ pendingInvites: (user: UserType | null) => PendingInviteForCurrentUser[]
+ }
+}
+
+export type pendingInvitesLogicType = MakeLogicType<
+ pendingInvitesLogicValues,
+ {},
+ Record<string, any>,
+ pendingInvitesLogicMeta
+>
+
export const pendingInvitesLogic = kea<pendingInvitesLogicType>([
path(['lib', 'components', 'Account', 'pendingInvitesLogic']),
connect(() => ({
values: [userLogic, ['user']],
})),
selectors({
- pendingInvites: [(s) => [s.user], (user): PendingInviteForCurrentUser[] => user?.pending_invites ?? []],
+ pendingInvites: [
+ (s) => [s.user],
+ (user: null | import('~/types').UserType): PendingInviteForCurrentUser[] => user?.pending_invites ?? [],
+ ],
}),
])
diff --git a/frontend/src/lib/components/ActivityLog/activityLogLogic.tsx b/frontend/src/lib/components/ActivityLog/activityLogLogic.tsx
index 83bd8f521705..303eb58bdc72 100644
--- a/frontend/src/lib/components/ActivityLog/activityLogLogic.tsx
+++ b/frontend/src/lib/components/ActivityLog/activityLogLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -16,8 +16,6 @@ import { urls } from 'scenes/urls'
import { ActivityScope } from '~/types'
-import type { activityLogLogicType } from './activityLogLogicType'
-
// Define which scopes should be expanded to include multiple scopes
const SCOPE_EXPANSIONS: Partial<Record<ActivityScope, ActivityScope[]>> = {
[ActivityScope.TAG]: [ActivityScope.TAG, ActivityScope.TAGGED_ITEM],
@@ -115,6 +113,65 @@ export type ActivityLogLogicProps = {
startingPage?: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface activityLogLogicValues {
+ activity: ActivityLogPaginatedResponse<ActivityLogItem>
+ activityLoading: boolean
+ highlightedActivityId: string | null
+ humanizedActivity: HumanizedActivityLogItem[]
+ page: number
+ pagination: PaginationManual
+ totalCount: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface activityLogLogicActions {
+ fetchActivity: () => any
+ fetchActivityFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ fetchActivitySuccess: (
+ activity: {
+ count: any
+ results: ActivityLogItem[]
+ },
+ payload?: any
+ ) => {
+ activity: {
+ count: any
+ results: ActivityLogItem[]
+ }
+ payload?: any
+ }
+ setHighlightedActivityId: (id: string | null) => {
+ id: string | null
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface activityLogLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ pagination: (page: number, totalCount: number | null) => PaginationManual
+ humanizedActivity: (activity: ActivityLogPaginatedResponse<ActivityLogItem>) => HumanizedActivityLogItem[]
+ totalCount: (activity: ActivityLogPaginatedResponse<ActivityLogItem>) => number | null
+ }
+}
+
+export type activityLogLogicType = MakeLogicType<
+ activityLogLogicValues,
+ activityLogLogicActions,
+ ActivityLogLogicProps,
+ activityLogLogicMeta
+>
+
export const activityLogLogic = kea<activityLogLogicType>([
props({} as ActivityLogLogicProps),
key(({ scope, id }) => `activity/${Array.isArray(scope) ? scope.join(',') : scope}/${id || 'all'}`),
@@ -155,7 +212,7 @@ export const activityLogLogic = kea<activityLogLogicType>([
selectors(({ actions }) => ({
pagination: [
(s) => [s.page, s.totalCount],
- (page, totalCount): PaginationManual => {
+ (page: number, totalCount: number | null): PaginationManual => {
return {
controlled: true,
pageSize: ACTIVITY_PAGE_SIZE,
@@ -168,13 +225,13 @@ export const activityLogLogic = kea<activityLogLogicType>([
],
humanizedActivity: [
(s) => [s.activity],
- (activity): HumanizedActivityLogItem[] => {
+ (activity: ActivityLogPaginatedResponse<ActivityLogItem>): HumanizedActivityLogItem[] => {
return activity.results ? humanize(activity.results, describerFor) : []
},
],
totalCount: [
(s) => [s.activity],
- (activity): number | null => {
+ (activity: ActivityLogPaginatedResponse<ActivityLogItem>): number | null => {
return activity.count ?? null
},
],
diff --git a/frontend/src/lib/components/AddToDashboard/addToDashboardModalLogic.ts b/frontend/src/lib/components/AddToDashboard/addToDashboardModalLogic.ts
index ecf9ae5f894f..2b7ec89635fd 100644
--- a/frontend/src/lib/components/AddToDashboard/addToDashboardModalLogic.ts
+++ b/frontend/src/lib/components/AddToDashboard/addToDashboardModalLogic.ts
@@ -1,5 +1,5 @@
import FuseClass, { FuseResult } from 'fuse.js'
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { router } from 'kea-router'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -14,11 +14,147 @@ import { userLogic } from 'scenes/userLogic'
import { dashboardsModel, nameCompareFunction } from '~/models/dashboardsModel'
import { DashboardBasicType, DashboardType, InsightLogicProps } from '~/types'
-import type { addToDashboardModalLogicType } from './addToDashboardModalLogicType'
+import type { Node } from '../../../queries/schema/schema-general'
+import type { QueryBasedInsightModel, UserType } from '../../../types'
// Helping kea-typegen navigate the exported default class for Fuse
export interface Fuse extends FuseClass<any> {}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addToDashboardModalLogicValues {
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> // insightLogic
+ user: UserType | null // userLogic
+ _dashboardToNavigateTo: number | null
+ availableDashboards: DashboardBasicType[]
+ currentDashboards: DashboardBasicType[]
+ dashboardWithActiveAPICall: number | null
+ dashboardsFuse: Fuse
+ filteredDashboards: DashboardBasicType[]
+ orderedDashboards: DashboardBasicType[]
+ scrollIndex: number
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addToDashboardModalLogicActions {
+ reportCreatedDashboardFromModal: () => {
+ value: true
+ } // eventUsageLogic
+ reportRemovedInsightFromDashboard: (
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null,
+ dashboardId: number | null
+ ) => {
+ dashboardId: number | null
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ } // eventUsageLogic
+ reportSavedInsightToDashboard: (
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null,
+ dashboardId: number | null
+ ) => {
+ dashboardId: number | null
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ } // eventUsageLogic
+ updateInsight: (
+ insightUpdate: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>,
+ callback?: (() => void) | undefined
+ ) => {
+ callback: (() => void) | undefined
+ insightUpdate: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ } // insightLogic
+ updateInsightFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // insightLogic
+ updateInsightSuccess: (
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>,
+ payload?:
+ | {
+ callback: (() => void) | undefined
+ insightUpdate: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ }
+ | undefined
+ ) => {
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ payload?: {
+ callback: (() => void) | undefined
+ insightUpdate: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ }
+ } // insightLogic
+ showNewDashboardModal: () => {
+ value: true
+ } // newDashboardLogic
+ addNewDashboard: () => {
+ value: true
+ }
+ addToDashboard: (dashboardId: number) => {
+ dashboardId: number
+ }
+ removeFromDashboard: (dashboardId: number) => {
+ dashboardId: number
+ }
+ setDashboardToNavigateTo: (dashboardId: number | null) => {
+ dashboardId: number | null
+ }
+ setScrollIndex: (index: number) => {
+ index: number
+ }
+ setSearchQuery: (query: string) => {
+ query: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addToDashboardModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ dashboardsFuse: (
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ )[]
+ ) => Fuse
+ filteredDashboards: (
+ searchQuery: string,
+ dashboardsFuse: Fuse,
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ )[]
+ ) => DashboardBasicType[]
+ currentDashboards: (
+ filteredDashboards: DashboardBasicType[],
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ ) => DashboardBasicType[]
+ availableDashboards: (
+ filteredDashboards: DashboardBasicType[],
+ currentDashboards: DashboardBasicType[]
+ ) => DashboardBasicType[]
+ orderedDashboards: (
+ currentDashboards: DashboardBasicType[],
+ availableDashboards: DashboardBasicType[],
+ user: UserType | null
+ ) => DashboardBasicType[]
+ }
+ __keaTypeGenInternalReducerActions: {
+ 'add dashboard success (models.dashboardsModel)': (dashboard: DashboardType<QueryBasedInsightModel>) => {
+ payload: {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ }
+ type: 'add dashboard success (models.dashboardsModel)'
+ }
+ }
+}
+
+export type addToDashboardModalLogicType = MakeLogicType<
+ addToDashboardModalLogicValues,
+ addToDashboardModalLogicActions,
+ InsightLogicProps,
+ addToDashboardModalLogicMeta
+>
+
export const addToDashboardModalLogic = kea<addToDashboardModalLogicType>([
props({} as InsightLogicProps),
key(keyForInsightLogicProps('new')),
@@ -64,7 +200,16 @@ export const addToDashboardModalLogic = kea<addToDashboardModalLogicType>([
selectors({
dashboardsFuse: [
() => [dashboardsModel.selectors.nameSortedDashboards],
- (nameSortedDashboards): Fuse => {
+ (
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<
+ import('~/types').QueryBasedInsightModel<
+ import('../../../queries/schema').Node<Record<string, any>>
+ >
+ >
+ )[]
+ ): Fuse => {
return createFuse(nameSortedDashboards || [], {
keys: ['name', 'description', 'tags'],
})
@@ -72,24 +217,46 @@ export const addToDashboardModalLogic = kea<addToDashboardModalLogicType>([
],
filteredDashboards: [
(s) => [s.searchQuery, s.dashboardsFuse, dashboardsModel.selectors.nameSortedDashboards],
- (searchQuery, dashboardsFuse, nameSortedDashboards): DashboardBasicType[] =>
+ (
+ searchQuery: string,
+ dashboardsFuse: Fuse,
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<
+ import('~/types').QueryBasedInsightModel<
+ import('../../../queries/schema').Node<Record<string, any>>
+ >
+ >
+ )[]
+ ): DashboardBasicType[] =>
searchQuery.length
? dashboardsFuse.search(searchQuery).map((r: FuseResult<DashboardType>) => r.item)
: nameSortedDashboards,
],
currentDashboards: [
(s) => [s.filteredDashboards, s.insight],
- (filteredDashboards, insight): DashboardBasicType[] =>
+ (
+ filteredDashboards: DashboardBasicType[],
+ insight: Partial<
+ import('~/types').QueryBasedInsightModel<
+ import('../../../queries/schema').Node<Record<string, any>>
+ >
+ >
+ ): DashboardBasicType[] =>
filteredDashboards.filter((d) => insight.dashboard_tiles?.map((dt) => dt.dashboard_id)?.includes(d.id)),
],
availableDashboards: [
(s) => [s.filteredDashboards, s.currentDashboards],
- (filteredDashboards, currentDashboards): DashboardBasicType[] =>
+ (filteredDashboards: DashboardBasicType[], currentDashboards: DashboardBasicType[]): DashboardBasicType[] =>
filteredDashboards.filter((d) => !currentDashboards?.map((cd) => cd.id).includes(d.id)),
],
orderedDashboards: [
(s) => [s.currentDashboards, s.availableDashboards, userLogic.selectors.user],
- (currentDashboards, availableDashboards, user): DashboardBasicType[] => {
+ (
+ currentDashboards: DashboardBasicType[],
+ availableDashboards: DashboardBasicType[],
+ user: null | import('~/types').UserType
+ ): DashboardBasicType[] => {
const myUuid = user?.uuid ?? null
const currentSorted = [...currentDashboards].sort(nameCompareFunction)
const isMine = (d: DashboardBasicType): boolean => myUuid !== null && d.created_by?.uuid === myUuid
diff --git a/frontend/src/lib/components/Alerting/AlertWizard/alertWizardLogic.ts b/frontend/src/lib/components/Alerting/AlertWizard/alertWizardLogic.ts
index 4ce25bfa96ba..ddda17de02be 100644
--- a/frontend/src/lib/components/Alerting/AlertWizard/alertWizardLogic.ts
+++ b/frontend/src/lib/components/Alerting/AlertWizard/alertWizardLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -22,7 +22,7 @@ import {
PropertyOperator,
} from '~/types'
-import type { alertWizardLogicType } from './alertWizardLogicType'
+import type { CyclotronJobInputSchemaType, HogFunctionSubTemplateType } from '../../../../types'
export enum WizardStep {
Destination = 'destination',
@@ -134,6 +134,194 @@ function extractDestinationKeyFromAlert(alert: HogFunctionType, allDestinations:
return null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface alertWizardLogicValues {
+ activeSubTemplate: HogFunctionSubTemplateType | null
+ alertCreated: boolean
+ alertCreationView: AlertCreationView
+ allDestinations: WizardDestination[]
+ availableTriggers: WizardTrigger[]
+ configuration: {
+ inputs: Record<
+ string,
+ {
+ bytecode?: any
+ order?: number | undefined
+ secret?: boolean | undefined
+ templating?: 'hog' | 'liquid' | undefined
+ value: any
+ }
+ >
+ inputs_schema: CyclotronJobInputSchemaType[]
+ }
+ currentStep: WizardStep
+ existingAlerts: HogFunctionType[]
+ existingAlertsLoading: boolean
+ extraDestinations: WizardDestination[]
+ inputValues: Record<string, CyclotronJobInputType>
+ primaryDestinations: WizardDestination[]
+ requiredInputsSchema: CyclotronJobInputSchemaType[]
+ selectedDestinationKey: string | null
+ selectedKinds: string[] | null
+ selectedTemplate: HogFunctionTemplateType | null
+ selectedTemplateLoading: boolean
+ selectedTriggerKey: HogFunctionSubTemplateIdType | null
+ sortedDestinations: WizardDestination[]
+ subTemplateIds: HogFunctionSubTemplateIdType[]
+ submitting: boolean
+ testing: boolean
+ triggers: WizardTrigger[]
+ usedDestinationKeys: Set<string>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface alertWizardLogicActions {
+ createAlertSuccess: () => {
+ value: true
+ }
+ loadExistingAlerts: () => any
+ loadExistingAlertsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadExistingAlertsSuccess: (
+ existingAlerts: HogFunctionType[],
+ payload?: any
+ ) => {
+ existingAlerts: HogFunctionType[]
+ payload?: any
+ }
+ loadTemplate: (templateId: string) => string
+ loadTemplateFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTemplateSuccess: (
+ selectedTemplate: HogFunctionTemplateType,
+ payload?: string
+ ) => {
+ selectedTemplate: HogFunctionTemplateType
+ payload?: string
+ }
+ resetWizard: () => {
+ value: true
+ }
+ restoreWizardState: (state: {
+ destinationKey: string | null
+ step: WizardStep
+ triggerKey: HogFunctionSubTemplateIdType | null
+ }) => {
+ state: {
+ destinationKey: string | null
+ step: WizardStep
+ triggerKey: HogFunctionSubTemplateIdType | null
+ }
+ }
+ setAlertCreationView: (view: AlertCreationView) => {
+ view: AlertCreationView
+ }
+ setDestinationKey: (destinationKey: string) => {
+ destinationKey: string
+ }
+ setInputValue: (
+ key: string,
+ value: CyclotronJobInputType
+ ) => {
+ key: string
+ value: {
+ bytecode?: any
+ order?: number | undefined
+ secret?: boolean | undefined
+ templating?: 'hog' | 'liquid' | undefined
+ value: any
+ }
+ }
+ setStep: (step: WizardStep) => {
+ step: WizardStep
+ }
+ setTriggerKey: (triggerKey: HogFunctionSubTemplateIdType) => {
+ triggerKey: HogFunctionSubTemplateIdType
+ }
+ submitConfiguration: () => {
+ value: true
+ }
+ submitConfigurationComplete: () => {
+ value: true
+ }
+ testConfiguration: () => {
+ value: true
+ }
+ testConfigurationComplete: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface alertWizardLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ usedDestinationKeys: (existingAlerts: HogFunctionType[], allDestinations: WizardDestination[]) => Set<string>
+ sortedDestinations: (
+ usedDestinationKeys: Set<string>,
+ allDestinations: WizardDestination[]
+ ) => WizardDestination[]
+ primaryDestinations: (sortedDestinations: WizardDestination[]) => WizardDestination[]
+ extraDestinations: (sortedDestinations: WizardDestination[]) => WizardDestination[]
+ availableTriggers: (
+ selectedDestinationKey: string | null,
+ triggers: WizardTrigger[],
+ allDestinations: WizardDestination[]
+ ) => WizardTrigger[]
+ activeSubTemplate: (
+ selectedDestinationKey: string | null,
+ selectedTriggerKey: HogFunctionSubTemplateIdType | null,
+ allDestinations: WizardDestination[]
+ ) => HogFunctionSubTemplateType | null
+ requiredInputsSchema: (
+ selectedTemplate: HogFunctionTemplateType | null,
+ activeSubTemplate: HogFunctionSubTemplateType | null
+ ) => CyclotronJobInputSchemaType[]
+ configuration: (
+ selectedTemplate: HogFunctionTemplateType | null,
+ inputValues: Record<
+ string,
+ {
+ bytecode?: any
+ order?: number | undefined
+ secret?: boolean | undefined
+ templating?: 'hog' | 'liquid' | undefined
+ value: any
+ }
+ >
+ ) => {
+ inputs: Record<
+ string,
+ {
+ bytecode?: any
+ order?: number | undefined
+ secret?: boolean | undefined
+ templating?: 'hog' | 'liquid' | undefined
+ value: any
+ }
+ >
+ inputs_schema: CyclotronJobInputSchemaType[]
+ }
+ }
+}
+
+export type alertWizardLogicType = MakeLogicType<
+ alertWizardLogicValues,
+ alertWizardLogicActions,
+ AlertWizardLogicProps,
+ alertWizardLogicMeta
+>
+
export const alertWizardLogic = kea<alertWizardLogicType>([
props({} as AlertWizardLogicProps),
key((p) => p.logicKey),
@@ -267,7 +455,7 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
selectors({
usedDestinationKeys: [
(s) => [s.existingAlerts, s.allDestinations],
- (existingAlerts, allDestinations): Set<string> => {
+ (existingAlerts: HogFunctionType[], allDestinations: WizardDestination[]): Set<string> => {
const used = new Set<string>()
for (const alert of existingAlerts) {
const key = extractDestinationKeyFromAlert(alert, allDestinations)
@@ -281,7 +469,7 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
sortedDestinations: [
(s) => [s.usedDestinationKeys, s.allDestinations],
- (usedDestinationKeys, allDestinations): WizardDestination[] => {
+ (usedDestinationKeys: Set<string>, allDestinations: WizardDestination[]): WizardDestination[] => {
return [...allDestinations].sort((a, b) => {
const aUsed = usedDestinationKeys.has(a.key) ? 1 : 0
const bUsed = usedDestinationKeys.has(b.key) ? 1 : 0
@@ -292,17 +480,23 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
primaryDestinations: [
(s) => [s.sortedDestinations],
- (sortedDestinations): WizardDestination[] => sortedDestinations.slice(0, PRIMARY_DESTINATION_LIMIT),
+ (sortedDestinations: WizardDestination[]): WizardDestination[] =>
+ sortedDestinations.slice(0, PRIMARY_DESTINATION_LIMIT),
],
extraDestinations: [
(s) => [s.sortedDestinations],
- (sortedDestinations): WizardDestination[] => sortedDestinations.slice(PRIMARY_DESTINATION_LIMIT),
+ (sortedDestinations: WizardDestination[]): WizardDestination[] =>
+ sortedDestinations.slice(PRIMARY_DESTINATION_LIMIT),
],
availableTriggers: [
(s) => [s.selectedDestinationKey, s.triggers, s.allDestinations],
- (selectedDestinationKey, triggers, allDestinations): WizardTrigger[] => {
+ (
+ selectedDestinationKey: string | null,
+ triggers: WizardTrigger[],
+ allDestinations: WizardDestination[]
+ ): WizardTrigger[] => {
if (!selectedDestinationKey) {
return triggers
}
@@ -316,7 +510,11 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
activeSubTemplate: [
(s) => [s.selectedDestinationKey, s.selectedTriggerKey, s.allDestinations],
- (selectedDestinationKey, selectedTriggerKey, allDestinations) => {
+ (
+ selectedDestinationKey: string | null,
+ selectedTriggerKey: HogFunctionSubTemplateIdType | null,
+ allDestinations: WizardDestination[]
+ ) => {
if (!selectedDestinationKey || !selectedTriggerKey) {
return null
}
@@ -331,7 +529,10 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
requiredInputsSchema: [
(s) => [s.selectedTemplate, s.activeSubTemplate],
- (selectedTemplate, activeSubTemplate) => {
+ (
+ selectedTemplate: HogFunctionTemplateType | null,
+ activeSubTemplate: null | import('~/types').HogFunctionSubTemplateType
+ ) => {
if (!selectedTemplate) {
return []
}
@@ -347,7 +548,7 @@ export const alertWizardLogic = kea<alertWizardLogicType>([
configuration: [
(s) => [s.selectedTemplate, s.inputValues],
- (selectedTemplate, inputValues) => ({
+ (selectedTemplate: HogFunctionTemplateType | null, inputValues: Record<string, CyclotronJobInputType>) => ({
inputs_schema: selectedTemplate?.inputs_schema ?? [],
inputs: inputValues,
}),
diff --git a/frontend/src/lib/components/AnnotationsOverlay/annotationsOverlayLogic.ts b/frontend/src/lib/components/AnnotationsOverlay/annotationsOverlayLogic.ts
index d4082ec4adc5..4d17688f1819 100644
--- a/frontend/src/lib/components/AnnotationsOverlay/annotationsOverlayLogic.ts
+++ b/frontend/src/lib/components/AnnotationsOverlay/annotationsOverlayLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { isPersonPropertyFilter, parseProperties } from 'lib/components/PropertyFilters/utils'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -24,7 +24,10 @@ import {
QueryBasedInsightModel,
} from '~/types'
-import type { annotationsOverlayLogicType } from './annotationsOverlayLogicType'
+import type { AnnotationData } from '../../../models/annotationsModel'
+import type { Node } from '../../../queries/schema/schema-general'
+import type { RawAnnotationType } from '../../../types'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
export interface AnnotationsOverlayLogicProps extends Omit<InsightLogicProps, 'dashboardId'> {
dashboardId: DashboardType['id'] | undefined
@@ -72,6 +75,120 @@ function hasPersonPropertyFiltersOrBreakdown(
return false
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface annotationsOverlayLogicValues {
+ annotations: AnnotationType[] // annotationsModel
+ annotationsLoading: boolean // annotationsModel
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ insightId: number | null // insightLogic
+ savedInsight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> // insightLogic
+ breakdownFilter: BreakdownFilter | null | undefined // insightVizDataLogic
+ interval: IntervalType | null | undefined // insightVizDataLogic
+ properties: PropertyGroupFilter | AnyPropertyFilter[] | null | undefined // insightVizDataLogic
+ timezone: string // teamLogic
+ activeDate: Dayjs | null
+ annotationBadgeDataIndices: Array<{
+ dataIndex: number
+ date: Dayjs
+ dateKey: string
+ }>
+ annotationsOverlayProps: AnnotationsOverlayLogicProps
+ dateRange: [Dayjs, Dayjs] | null
+ groupedAnnotations: Record<number | string, DatedAnnotationType[]>
+ groupingUnit: IntervalType
+ intervalUnit: IntervalType
+ isDateLocked: boolean
+ isPopoverShown: boolean
+ relevantAnnotations: DatedAnnotationType[]
+ tickDates: Dayjs[]
+ tickPositions: number[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface annotationsOverlayLogicActions {
+ createAnnotationGenerically: (annotationData: AnnotationData) => AnnotationData // annotationsModel
+ deleteAnnotation: (annotation: AnnotationType) => {
+ annotation: AnnotationType
+ } // annotationsModel
+ updateAnnotation: ({
+ annotationId,
+ annotationData,
+ }: {
+ annotationData: AnnotationDataWithoutInsight
+ annotationId: RawAnnotationType['id']
+ }) => {
+ annotationData: AnnotationDataWithoutInsight
+ annotationId: RawAnnotationType[]
+ } // annotationsModel
+ activateDate: (date: Dayjs) => {
+ date: Dayjs
+ }
+ closePopover: () => {
+ value: true
+ }
+ createAnnotation: (annotationData: AnnotationDataWithoutInsight) => {
+ annotationData: AnnotationDataWithoutInsight
+ }
+ deactivateDate: () => {
+ value: true
+ }
+ lockDate: () => {
+ value: true
+ }
+ unlockDate: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface annotationsOverlayLogicMeta {
+ key: number | string
+ __keaTypeGenInternalSelectorTypes: {
+ annotationsOverlayProps: (arg: any) => AnnotationsOverlayLogicProps
+ intervalUnit: (interval: IntervalType | null | undefined) => IntervalType
+ groupingUnit: (intervalUnit: IntervalType) => IntervalType
+ tickPositions: (
+ ticks: {
+ value: number
+ }[]
+ ) => number[]
+ tickDates: (timezone: string, arg: string[], tickPositions: number[]) => Dayjs[]
+ dateRange: (timezone: string, arg: string[], intervalUnit: IntervalType) => [Dayjs, Dayjs] | null
+ relevantAnnotations: (
+ annotations: AnnotationType[],
+ dateRange: [Dayjs, Dayjs] | null,
+ timezone: string,
+ featureFlags: FeatureFlagsSet,
+ insightNumericId: number | 'new',
+ dashboardId: number | undefined,
+ savedInsight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>,
+ properties: PropertyGroupFilter | AnyPropertyFilter[] | null | undefined,
+ breakdownFilter: BreakdownFilter | null | undefined
+ ) => DatedAnnotationType[]
+ groupedAnnotations: (
+ relevantAnnotations: DatedAnnotationType[],
+ intervalUnit: IntervalType
+ ) => Record<number | string, DatedAnnotationType[]>
+ annotationBadgeDataIndices: (
+ groupedAnnotations: Record<number | string, DatedAnnotationType[]>,
+ intervalUnit: IntervalType,
+ timezone: string,
+ arg: string[]
+ ) => Array<{
+ dataIndex: number
+ date: Dayjs
+ dateKey: string
+ }>
+ }
+}
+
+export type annotationsOverlayLogicType = MakeLogicType<
+ annotationsOverlayLogicValues,
+ annotationsOverlayLogicActions,
+ AnnotationsOverlayLogicProps,
+ annotationsOverlayLogicMeta
+>
+
export const annotationsOverlayLogic = kea<annotationsOverlayLogicType>([
path((key) => ['lib', 'components', 'Annotations', 'annotationsOverlayLogic', key]),
props({ dashboardId: undefined } as AnnotationsOverlayLogicProps),
@@ -136,17 +253,27 @@ export const annotationsOverlayLogic = kea<annotationsOverlayLogicType>([
() => [(_, props) => props],
(props: AnnotationsOverlayLogicProps): AnnotationsOverlayLogicProps => props,
],
- intervalUnit: [(s) => [s.interval], (interval) => interval || 'day'],
- groupingUnit: [(s) => [s.intervalUnit], (intervalUnit): IntervalType => getGroupingUnit(intervalUnit)],
- tickPositions: [(_, p) => [p.ticks], (ticks): number[] => ticks.map(({ value }) => value)],
+ intervalUnit: [(s) => [s.interval], (interval: IntervalType | null | undefined) => interval || 'day'],
+ groupingUnit: [
+ (s) => [s.intervalUnit],
+ (intervalUnit: IntervalType): IntervalType => getGroupingUnit(intervalUnit),
+ ],
+ tickPositions: [
+ (_, p) => [p.ticks],
+ (
+ ticks: {
+ value: number
+ }[]
+ ): number[] => ticks.map(({ value }) => value),
+ ],
tickDates: [
(s) => [s.timezone, (_, props: AnnotationsOverlayLogicProps) => props.dates, s.tickPositions],
- (timezone, dates, tickPositions): Dayjs[] =>
+ (timezone: string, dates: string[], tickPositions: number[]): Dayjs[] =>
tickPositions.map((dateIndex) => parseDateInTimezone(dates[dateIndex], timezone)),
],
dateRange: [
(s) => [s.timezone, (_, props: AnnotationsOverlayLogicProps) => props.dates, s.intervalUnit],
- (timezone, dates, intervalUnit): [Dayjs, Dayjs] | null => {
+ (timezone: string, dates: string[], intervalUnit: IntervalType): [Dayjs, Dayjs] | null => {
if (dates.length === 0) {
return null
}
@@ -168,15 +295,17 @@ export const annotationsOverlayLogic = kea<annotationsOverlayLogicType>([
s.breakdownFilter,
],
(
- annotations,
- dateRange,
- timezone,
- featureFlags,
- insightNumericId,
- dashboardId,
- savedInsight,
- properties,
- breakdownFilter
+ annotations: AnnotationType[],
+ dateRange: [Dayjs, Dayjs] | null,
+ timezone: string,
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ insightNumericId: number | 'new',
+ dashboardId: number | undefined,
+ savedInsight: Partial<
+ QueryBasedInsightModel<import('~/queries/schema/schema-general').Node<Record<string, any>>>
+ >,
+ properties: PropertyGroupFilter | AnyPropertyFilter[] | null | undefined,
+ breakdownFilter: BreakdownFilter | null | undefined
) => {
// This assumes that there are no more annotations in the project than AnnotationsViewSet
// pagination class's default_limit of 100. As of June 2023, this is not true on Cloud US,
@@ -243,7 +372,7 @@ export const annotationsOverlayLogic = kea<annotationsOverlayLogicType>([
],
groupedAnnotations: [
(s) => [s.relevantAnnotations, s.intervalUnit],
- (relevantAnnotations, intervalUnit) => {
+ (relevantAnnotations: DatedAnnotationType[], intervalUnit: IntervalType) => {
return groupBy(relevantAnnotations, (annotation) => {
return determineAnnotationsDateGroup(annotation.date_marker, intervalUnit)
})
@@ -259,10 +388,10 @@ export const annotationsOverlayLogic = kea<annotationsOverlayLogicType>([
(_, props: AnnotationsOverlayLogicProps) => props.dates,
],
(
- groupedAnnotations,
- intervalUnit,
- timezone,
- dates
+ groupedAnnotations: Record<number | string, DatedAnnotationType[]>,
+ intervalUnit: IntervalType,
+ timezone: string,
+ dates: string[]
): Array<{ dateKey: string; date: Dayjs; dataIndex: number }> => {
if (dates.length === 0) {
return []
diff --git a/frontend/src/lib/components/AppMetrics/appMetricsLogic.ts b/frontend/src/lib/components/AppMetrics/appMetricsLogic.ts
index 35b26890f76b..01c9b67baae4 100644
--- a/frontend/src/lib/components/AppMetrics/appMetricsLogic.ts
+++ b/frontend/src/lib/components/AppMetrics/appMetricsLogic.ts
@@ -1,4 +1,17 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ propsChanged,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -10,7 +23,7 @@ import { teamLogic } from 'scenes/teamLogic'
import { HogQLQueryString, hogql } from '~/queries/utils'
-import type { appMetricsLogicType } from './appMetricsLogicType'
+import type { TeamPublicType, TeamType } from '../../../types'
const DEFAULT_INTERVAL = 'day'
@@ -238,6 +251,105 @@ const convertDateFieldToDayJs = (date: string, timezone: string): Dayjs => {
return dateStringToDayJs(date, timezone) ?? dayjs().tz(timezone)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface appMetricsLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ appMetricsTrends: AppMetricsTimeSeriesResponse | null
+ appMetricsTrendsLoading: boolean
+ appMetricsTrendsPreviousPeriod: AppMetricsTimeSeriesResponse | null
+ appMetricsTrendsPreviousPeriodLoading: boolean
+ availableIntervals: AppMetricsCommonParams['interval'][]
+ getDateRangeAbsolute: () => {
+ dateFrom: Dayjs
+ dateTo: Dayjs
+ diffMs: number
+ }
+ getSingleTrendSeries: (name: string, previousPeriod?: boolean) => AppMetricsTimeSeriesResponse | null
+ params: Partial<AppMetricsCommonParams>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface appMetricsLogicActions {
+ loadAppMetricsTrends: () => {
+ value: true
+ }
+ loadAppMetricsTrendsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAppMetricsTrendsPreviousPeriod: () => {
+ value: true
+ }
+ loadAppMetricsTrendsPreviousPeriodFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAppMetricsTrendsPreviousPeriodSuccess: (
+ appMetricsTrendsPreviousPeriod: AppMetricsTimeSeriesResponse,
+ payload?: {
+ value: true
+ }
+ ) => {
+ appMetricsTrendsPreviousPeriod: AppMetricsTimeSeriesResponse
+ payload?: {
+ value: true
+ }
+ }
+ loadAppMetricsTrendsSuccess: (
+ appMetricsTrends: AppMetricsTimeSeriesResponse,
+ payload?: {
+ value: true
+ }
+ ) => {
+ appMetricsTrends: AppMetricsTimeSeriesResponse
+ payload?: {
+ value: true
+ }
+ }
+ setParams: (params: Partial<AppMetricsCommonParams>) => {
+ params: Partial<AppMetricsCommonParams>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface appMetricsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ getSingleTrendSeries: (
+ appMetricsTrends: AppMetricsTimeSeriesResponse | null,
+ appMetricsTrendsPreviousPeriod: AppMetricsTimeSeriesResponse | null
+ ) => (name: string, previousPeriod?: boolean) => AppMetricsTimeSeriesResponse | null
+ getDateRangeAbsolute: (
+ params: Partial<AppMetricsCommonParams>,
+ currentTeam: TeamPublicType | TeamType | null
+ ) => () => {
+ dateFrom: Dayjs
+ dateTo: Dayjs
+ diffMs: number
+ }
+ availableIntervals: (
+ getDateRangeAbsolute: () => {
+ dateFrom: Dayjs
+ dateTo: Dayjs
+ diffMs: number
+ }
+ ) => AppMetricsCommonParams['interval'][]
+ }
+}
+
+export type appMetricsLogicType = MakeLogicType<
+ appMetricsLogicValues,
+ appMetricsLogicActions,
+ AppMetricsLogicProps,
+ appMetricsLogicMeta
+>
+
// IDEA - have a generic helper logic that can be used anywhere for rendering metrics
export const appMetricsLogic = kea<appMetricsLogicType>([
props({} as unknown as AppMetricsLogicProps),
@@ -307,7 +419,10 @@ export const appMetricsLogic = kea<appMetricsLogicType>([
selectors(() => ({
getSingleTrendSeries: [
(s) => [s.appMetricsTrends, s.appMetricsTrendsPreviousPeriod],
- (appMetricsTrends, appMetricsTrendsPreviousPeriod) =>
+ (
+ appMetricsTrends: AppMetricsTimeSeriesResponse | null,
+ appMetricsTrendsPreviousPeriod: AppMetricsTimeSeriesResponse | null
+ ) =>
(name: string, previousPeriod: boolean = false): AppMetricsTimeSeriesResponse | null => {
const targetTrend = previousPeriod ? appMetricsTrendsPreviousPeriod : appMetricsTrends
if (!targetTrend) {
@@ -327,23 +442,33 @@ export const appMetricsLogic = kea<appMetricsLogicType>([
getDateRangeAbsolute: [
(s) => [s.params, s.currentTeam],
- (params, currentTeam) => (): { dateFrom: Dayjs; dateTo: Dayjs; diffMs: number } => {
- const dateFrom = convertDateFieldToDayJs(params.dateFrom ?? '-7d', currentTeam?.timezone ?? 'UTC')
- const dateTo = params.dateTo
- ? convertDateFieldToDayJs(params.dateTo, currentTeam?.timezone ?? 'UTC')
- : dayjs()
- .tz(currentTeam?.timezone ?? 'UTC')
- .endOf(params.interval ?? DEFAULT_INTERVAL)
-
- const diffMs = dateTo.diff(dateFrom)
-
- return { dateFrom, dateTo, diffMs }
- },
+ (
+ params: Partial<AppMetricsCommonParams>,
+ currentTeam: null | import('../../../types').TeamPublicType | import('../../../types').TeamType
+ ) =>
+ (): { dateFrom: Dayjs; dateTo: Dayjs; diffMs: number } => {
+ const dateFrom = convertDateFieldToDayJs(params.dateFrom ?? '-7d', currentTeam?.timezone ?? 'UTC')
+ const dateTo = params.dateTo
+ ? convertDateFieldToDayJs(params.dateTo, currentTeam?.timezone ?? 'UTC')
+ : dayjs()
+ .tz(currentTeam?.timezone ?? 'UTC')
+ .endOf(params.interval ?? DEFAULT_INTERVAL)
+
+ const diffMs = dateTo.diff(dateFrom)
+
+ return { dateFrom, dateTo, diffMs }
+ },
],
availableIntervals: [
(s) => [s.getDateRangeAbsolute],
- (getDateRangeAbsolute): AppMetricsCommonParams['interval'][] => {
+ (
+ getDateRangeAbsolute: () => {
+ dateFrom: Dayjs
+ dateTo: Dayjs
+ diffMs: number
+ }
+ ): AppMetricsCommonParams['interval'][] => {
const diffMs = getDateRangeAbsolute().diffMs
// If the diff is less than 2 days (ish), we can show the minute interval but not day
diff --git a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
index 72b25da4fd6f..d1e50338c1fb 100644
--- a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
+++ b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
@@ -1,4 +1,5 @@
import {
+ MakeLogicType,
actions,
afterMount,
connect,
@@ -11,7 +12,9 @@ import {
selectors,
sharedListeners,
} from 'kea'
+import type { BreakPointFunction } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { encodeParams, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -30,7 +33,7 @@ import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-genera
import { hogql } from '~/queries/utils'
import { ExperimentIdType, ToolbarParams, ToolbarUserIntent } from '~/types'
-import type { authorizedUrlListLogicType } from './authorizedUrlListLogicType'
+import type { TeamPublicType, TeamType, UserType } from '../../../types'
export interface ProposeNewUrlFormType {
url: string
@@ -305,6 +308,166 @@ export const defaultAuthorizedUrlProperties = {
userIntent: undefined,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface authorizedUrlListLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ currentTeamId: number | null // teamLogic
+ user: UserType | null // userLogic
+ authorizedUrls: string[]
+ checkUrlIsAuthorized: (url: string) => boolean
+ checkUrlIsSafeToFrame: (url: string) => boolean
+ editUrlIndex: number | null
+ isAddUrlFormVisible: boolean
+ isProposedUrlSubmitting: boolean
+ isProposedUrlValid: boolean
+ launchUrl: (url: string) => string
+ onlyAllowDomains: boolean
+ proposedUrl: ProposeNewUrlFormType
+ proposedUrlAllErrors: Record<string, any>
+ proposedUrlChanged: boolean
+ proposedUrlErrors: DeepPartialMap<ProposeNewUrlFormType, ValidationErrorType>
+ proposedUrlHasErrors: boolean
+ proposedUrlManualErrors: Record<string, any>
+ proposedUrlTouched: boolean
+ proposedUrlTouches: Record<string, boolean>
+ proposedUrlValidationErrors: DeepPartialMap<ProposeNewUrlFormType, ValidationErrorType>
+ showProposedURLForm: boolean
+ showProposedUrlErrors: boolean
+ suggestions: any[]
+ suggestionsLoading: boolean
+ urlToEdit: string
+ urlsKeyed: KeyedAppUrl[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface authorizedUrlListLogicActions {
+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic
+ addUrl: (
+ url: string,
+ launch?: boolean
+ ) => {
+ launch: boolean | undefined
+ url: string
+ }
+ cancelProposingUrl: () => {
+ value: true
+ }
+ copyLaunchCode: () => {
+ value: true
+ }
+ launchAtUrl: (url: string) => {
+ url: string
+ }
+ loadSuggestions: (_: void) => void
+ loadSuggestionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSuggestionsSuccess: (
+ suggestions: SuggestedDomain[],
+ payload?: void
+ ) => {
+ suggestions: SuggestedDomain[]
+ payload?: void
+ }
+ newUrl: () => {
+ value: true
+ }
+ removeUrl: (index: number) => {
+ index: number
+ }
+ resetProposedUrl: (values?: ProposeNewUrlFormType) => {
+ values?: ProposeNewUrlFormType
+ }
+ setAuthorizedUrls: (authorizedUrls: string[]) => {
+ authorizedUrls: string[]
+ }
+ setEditUrlIndex: (originalIndex: number | null) => {
+ originalIndex: number | null
+ }
+ setProposedUrlManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setProposedUrlValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setProposedUrlValues: (values: DeepPartial<ProposeNewUrlFormType>) => {
+ values: DeepPartial<ProposeNewUrlFormType>
+ }
+ submitProposedUrl: () => {
+ value: boolean
+ }
+ submitProposedUrlFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitProposedUrlRequest: (proposedUrl: ProposeNewUrlFormType) => {
+ proposedUrl: ProposeNewUrlFormType
+ }
+ submitProposedUrlSuccess: (proposedUrl: ProposeNewUrlFormType) => {
+ proposedUrl: ProposeNewUrlFormType
+ }
+ touchProposedUrlField: (key: string) => {
+ key: string
+ }
+ updateUrl: (
+ index: number,
+ url: string
+ ) => {
+ index: number
+ url: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface authorizedUrlListLogicMeta {
+ key: string
+ sharedListeners: {
+ saveUrls: (
+ payload: any,
+ breakpoint: BreakPointFunction,
+ action: {
+ type: string
+ payload: any
+ },
+ previousState: any
+ ) => void | Promise<void>
+ }
+ __keaTypeGenInternalSelectorTypes: {
+ urlToEdit: (authorizedUrls: string[], editUrlIndex: number | null) => string
+ urlsKeyed: (authorizedUrls: string[], suggestions: any[]) => KeyedAppUrl[]
+ launchUrl: (
+ currentTeam: TeamPublicType | TeamType | null,
+ user: UserType | null,
+ actionId: number | null,
+ experimentId: ExperimentIdType | null,
+ productTourId: string | null,
+ arg: ToolbarUserIntent | undefined
+ ) => (url: string) => string
+ isAddUrlFormVisible: (editUrlIndex: number | null) => boolean
+ onlyAllowDomains: (type: AuthorizedUrlListType) => boolean
+ checkUrlIsAuthorized: (authorizedUrls: string[]) => (url: string) => boolean
+ checkUrlIsSafeToFrame: (authorizedUrls: string[]) => (url: string) => boolean
+ }
+}
+
+export type authorizedUrlListLogicType = MakeLogicType<
+ authorizedUrlListLogicValues,
+ authorizedUrlListLogicActions,
+ AuthorizedUrlListLogicProps,
+ authorizedUrlListLogicMeta
+>
+
export const authorizedUrlListLogic = kea<authorizedUrlListLogicType>([
path((key) => ['lib', 'components', 'AuthorizedUrlList', 'authorizedUrlListLogic', key]),
key((props) => `${props.type}-${props.experimentId}-${props.actionId}-${props.productTourId}`), // Some will be undefined but that's ok, this avoids experiment/action with same ID sharing same store
@@ -509,7 +672,7 @@ export const authorizedUrlListLogic = kea<authorizedUrlListLogicType>([
selectors({
urlToEdit: [
(s) => [s.authorizedUrls, s.editUrlIndex],
- (authorizedUrls, editUrlIndex) => {
+ (authorizedUrls: string[], editUrlIndex: number | null) => {
if (editUrlIndex === null || editUrlIndex === -1) {
return NEW_URL
}
@@ -518,7 +681,7 @@ export const authorizedUrlListLogic = kea<authorizedUrlListLogicType>([
],
urlsKeyed: [
(s) => [s.authorizedUrls, s.suggestions],
- (authorizedUrls, suggestions): KeyedAppUrl[] => {
+ (authorizedUrls: string[], suggestions: any[]): KeyedAppUrl[] => {
const keyedUrls = authorizedUrls
.map((url, index) => ({
url,
@@ -546,35 +709,46 @@ export const authorizedUrlListLogic = kea<authorizedUrlListLogicType>([
p.productTourId,
p.userIntent ?? (() => undefined),
],
- (currentTeam, user, actionId, experimentId, productTourId, userIntent) => (url: string) => {
- const commonOptions = {
- token: currentTeam?.api_token,
- dataAttributes: currentTeam?.data_attributes,
- userEmail: user?.email,
- distinctId: user?.distinct_id,
- }
- if (experimentId) {
- return directToolbarUrl(url, { ...commonOptions, experimentId })
- }
- if (productTourId) {
- return directToolbarUrl(url, { ...commonOptions, productTourId, userIntent })
- }
- return directToolbarUrl(url, { ...commonOptions, actionId })
- },
+ (
+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,
+ user: null | import('~/types').UserType,
+ actionId: number | null,
+ experimentId: ExperimentIdType | null,
+ productTourId: string | null,
+ userIntent: ToolbarUserIntent | undefined
+ ) =>
+ (url: string) => {
+ const commonOptions = {
+ token: currentTeam?.api_token,
+ dataAttributes: currentTeam?.data_attributes,
+ userEmail: user?.email,
+ distinctId: user?.distinct_id,
+ }
+ if (experimentId) {
+ return directToolbarUrl(url, { ...commonOptions, experimentId })
+ }
+ if (productTourId) {
+ return directToolbarUrl(url, { ...commonOptions, productTourId, userIntent })
+ }
+ return directToolbarUrl(url, { ...commonOptions, actionId })
+ },
+ ],
+ isAddUrlFormVisible: [(s) => [s.editUrlIndex], (editUrlIndex: number | null) => editUrlIndex === -1],
+ onlyAllowDomains: [
+ (_, p) => [p.type],
+ (type: AuthorizedUrlListType) => type === AuthorizedUrlListType.RECORDING_DOMAINS,
],
- isAddUrlFormVisible: [(s) => [s.editUrlIndex], (editUrlIndex) => editUrlIndex === -1],
- onlyAllowDomains: [(_, p) => [p.type], (type) => type === AuthorizedUrlListType.RECORDING_DOMAINS],
checkUrlIsAuthorized: [
(s) => [s.authorizedUrls],
- (authorizedUrls) => (url: string) => {
+ (authorizedUrls: string[]) => (url: string) => {
return checkUrlIsAuthorized(url, authorizedUrls)
},
],
checkUrlIsSafeToFrame: [
(s) => [s.authorizedUrls],
- (authorizedUrls) => (url: string) => {
+ (authorizedUrls: string[]) => (url: string) => {
return checkUrlIsSafeToFrame(url, authorizedUrls)
},
],
diff --git a/frontend/src/lib/components/Cards/ButtonTileCard/buttonTileCardModalLogic.ts b/frontend/src/lib/components/Cards/ButtonTileCard/buttonTileCardModalLogic.ts
index 39bc5b916764..b2a953215400 100644
--- a/frontend/src/lib/components/Cards/ButtonTileCard/buttonTileCardModalLogic.ts
+++ b/frontend/src/lib/components/Cards/ButtonTileCard/buttonTileCardModalLogic.ts
@@ -1,5 +1,6 @@
-import { connect, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, connect, kea, key, listeners, path, props } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
@@ -7,8 +8,6 @@ import { lemonToast } from '@posthog/lemon-ui'
import { dashboardsModel } from '~/models/dashboardsModel'
import { DashboardType, QueryBasedInsightModel } from '~/types'
-import type { buttonTileCardModalLogicType } from './buttonTileCardModalLogicType'
-
export interface ButtonTileForm {
url: string
text: string
@@ -55,6 +54,74 @@ const isValidPathname = (value: string): boolean => {
return /^\/[a-zA-Z0-9._~:/?#[\]@!$&'()*+,;=%-]*$/.test(value)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface buttonTileCardModalLogicValues {
+ buttonTile: ButtonTileForm
+ buttonTileAllErrors: Record<string, any>
+ buttonTileChanged: boolean
+ buttonTileErrors: DeepPartialMap<ButtonTileForm, ValidationErrorType>
+ buttonTileHasErrors: boolean
+ buttonTileManualErrors: Record<string, any>
+ buttonTileTouched: boolean
+ buttonTileTouches: Record<string, boolean>
+ buttonTileValidationErrors: DeepPartialMap<ButtonTileForm, ValidationErrorType>
+ isButtonTileSubmitting: boolean
+ isButtonTileValid: boolean
+ showButtonTileErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface buttonTileCardModalLogicActions {
+ updateDashboard: ({ id, allowUndo, discardResult, ...payload }: any) => any // dashboardsModel
+ resetButtonTile: (values?: ButtonTileForm) => {
+ values?: ButtonTileForm
+ }
+ setButtonTileManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setButtonTileValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setButtonTileValues: (values: DeepPartial<ButtonTileForm>) => {
+ values: DeepPartial<ButtonTileForm>
+ }
+ submitButtonTile: () => {
+ value: boolean
+ }
+ submitButtonTileFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitButtonTileRequest: (buttonTile: ButtonTileForm) => {
+ buttonTile: ButtonTileForm
+ }
+ submitButtonTileSuccess: (buttonTile: ButtonTileForm) => {
+ buttonTile: ButtonTileForm
+ }
+ touchButtonTileField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface buttonTileCardModalLogicMeta {
+ key: string
+}
+
+export type buttonTileCardModalLogicType = MakeLogicType<
+ buttonTileCardModalLogicValues,
+ buttonTileCardModalLogicActions,
+ ButtonTileCardModalProps,
+ buttonTileCardModalLogicMeta
+>
+
export const buttonTileCardModalLogic = kea<buttonTileCardModalLogicType>([
path(['scenes', 'dashboard', 'buttonTileCardModal', 'logic']),
props({} as ButtonTileCardModalProps),
diff --git a/frontend/src/lib/components/Cards/InsightCard/dashboardWidgetMenusLogic.ts b/frontend/src/lib/components/Cards/InsightCard/dashboardWidgetMenusLogic.ts
index 4c2c28825cc2..8443d0cba807 100644
--- a/frontend/src/lib/components/Cards/InsightCard/dashboardWidgetMenusLogic.ts
+++ b/frontend/src/lib/components/Cards/InsightCard/dashboardWidgetMenusLogic.ts
@@ -1,11 +1,12 @@
-import { connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'
import { accessLevelSatisfied } from 'lib/utils/accessControlUtils'
import { dashboardsModel } from '~/models/dashboardsModel'
import { AccessControlLevel, AccessControlResourceType, DashboardBasicType, DashboardTileBasicType } from '~/types'
-import type { dashboardWidgetMenusLogicType } from './dashboardWidgetMenusLogicType'
+import type { Node } from '../../../../queries/schema/schema-general'
+import type { DashboardType, QueryBasedInsightModel } from '../../../../types'
import type { DashboardWidgetPlacementDestination } from './DashboardWidgetPlacementMenu'
/** Stable key for kea; e.g. insight short_id, `text-${id}`, `button-${id}`, or `text-tile-${tileId}`. */
@@ -22,6 +23,40 @@ function canEditDestinationDashboard(d: DashboardBasicType): boolean {
: true
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dashboardWidgetMenusLogicValues {
+ nameSortedDashboards: (DashboardBasicType | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>)[] // dashboardsModel
+ copyToDestinations: DashboardWidgetPlacementDestination[]
+ dashboardIdsWithThisWidget: Set<number>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dashboardWidgetMenusLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ dashboardIdsWithThisWidget: (
+ dashboards: number[] | null | undefined,
+ dashboard_tiles: DashboardTileBasicType[] | null | undefined,
+ dashboardId: number | null | undefined
+ ) => Set<number>
+ copyToDestinations: (
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ )[],
+ dashboardIdsWithThisWidget: Set<number>,
+ dashboardId: number | null | undefined
+ ) => DashboardWidgetPlacementDestination[]
+ }
+}
+
+export type dashboardWidgetMenusLogicType = MakeLogicType<
+ dashboardWidgetMenusLogicValues,
+ {},
+ DashboardWidgetMenusLogicProps,
+ dashboardWidgetMenusLogicMeta
+>
+
/** Copy / Move dashboard submenus for insight, text, and button widgets (placement + ACL). */
export const dashboardWidgetMenusLogic = kea<dashboardWidgetMenusLogicType>([
path(['lib', 'components', 'Cards', 'InsightCard', 'dashboardWidgetMenusLogic']),
@@ -59,7 +94,18 @@ export const dashboardWidgetMenusLogic = kea<dashboardWidgetMenusLogicType>([
/** Destinations for Copy to and Move to submenus (disabled rows explain why a target is unavailable). */
copyToDestinations: [
(s, p) => [s.nameSortedDashboards, s.dashboardIdsWithThisWidget, p.dashboardId],
- (nameSortedDashboards, dashboardIdsWithThisWidget, dashboardId): DashboardWidgetPlacementDestination[] => {
+ (
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | import('~/types').DashboardType<
+ import('~/types').QueryBasedInsightModel<
+ import('../../../../queries/schema').Node<Record<string, any>>
+ >
+ >
+ )[],
+ dashboardIdsWithThisWidget: Set<number>,
+ dashboardId: number | null | undefined
+ ): DashboardWidgetPlacementDestination[] => {
return nameSortedDashboards
.filter((d) => (dashboardId == null || d.id !== dashboardId) && canEditDestinationDashboard(d))
.map((d) => ({
diff --git a/frontend/src/lib/components/Cards/TextCard/textCardModalLogic.ts b/frontend/src/lib/components/Cards/TextCard/textCardModalLogic.ts
index 6d5dc5dd754d..0392b3051b80 100644
--- a/frontend/src/lib/components/Cards/TextCard/textCardModalLogic.ts
+++ b/frontend/src/lib/components/Cards/TextCard/textCardModalLogic.ts
@@ -1,5 +1,6 @@
-import { connect, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, connect, kea, key, listeners, path, props } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
@@ -7,8 +8,6 @@ import { lemonToast } from '@posthog/lemon-ui'
import { dashboardsModel } from '~/models/dashboardsModel'
import { DashboardTile, DashboardType, QueryBasedInsightModel } from '~/types'
-import type { textCardModalLogicType } from './textCardModalLogicType'
-
export interface TextTileForm {
body: string
transparent_background: boolean
@@ -30,6 +29,74 @@ const getExistingTextTile = (dashboard: DashboardType<QueryBasedInsightModel>, t
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textCardModalLogicValues {
+ isTextTileSubmitting: boolean
+ isTextTileValid: boolean
+ showTextTileErrors: boolean
+ textTile: TextTileForm
+ textTileAllErrors: Record<string, any>
+ textTileChanged: boolean
+ textTileErrors: DeepPartialMap<TextTileForm, ValidationErrorType>
+ textTileHasErrors: boolean
+ textTileManualErrors: Record<string, any>
+ textTileTouched: boolean
+ textTileTouches: Record<string, boolean>
+ textTileValidationErrors: DeepPartialMap<TextTileForm, ValidationErrorType>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textCardModalLogicActions {
+ updateDashboard: ({ id, allowUndo, discardResult, ...payload }: any) => any // dashboardsModel
+ resetTextTile: (values?: TextTileForm) => {
+ values?: TextTileForm
+ }
+ setTextTileManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setTextTileValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setTextTileValues: (values: DeepPartial<TextTileForm>) => {
+ values: DeepPartial<TextTileForm>
+ }
+ submitTextTile: () => {
+ value: boolean
+ }
+ submitTextTileFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitTextTileRequest: (textTile: TextTileForm) => {
+ textTile: TextTileForm
+ }
+ submitTextTileSuccess: (textTile: TextTileForm) => {
+ textTile: TextTileForm
+ }
+ touchTextTileField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textCardModalLogicMeta {
+ key: string
+}
+
+export type textCardModalLogicType = MakeLogicType<
+ textCardModalLogicValues,
+ textCardModalLogicActions,
+ TextCardModalProps,
+ textCardModalLogicMeta
+>
+
export const textCardModalLogic = kea<textCardModalLogicType>([
path(['scenes', 'dashboard', 'dashboardTextTileModal', 'logic']),
props({} as TextCardModalProps),
diff --git a/frontend/src/lib/components/Command/commandLogic.tsx b/frontend/src/lib/components/Command/commandLogic.tsx
index 090c6ca1c417..aac5fbddf83b 100644
--- a/frontend/src/lib/components/Command/commandLogic.tsx
+++ b/frontend/src/lib/components/Command/commandLogic.tsx
@@ -1,6 +1,24 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
-import type { commandLogicType } from './commandLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface commandLogicValues {
+ isCommandOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface commandLogicActions {
+ closeCommand: () => {
+ value: true
+ }
+ openCommand: () => {
+ value: true
+ }
+ toggleCommand: () => {
+ value: true
+ }
+}
+
+export type commandLogicType = MakeLogicType<commandLogicValues, commandLogicActions>
export const commandLogic = kea<commandLogicType>([
path(['lib', 'components', 'Command', 'commandLogic']),
diff --git a/frontend/src/lib/components/CyclotronJob/cyclotronJobInputLogic.ts b/frontend/src/lib/components/CyclotronJob/cyclotronJobInputLogic.ts
index 3f9c03716ad9..6bd1fa23173b 100644
--- a/frontend/src/lib/components/CyclotronJob/cyclotronJobInputLogic.ts
+++ b/frontend/src/lib/components/CyclotronJob/cyclotronJobInputLogic.ts
@@ -1,6 +1,4 @@
-import { kea } from 'kea'
-
-import type { cyclotronJobInputLogicType } from './cyclotronJobInputLogicType'
+import { MakeLogicType, kea } from 'kea'
export interface CyclotronJobInputLogicProps {
fieldKey: string
@@ -19,6 +17,41 @@ export function formatJsonValue(value: any): string {
return typeof value !== 'string' ? JSON.stringify(value, null, 2) : value
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobInputLogicValues {
+ error: string | null
+ hasError: boolean
+ jsonValue: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobInputLogicActions {
+ setError: (error: string | null) => {
+ error: string | null
+ }
+ setJsonValue: (value: string) => {
+ value: string
+ }
+ validateJson: (value: string) => {
+ value: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobInputLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ hasError: (error: any) => boolean
+ }
+}
+
+export type cyclotronJobInputLogicType = MakeLogicType<
+ cyclotronJobInputLogicValues,
+ cyclotronJobInputLogicActions,
+ CyclotronJobInputLogicProps,
+ cyclotronJobInputLogicMeta
+>
+
export const cyclotronJobInputLogic = kea<cyclotronJobInputLogicType>({
path: ['lib', 'components', 'CyclotronJob', 'cyclotronJobInputLogic'],
props: {} as CyclotronJobInputLogicProps,
diff --git a/frontend/src/lib/components/CyclotronJob/cyclotronJobTemplateSuggestionsLogic.tsx b/frontend/src/lib/components/CyclotronJob/cyclotronJobTemplateSuggestionsLogic.tsx
index c8f4c338669b..98ff8d382f33 100644
--- a/frontend/src/lib/components/CyclotronJob/cyclotronJobTemplateSuggestionsLogic.tsx
+++ b/frontend/src/lib/components/CyclotronJob/cyclotronJobTemplateSuggestionsLogic.tsx
@@ -1,12 +1,10 @@
import FuseClass from 'fuse.js'
-import { actions, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, reducers, selectors } from 'kea'
import { STL as HOG_STL } from '@posthog/hogvm'
import { createFuse } from 'lib/utils/fuseSearch'
-import type { cyclotronJobTemplateSuggestionsLogicType } from './cyclotronJobTemplateSuggestionsLogicType'
-
export type CyclotronJobTemplateOption = {
key: string
description: string
@@ -77,6 +75,42 @@ const LIQUID_USAGE_EXAMPLES: CyclotronJobTemplateOption[] = [
},
]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobTemplateSuggestionsLogicValues {
+ allOptions: CyclotronJobTemplateOption[]
+ optionsFiltered: CyclotronJobTemplateOption[]
+ optionsFuse: Fuse
+ search: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobTemplateSuggestionsLogicActions {
+ setSearch: (search: string) => {
+ search: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface cyclotronJobTemplateSuggestionsLogicMeta {
+ key: 'hog' | 'liquid'
+ __keaTypeGenInternalSelectorTypes: {
+ allOptions: (templating: 'hog' | 'liquid') => CyclotronJobTemplateOption[]
+ optionsFuse: (allOptions: CyclotronJobTemplateOption[]) => Fuse
+ optionsFiltered: (
+ allOptions: CyclotronJobTemplateOption[],
+ optionsFuse: Fuse,
+ search: string
+ ) => CyclotronJobTemplateOption[]
+ }
+}
+
+export type cyclotronJobTemplateSuggestionsLogicType = MakeLogicType<
+ cyclotronJobTemplateSuggestionsLogicValues,
+ cyclotronJobTemplateSuggestionsLogicActions,
+ CyclotronJobTemplateSuggestionsLogicProps,
+ cyclotronJobTemplateSuggestionsLogicMeta
+>
+
export const cyclotronJobTemplateSuggestionsLogic = kea<cyclotronJobTemplateSuggestionsLogicType>([
props({} as CyclotronJobTemplateSuggestionsLogicProps),
key(({ templating }: CyclotronJobTemplateSuggestionsLogicProps) => templating),
@@ -92,14 +126,14 @@ export const cyclotronJobTemplateSuggestionsLogic = kea<cyclotronJobTemplateSugg
selectors({
allOptions: [
(_, p) => [p.templating],
- (templating): CyclotronJobTemplateOption[] => {
+ (templating: 'hog' | 'liquid'): CyclotronJobTemplateOption[] => {
return templating === 'hog' ? [...HOG_USAGE_EXAMPLES, ...HOG_STL_EXAMPLES] : LIQUID_USAGE_EXAMPLES
},
],
optionsFuse: [
(s) => [s.allOptions],
- (allOptions): Fuse => {
+ (allOptions: CyclotronJobTemplateOption[]): Fuse => {
return createFuse(allOptions, {
keys: ['description', 'example'],
})
@@ -108,7 +142,11 @@ export const cyclotronJobTemplateSuggestionsLogic = kea<cyclotronJobTemplateSugg
optionsFiltered: [
(s) => [s.allOptions, s.optionsFuse, s.search],
- (allOptions, optionsFuse, search): CyclotronJobTemplateOption[] => {
+ (
+ allOptions: CyclotronJobTemplateOption[],
+ optionsFuse: Fuse,
+ search: string
+ ): CyclotronJobTemplateOption[] => {
if (!search) {
return allOptions
}
diff --git a/frontend/src/lib/components/DateFilter/DateRangePicker/dateRangePickerLogic.ts b/frontend/src/lib/components/DateFilter/DateRangePicker/dateRangePickerLogic.ts
index 96088a81147d..6254d4347131 100644
--- a/frontend/src/lib/components/DateFilter/DateRangePicker/dateRangePickerLogic.ts
+++ b/frontend/src/lib/components/DateFilter/DateRangePicker/dateRangePickerLogic.ts
@@ -1,9 +1,7 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'
import { DateRange } from '~/queries/schema/schema-general'
-import type { dateRangePickerLogicType } from './dateRangePickerLogicType'
-
const MAX_HISTORY_ITEMS = 5
const dateRangesEqual = (a: DateRange, b: DateRange): boolean => a.date_from === b.date_from && a.date_to === b.date_to
@@ -13,6 +11,42 @@ export interface DateRangePickerLogicProps {
key: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateRangePickerLogicValues {
+ customFrom: string
+ customTo: string
+ history: DateRange[]
+ popoverOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateRangePickerLogicActions {
+ addToHistory: (dateRange: DateRange) => {
+ dateRange: DateRange
+ }
+ setCustomFrom: (value: string) => {
+ value: string
+ }
+ setCustomTo: (value: string) => {
+ value: string
+ }
+ setPopoverOpen: (open: boolean) => {
+ open: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateRangePickerLogicMeta {
+ key: string
+}
+
+export type dateRangePickerLogicType = MakeLogicType<
+ dateRangePickerLogicValues,
+ dateRangePickerLogicActions,
+ DateRangePickerLogicProps,
+ dateRangePickerLogicMeta
+>
+
export const dateRangePickerLogic = kea<dateRangePickerLogicType>([
props({} as DateRangePickerLogicProps),
key((props) => props.key),
diff --git a/frontend/src/lib/components/DateFilter/dateFilterLogic.ts b/frontend/src/lib/components/DateFilter/dateFilterLogic.ts
index 8efd658fcabc..9eea9d95b76a 100644
--- a/frontend/src/lib/components/DateFilter/dateFilterLogic.ts
+++ b/frontend/src/lib/components/DateFilter/dateFilterLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import {
DateFilterLogicProps,
@@ -12,8 +12,6 @@ import { formatDate, formatDateRange, formatDateTime, formatDateTimeRange, isDat
import { DateMappingOption } from '~/types'
-import type { dateFilterLogicType } from './dateFilterLogicType'
-
const RELATIVE_UNIT_LABEL: Record<string, string> = {
h: 'hour',
d: 'day',
@@ -47,6 +45,136 @@ function hasTimePrecision(dateValue: string | Dayjs | null | undefined): boolean
return false
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateFilterLogicValues {
+ dateFrom: any
+ dateFromHasTimePrecision: boolean
+ dateOptions: DateMappingOption[] | undefined
+ dateTo: any
+ dateToHasTimePrecision: boolean
+ explicitDate: boolean
+ fixedRangeGranularity: 'day' | 'minute'
+ isCustomRelativeRange: boolean
+ isCustomRelativeRangeView: boolean
+ isDateToNow: boolean
+ isFixedDate: any
+ isFixedRange: boolean
+ isFixedRangeWithTime: boolean
+ isRollingDateRange: boolean
+ isVisible: boolean
+ label: string | null
+ rangeDateFrom: Dayjs | null
+ rangeDateTo: Dayjs | null
+ view: DateFilterView
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateFilterLogicActions {
+ applyRange: () => {
+ value: true
+ }
+ close: () => {
+ value: true
+ }
+ open: () => {
+ value: true
+ }
+ openCustomRelativeRange: () => {
+ value: true
+ }
+ openDateToNow: () => {
+ value: true
+ }
+ openFixedDate: () => {
+ value: true
+ }
+ openFixedRange: () => {
+ value: true
+ }
+ openFixedRangeWithTime: () => {
+ value: true
+ }
+ openJumpToTimestamp: () => {
+ value: true
+ }
+ setDate: (
+ dateFrom: string | null,
+ dateTo: string | null,
+ keepPopoverOpen?: any,
+ explicitDate?: boolean
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ explicitDate: boolean
+ keepPopoverOpen: any
+ }
+ setExplicitDate: (explicitDate: boolean) => {
+ explicitDate: boolean
+ }
+ setFixedRangeGranularity: (granularity: 'day' | 'minute') => {
+ granularity: 'day' | 'minute'
+ }
+ setRangeDateFrom: (range: Dayjs | null) => {
+ range: Dayjs | null
+ }
+ setRangeDateTo: (range: Dayjs | null) => {
+ range: Dayjs | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dateFilterLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ dateFrom: (arg: any) => any
+ dateTo: (arg: any) => any
+ dateOptions: (arg: any) => DateMappingOption[] | undefined
+ isFixedRange: (dateFrom: any, dateTo: any) => boolean
+ isFixedRangeWithTime: (
+ isFixedRange: boolean,
+ dateFromHasTimePrecision: boolean,
+ dateToHasTimePrecision: boolean
+ ) => boolean
+ isDateToNow: (dateFrom: any, dateTo: any, arg: any) => boolean
+ isFixedDate: (dateFrom: any, dateTo: any, arg: any) => any
+ isRollingDateRange: (
+ isFixedRange: boolean,
+ isDateToNow: boolean,
+ isFixedDate: any,
+ dateOptions: DateMappingOption[] | undefined,
+ dateFrom: any,
+ dateTo: any
+ ) => boolean
+ isCustomRelativeRange: (dateFrom: any, dateTo: any) => boolean
+ isCustomRelativeRangeView: (view: DateFilterView) => boolean
+ dateFromHasTimePrecision: (dateFrom: any) => boolean
+ dateToHasTimePrecision: (dateTo: any) => boolean
+ label: (
+ dateFrom: any,
+ dateTo: any,
+ isFixedRange: boolean,
+ isDateToNow: boolean,
+ isFixedDate: any,
+ isCustomRelativeRange: boolean,
+ dateOptions: DateMappingOption[] | undefined,
+ arg: any,
+ arg2: any,
+ arg3: any,
+ arg4: any,
+ arg5: any,
+ dateFromHasTimePrecision: boolean,
+ dateToHasTimePrecision: boolean
+ ) => string | null
+ }
+}
+
+export type dateFilterLogicType = MakeLogicType<
+ dateFilterLogicValues,
+ dateFilterLogicActions,
+ DateFilterLogicProps,
+ dateFilterLogicMeta
+>
+
export const dateFilterLogic = kea<dateFilterLogicType>([
path(['lib', 'components', 'DateFilter', 'DateFilterLogic']),
props({} as DateFilterLogicProps),
@@ -150,7 +278,7 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
],
isFixedRangeWithTime: [
(s) => [s.isFixedRange, s.dateFromHasTimePrecision, s.dateToHasTimePrecision],
- (isFixedRange, dateFromHasTimePrecision, dateToHasTimePrecision) =>
+ (isFixedRange: boolean, dateFromHasTimePrecision: boolean, dateToHasTimePrecision: boolean) =>
isFixedRange && (dateFromHasTimePrecision || dateToHasTimePrecision),
],
isDateToNow: [
@@ -164,7 +292,14 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
],
isRollingDateRange: [
(s) => [s.isFixedRange, s.isDateToNow, s.isFixedDate, s.dateOptions, s.dateFrom, s.dateTo],
- (isFixedRange, isDateToNow, isFixedDate, dateOptions, dateFrom, dateTo): boolean =>
+ (
+ isFixedRange: boolean,
+ isDateToNow: boolean,
+ isFixedDate,
+ dateOptions: DateMappingOption[] | undefined,
+ dateFrom,
+ dateTo
+ ): boolean =>
!isFixedRange &&
!isDateToNow &&
!isFixedDate &&
@@ -183,7 +318,10 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
return isRelativeFromDate && isRelativeToDate && !!dateFrom && !!dateTo
},
],
- isCustomRelativeRangeView: [(s) => [s.view], (view): boolean => view === DateFilterView.CustomRelativeRange],
+ isCustomRelativeRangeView: [
+ (s) => [s.view],
+ (view: DateFilterView): boolean => view === DateFilterView.CustomRelativeRange,
+ ],
dateFromHasTimePrecision: [(s) => [s.dateFrom], (dateFrom) => hasTimePrecision(dateFrom)],
dateToHasTimePrecision: [(s) => [s.dateTo], (dateTo) => hasTimePrecision(dateTo)],
label: [
@@ -206,18 +344,18 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
(
dateFrom,
dateTo,
- isFixedRange,
- isDateToNow,
+ isFixedRange: boolean,
+ isDateToNow: boolean,
isFixedDate,
- isCustomRelativeRange,
- dateOptions,
+ isCustomRelativeRange: boolean,
+ dateOptions: DateMappingOption[] | undefined,
isFixedDateMode,
placeholder,
allowTimePrecision,
showCustomRelativeRange,
allowSingleAndRange,
- dateFromHasTimePrecision,
- dateToHasTimePrecision
+ dateFromHasTimePrecision: boolean,
+ dateToHasTimePrecision: boolean
) => {
// Only render the "N days ago to M days ago" label when the consumer has opted into
// the custom-relative-range picker — other call sites (e.g. trends) may legitimately
diff --git a/frontend/src/lib/components/DateFilter/rollingDateRangeFilterLogic.ts b/frontend/src/lib/components/DateFilter/rollingDateRangeFilterLogic.ts
index d162b77c7b72..9d7d07872217 100644
--- a/frontend/src/lib/components/DateFilter/rollingDateRangeFilterLogic.ts
+++ b/frontend/src/lib/components/DateFilter/rollingDateRangeFilterLogic.ts
@@ -1,12 +1,10 @@
import './RollingDateRangeFilter.scss'
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { Dayjs } from 'lib/dayjs'
import { dateFilterToText } from 'lib/utils/dateFilters'
-import type { rollingDateRangeFilterLogicType } from './rollingDateRangeFilterLogicType'
-
const dateOptionsMap = {
y: 'years',
q: 'quarters',
@@ -48,6 +46,55 @@ const dateOptionDefault = (dateFrom: Dayjs | string | null | undefined): DateOpt
return 'days'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rollingDateRangeFilterLogicValues {
+ counter: number | null
+ dateOption: DateOption
+ formattedDate: string | null
+ isDateOptionsSelectorOpen: boolean
+ startOfDateRange: string | null
+ value: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rollingDateRangeFilterLogicActions {
+ decreaseCounter: () => {
+ value: true
+ }
+ increaseCounter: () => {
+ value: true
+ }
+ select: () => {
+ value: true
+ }
+ setCounter: (counter: number | null | undefined) => {
+ counter: number | null | undefined
+ }
+ setDateOption: (option: DateOption) => {
+ option: DateOption
+ }
+ toggleDateOptionsSelector: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rollingDateRangeFilterLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ value: (counter: number | null, dateOption: DateOption) => string
+ formattedDate: (value: string) => string | null
+ startOfDateRange: (value: string) => string | null
+ }
+}
+
+export type rollingDateRangeFilterLogicType = MakeLogicType<
+ rollingDateRangeFilterLogicValues,
+ rollingDateRangeFilterLogicActions,
+ RollingDateFilterLogicPropsType,
+ rollingDateRangeFilterLogicMeta
+>
+
export const rollingDateRangeFilterLogic = kea<rollingDateRangeFilterLogicType>([
path(['lib', 'components', 'DateFilter', 'RollingDateRangeFilterLogic']),
props({} as RollingDateFilterLogicPropsType),
@@ -97,7 +144,7 @@ export const rollingDateRangeFilterLogic = kea<rollingDateRangeFilterLogicType>(
selectors(() => ({
value: [
(s) => [s.counter, s.dateOption],
- (counter, dateOption) => {
+ (counter: number | null, dateOption: DateOption) => {
if (!counter) {
return ''
}
diff --git a/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts b/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
index dea1422a02ee..887dce8e891c 100644
--- a/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
+++ b/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, connect, events, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -20,7 +20,8 @@ import { ActionType, CohortType, EventDefinition, PropertyDefinition } from '~/t
import { DataWarehouseTableForInsight } from 'products/data_warehouse/frontend/types'
-import type { definitionPopoverLogicType } from './definitionPopoverLogicType'
+import type { PropertyDefinitionType } from '../../../types'
+import type { TaxonomicFilterValue } from '../TaxonomicFilter/types'
const IS_TEST_MODE = process.env.NODE_ENV === 'test'
@@ -42,6 +43,146 @@ export interface DefinitionPopoverLogicProps {
openDetailInNewTab?: boolean
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface definitionPopoverLogicValues {
+ getPropertyDefinition: (
+ s: TaxonomicFilterValue,
+ type: PropertyDefinitionType,
+ groupTypeIndex?: number
+ ) => PropertyDefinition | null // propertyDefinitionsModel
+ currentProjectId: number | string // teamLogic
+ definition: Partial<TaxonomicDefinitionTypes>
+ definitionLoading: boolean
+ dirty: boolean
+ hasSentAs: any
+ hideEdit: any
+ hideView: any
+ isAction: boolean
+ isCohort: boolean
+ isDataWarehouse: boolean
+ isDataWarehousePersonProperty: boolean
+ isEvent: boolean
+ isProperty: any
+ isViewable: boolean
+ isVirtual: boolean | undefined
+ localDefinition: Partial<TaxonomicDefinitionTypes>
+ mediaPreviews: string[]
+ openDetailInNewTab: any
+ resolvedDefinition: Partial<TaxonomicDefinitionTypes>
+ singularType: string
+ state: DefinitionPopoverState
+ type: any
+ viewFullDetailUrl: string | undefined
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface definitionPopoverLogicActions {
+ handleCancel: () => {
+ value: true
+ }
+ handleSave: (_: any) => any
+ handleSaveFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ handleSaveSuccess: (
+ definition: Partial<TaxonomicDefinitionTypes>,
+ payload?: any
+ ) => {
+ definition: Partial<TaxonomicDefinitionTypes>
+ payload?: any
+ }
+ recordHoverActivity: () => {
+ value: true
+ }
+ setDefinition: (item: Partial<TaxonomicDefinitionTypes>) => {
+ isDataWarehouse: boolean
+ item: Partial<TaxonomicDefinitionTypes>
+ selectedItemMeta: Record<string, any> | null | undefined
+ }
+ setDefinitionFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setDefinitionSuccess: (
+ definition: TaxonomicDefinitionTypes,
+ payload?: {
+ isDataWarehouse: boolean
+ item: Partial<TaxonomicDefinitionTypes>
+ selectedItemMeta: Record<string, any> | null | undefined
+ }
+ ) => {
+ definition: TaxonomicDefinitionTypes
+ payload?: {
+ isDataWarehouse: boolean
+ item: Partial<TaxonomicDefinitionTypes>
+ selectedItemMeta: Record<string, any> | null | undefined
+ }
+ }
+ setLocalDefinition: (item: Partial<TaxonomicDefinitionTypes>) => {
+ item: Partial<TaxonomicDefinitionTypes>
+ }
+ setPopoverState: (state: DefinitionPopoverState) => {
+ state: DefinitionPopoverState
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface definitionPopoverLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ type: (arg: any) => any
+ hideView: (arg: any) => any
+ hideEdit: (arg: any) => any
+ openDetailInNewTab: (arg: any) => any
+ singularType: (type: any) => string
+ mediaPreviews: (definition: Partial<TaxonomicDefinitionTypes>) => string[]
+ dirty: (
+ state: DefinitionPopoverState,
+ definition: Partial<TaxonomicDefinitionTypes>,
+ localDefinition: Partial<TaxonomicDefinitionTypes>
+ ) => boolean
+ isViewable: (type: any) => boolean
+ isAction: (type: any) => boolean
+ isEvent: (type: any) => boolean
+ isProperty: (type: any) => any
+ isVirtual: (definition: Partial<TaxonomicDefinitionTypes>) => boolean | undefined
+ hasSentAs: (type: any, isProperty: any, isEvent: boolean, isVirtual: boolean | undefined) => any
+ isCohort: (type: any) => boolean
+ isDataWarehouse: (type: any) => boolean
+ isDataWarehousePersonProperty: (type: any) => boolean
+ resolvedDefinition: (
+ definition: Partial<TaxonomicDefinitionTypes>,
+ isProperty: any,
+ type: any,
+ getPropertyDefinition: (
+ s: TaxonomicFilterValue,
+ type: PropertyDefinitionType,
+ groupTypeIndex?: number
+ ) => PropertyDefinition | null
+ ) => Partial<TaxonomicDefinitionTypes>
+ viewFullDetailUrl: (
+ resolvedDefinition: Partial<TaxonomicDefinitionTypes>,
+ isAction: boolean,
+ isEvent: boolean,
+ isProperty: any,
+ isCohort: boolean
+ ) => string | undefined
+ }
+}
+
+export type definitionPopoverLogicType = MakeLogicType<
+ definitionPopoverLogicValues,
+ definitionPopoverLogicActions,
+ DefinitionPopoverLogicProps,
+ definitionPopoverLogicMeta
+>
+
export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
props({} as DefinitionPopoverLogicProps),
path(['lib', 'components', 'DefinitionPanel', 'definitionPopoverLogic']),
@@ -170,12 +311,16 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
singularType: [(s) => [s.type], (type) => getSingularType(type)],
mediaPreviews: [
(s) => [s.definition],
- (definition): string[] => (definition as EventDefinition)?.media_preview_urls ?? [],
+ (definition: Partial<TaxonomicDefinitionTypes>): string[] =>
+ (definition as EventDefinition)?.media_preview_urls ?? [],
],
dirty: [
(s) => [s.state, s.definition, s.localDefinition],
- (state, definition, localDefinition) =>
- state === DefinitionPopoverState.Edit && !equal(definition, localDefinition),
+ (
+ state: DefinitionPopoverState,
+ definition: Partial<TaxonomicDefinitionTypes>,
+ localDefinition: Partial<TaxonomicDefinitionTypes>
+ ) => state === DefinitionPopoverState.Edit && !equal(definition, localDefinition),
],
isViewable: [
(s) => [s.type],
@@ -219,13 +364,13 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
],
isVirtual: [
(s) => [s.definition],
- (definition) => {
+ (definition: Partial<TaxonomicDefinitionTypes>) => {
return 'virtual' in definition && definition.virtual
},
],
hasSentAs: [
(s) => [s.type, s.isProperty, s.isEvent, s.isVirtual],
- (type, isProperty, isEvent, isVirtual) =>
+ (type, isProperty, isEvent: boolean, isVirtual: boolean | undefined) =>
isEvent || (isProperty && !isVirtual && type !== TaxonomicFilterGroupType.SessionProperties),
],
isCohort: [(s) => [s.type], (type) => type === TaxonomicFilterGroupType.Cohorts],
@@ -236,7 +381,16 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
],
resolvedDefinition: [
(s) => [s.definition, s.isProperty, s.type, s.getPropertyDefinition],
- (definition, isProperty, type, getPropertyDefinition): Partial<TaxonomicDefinitionTypes> => {
+ (
+ definition: Partial<TaxonomicDefinitionTypes>,
+ isProperty,
+ type,
+ getPropertyDefinition: (
+ s: import('lib/components/TaxonomicFilter/types').TaxonomicFilterValue,
+ type: import('~/types').PropertyDefinitionType,
+ groupTypeIndex?: number
+ ) => PropertyDefinition | null
+ ): Partial<TaxonomicDefinitionTypes> => {
// Pinned/default property items are stored as { name } only. Hydrate them with the
// saved definition id recovered from propertyDefinitionsModel so View, Edit and Save
// all operate on a complete definition (and self-heal as the model loads) rather
@@ -258,7 +412,13 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
],
viewFullDetailUrl: [
(s) => [s.resolvedDefinition, s.isAction, s.isEvent, s.isProperty, s.isCohort],
- (resolvedDefinition, isAction, isEvent, isProperty, isCohort) => {
+ (
+ resolvedDefinition: Partial<TaxonomicDefinitionTypes>,
+ isAction: boolean,
+ isEvent: boolean,
+ isProperty,
+ isCohort: boolean
+ ) => {
if (isAction) {
const id = (resolvedDefinition as ActionType).id
return id != null ? urls.action(id) : undefined
diff --git a/frontend/src/lib/components/DomainConnect/domainConnectLogic.ts b/frontend/src/lib/components/DomainConnect/domainConnectLogic.ts
index 3e3297ca7f98..a2a9f2caa801 100644
--- a/frontend/src/lib/components/DomainConnect/domainConnectLogic.ts
+++ b/frontend/src/lib/components/DomainConnect/domainConnectLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -7,8 +7,6 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { DomainConnectProviderName } from '~/queries/schema/schema-general'
-import type { domainConnectLogicType } from './domainConnectLogicType'
-
export interface DomainConnectProvider {
endpoint: string
name: DomainConnectProviderName
@@ -33,6 +31,62 @@ export interface DomainConnectLogicProps {
proxyRecordId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface domainConnectLogicValues {
+ autoDetected: boolean
+ availableProviders: DomainConnectProvider[]
+ domainConnectInfo: any
+ domainConnectInfoLoading: boolean
+ hasAnyOption: boolean
+ providerName: DomainConnectProviderName | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface domainConnectLogicActions {
+ checkDomain: () => {
+ value: true
+ }
+ checkDomainFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ checkDomainSuccess: (
+ domainConnectInfo: DomainConnectInfo | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ domainConnectInfo: DomainConnectInfo | null
+ payload?: {
+ value: true
+ }
+ }
+ openDomainConnect: (providerEndpoint?: string) => {
+ providerEndpoint: string | undefined
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface domainConnectLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ autoDetected: (domainConnectInfo: any) => boolean
+ providerName: (domainConnectInfo: any) => DomainConnectProviderName | null
+ availableProviders: (domainConnectInfo: any) => DomainConnectProvider[]
+ hasAnyOption: (autoDetected: boolean, availableProviders: DomainConnectProvider[]) => boolean
+ }
+}
+
+export type domainConnectLogicType = MakeLogicType<
+ domainConnectLogicValues,
+ domainConnectLogicActions,
+ DomainConnectLogicProps,
+ domainConnectLogicMeta
+>
+
export const domainConnectLogic = kea<domainConnectLogicType>([
path((key) => ['lib', 'components', 'DomainConnect', 'domainConnectLogic', key]),
props({} as DomainConnectLogicProps),
diff --git a/frontend/src/lib/components/Errors/Frame/framesCodeSourceLogic.ts b/frontend/src/lib/components/Errors/Frame/framesCodeSourceLogic.ts
index 2df9c5a90419..af9aefe4ce4f 100644
--- a/frontend/src/lib/components/Errors/Frame/framesCodeSourceLogic.ts
+++ b/frontend/src/lib/components/Errors/Frame/framesCodeSourceLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import { match } from 'ts-pattern'
@@ -9,14 +9,47 @@ import {
import api from 'lib/api'
-import type { framesCodeSourceLogicType } from './framesCodeSourceLogicType'
import { stackFrameLogic } from './stackFrameLogic'
+import type { KeyedStackFrameRecords } from './stackFrameLogic'
export interface SourceData {
url: string
provider: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface framesCodeSourceLogicValues {
+ stackFrameRecords: KeyedStackFrameRecords // stackFrameLogic
+ frameSourceUrls: Record<string, SourceData | null>
+ getSourceDataForFrame: (rawId: string) => SourceData | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface framesCodeSourceLogicActions {
+ computeSourceUrls: () => {
+ value: true
+ }
+ setSourceData: (data: Record<string, SourceData | null>) => {
+ data: Record<string, SourceData | null>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface framesCodeSourceLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ getSourceDataForFrame: (
+ frameSourceUrls: Record<string, SourceData | null>
+ ) => (rawId: string) => SourceData | null
+ }
+}
+
+export type framesCodeSourceLogicType = MakeLogicType<
+ framesCodeSourceLogicValues,
+ framesCodeSourceLogicActions,
+ Record<string, any>,
+ framesCodeSourceLogicMeta
+>
+
export const framesCodeSourceLogic = kea<framesCodeSourceLogicType>([
path(['components', 'Errors', 'framesCodeSourceLogic']),
diff --git a/frontend/src/lib/components/Errors/Frame/stackFrameLogic.ts b/frontend/src/lib/components/Errors/Frame/stackFrameLogic.ts
index 4f52e4ef6a46..a1272d49eca6 100644
--- a/frontend/src/lib/components/Errors/Frame/stackFrameLogic.ts
+++ b/frontend/src/lib/components/Errors/Frame/stackFrameLogic.ts
@@ -1,11 +1,10 @@
-import { actions, afterMount, kea, listeners, path } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
import api from 'lib/api'
import { ErrorTrackingStackFrame, ErrorTrackingStackFrameRecord, ErrorTrackingSymbolSet } from '../types'
-import type { stackFrameLogicType } from './stackFrameLogicType'
export type KeyedStackFrameRecords = Record<ErrorTrackingStackFrameRecord['raw_id'], ErrorTrackingStackFrameRecord>
@@ -22,6 +21,60 @@ function mapStackFrameRecords(
)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface stackFrameLogicValues {
+ stackFrameRecords: KeyedStackFrameRecords
+ stackFrameRecordsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface stackFrameLogicActions {
+ loadForSymbolSet: (symbolSetId: ErrorTrackingSymbolSet['id']) => {
+ symbolSetId: string
+ }
+ loadForSymbolSetFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadForSymbolSetSuccess: (
+ stackFrameRecords: KeyedStackFrameRecords,
+ payload?: {
+ symbolSetId: string
+ }
+ ) => {
+ stackFrameRecords: KeyedStackFrameRecords
+ payload?: {
+ symbolSetId: string
+ }
+ }
+ loadFromRawIds: (rawIds: ErrorTrackingStackFrame['raw_id'][]) => {
+ rawIds: string[]
+ }
+ loadFromRawIdsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadFromRawIdsSuccess: (
+ stackFrameRecords: KeyedStackFrameRecords,
+ payload?: {
+ rawIds: string[]
+ }
+ ) => {
+ stackFrameRecords: KeyedStackFrameRecords
+ payload?: {
+ rawIds: string[]
+ }
+ }
+}
+
+export type stackFrameLogicType = MakeLogicType<stackFrameLogicValues, stackFrameLogicActions>
+
export const stackFrameLogic = kea<stackFrameLogicType>([
path(['components', 'Errors', 'stackFrameLogic']),
diff --git a/frontend/src/lib/components/Errors/errorPropertiesLogic.ts b/frontend/src/lib/components/Errors/errorPropertiesLogic.ts
index 2bffd49a619b..5a13cf079f39 100644
--- a/frontend/src/lib/components/Errors/errorPropertiesLogic.ts
+++ b/frontend/src/lib/components/Errors/errorPropertiesLogic.ts
@@ -1,4 +1,4 @@
-import { connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import {
@@ -20,14 +20,80 @@ import {
import { dayjs } from 'lib/dayjs'
import { preflightLogic } from 'lib/logic/preflightLogic'
-import type { errorPropertiesLogicType } from './errorPropertiesLogicType'
import { KeyedStackFrameRecords, stackFrameLogic } from './Frame/stackFrameLogic'
+import type { ExceptionAttributes } from './types'
export interface ErrorPropertiesLogicProps {
properties?: ErrorEventProperties
id: ErrorEventId
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorPropertiesLogicValues {
+ isCloudOrDev: boolean | undefined // preflightLogic
+ stackFrameRecords: KeyedStackFrameRecords // stackFrameLogic
+ stackFrameRecordsLoading: boolean // stackFrameLogic
+ additionalProperties: Record<string, unknown>
+ exceptionAttributes: ExceptionAttributes | null
+ exceptionList: ErrorTrackingException[]
+ exceptionType: string | null
+ fingerprintRecords: FingerprintRecordPart[]
+ frames: ErrorTrackingStackFrame[]
+ getExceptionFingerprint: (excId: string) => FingerprintRecordPart | undefined
+ getFrameFingerprint: (frameRawId: string) => FingerprintRecordPart | undefined
+ hasStacktrace: boolean
+ properties: Record<string, any>
+ recordingStatus: string | undefined
+ release: ErrorTrackingRelease | null | undefined
+ sessionId: string | undefined
+ uuid: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorPropertiesLogicActions {
+ loadFromRawIds: (rawIds: string[]) => {
+ rawIds: string[]
+ } // stackFrameLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorPropertiesLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ properties: (arg: ErrorEventProperties) => Record<string, any>
+ exceptionAttributes: (properties: Record<string, any>) => ExceptionAttributes | null
+ exceptionList: (properties: Record<string, any>) => ErrorTrackingException[]
+ exceptionType: (exceptionList: ErrorTrackingException[]) => string | null
+ additionalProperties: (
+ properties: Record<string, any>,
+ isCloudOrDev: boolean | undefined
+ ) => Record<string, unknown>
+ fingerprintRecords: (properties: Record<string, any>) => FingerprintRecordPart[]
+ hasStacktrace: (exceptionList: ErrorTrackingException[]) => boolean
+ sessionId: (properties: Record<string, any>) => string | undefined
+ recordingStatus: (properties: Record<string, any>) => string | undefined
+ getExceptionFingerprint: (
+ fingerprintRecords: FingerprintRecordPart[]
+ ) => (excId: string) => FingerprintRecordPart | undefined
+ getFrameFingerprint: (
+ fingerprintRecords: FingerprintRecordPart[]
+ ) => (frameRawId: string) => FingerprintRecordPart | undefined
+ frames: (exceptionList: ErrorTrackingException[]) => ErrorTrackingStackFrame[]
+ uuid: (id: string) => string
+ release: (
+ frames: ErrorTrackingStackFrame[],
+ stackFrameRecords: KeyedStackFrameRecords
+ ) => ErrorTrackingRelease | null | undefined
+ }
+}
+
+export type errorPropertiesLogicType = MakeLogicType<
+ errorPropertiesLogicValues,
+ errorPropertiesLogicActions,
+ ErrorPropertiesLogicProps,
+ errorPropertiesLogicMeta
+>
+
export const errorPropertiesLogic = kea<errorPropertiesLogicType>([
path((key) => ['components', 'Errors', 'errorPropertiesLogic', key]),
props({} as ErrorPropertiesLogicProps),
diff --git a/frontend/src/lib/components/EventPropertyTabs/eventPropertyFilteringLogic.ts b/frontend/src/lib/components/EventPropertyTabs/eventPropertyFilteringLogic.ts
index c79328e7fcaa..29717a7a1baf 100644
--- a/frontend/src/lib/components/EventPropertyTabs/eventPropertyFilteringLogic.ts
+++ b/frontend/src/lib/components/EventPropertyTabs/eventPropertyFilteringLogic.ts
@@ -1,11 +1,33 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { preflightLogic } from 'lib/logic/preflightLogic'
import { userPreferencesLogic } from 'lib/logic/userPreferencesLogic'
import { CLOUD_INTERNAL_POSTHOG_PROPERTY_KEYS, PROPERTY_KEYS } from '~/taxonomy/taxonomy'
-import type { eventPropertyFilteringLogicType } from './eventPropertyFilteringLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventPropertyFilteringLogicValues {
+ isCloudOrDev: boolean | undefined // preflightLogic
+ hidePostHogPropertiesInTable: boolean // userPreferencesLogic
+ filterProperties: (props: Record<string, any>) => Record<string, any>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventPropertyFilteringLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filterProperties: (
+ hidePostHogPropertiesInTable: boolean,
+ isCloudOrDev: boolean | undefined
+ ) => (props: Record<string, any>) => Record<string, any>
+ }
+}
+
+export type eventPropertyFilteringLogicType = MakeLogicType<
+ eventPropertyFilteringLogicValues,
+ {},
+ Record<string, any>,
+ eventPropertyFilteringLogicMeta
+>
export const eventPropertyFilteringLogic = kea<eventPropertyFilteringLogicType>([
path(['lib', 'components', 'EventPropertyTabs', 'eventPropertyFilteringLogic']),
@@ -15,7 +37,7 @@ export const eventPropertyFilteringLogic = kea<eventPropertyFilteringLogicType>(
selectors({
filterProperties: [
(s) => [s.hidePostHogPropertiesInTable, s.isCloudOrDev],
- (hidePostHogPropertiesInTable, isCloudOrDev) => {
+ (hidePostHogPropertiesInTable: boolean, isCloudOrDev: boolean | undefined) => {
return (props: Record<string, any>) => {
if (!hidePostHogPropertiesInTable) {
return props
diff --git a/frontend/src/lib/components/ExportButton/exportsLogic.ts b/frontend/src/lib/components/ExportButton/exportsLogic.ts
index f1dd75a38da7..27df1fef3713 100644
--- a/frontend/src/lib/components/ExportButton/exportsLogic.ts
+++ b/frontend/src/lib/components/ExportButton/exportsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -16,8 +16,6 @@ import { cohortsModel } from '~/models/cohortsModel'
import { AnyDataNode } from '~/queries/schema/schema-general'
import { APIErrorType, CohortType, ExportContext, ExportedAssetType, ExporterFormat, LocalExportContext } from '~/types'
-import type { exportsLogicType } from './exportsLogicType'
-
const POLL_DELAY_MS = 10000
// Long-running formats (e.g. MP4 session-replay renders) can take 30+ minutes,
// so polling every 10s produces unhelpful timeout noise. Back off when the
@@ -37,6 +35,119 @@ export const pickPollDelayMs = (pendingAssets: ExportedAssetType[]): number => {
const isLocalExport = (context: ExportContext | undefined): context is LocalExportContext =>
!!(context && 'localData' in context)
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exportsLogicValues {
+ assetFormat: ExporterFormat | null
+ exports: ExportedAssetType[]
+ exportsLoading: boolean
+ freshUndownloadedExports: ExportedAssetType[]
+ hasReachedExportFullVideoLimit: boolean
+ pollingExports: ExportedAssetType[]
+ pollingExportsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exportsLogicActions {
+ addFresh: (exportedAsset: ExportedAssetType) => {
+ exportedAsset: ExportedAssetType
+ }
+ checkExportStatus: (exportedAsset: ExportedAssetType) => {
+ exportedAsset: ExportedAssetType
+ }
+ createExport: ({ exportData }: any) => any
+ createExportFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createExportSuccess: (
+ pollingExports: any[],
+ payload?: any
+ ) => {
+ pollingExports: any[]
+ payload?: any
+ }
+ createStaticCohort: (
+ name: string,
+ query: AnyDataNode
+ ) => {
+ name: string
+ query: AnyDataNode
+ }
+ loadExports: () => {
+ value: true
+ }
+ loadExportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadExportsSuccess: (
+ exports: ExportedAssetType[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ exports: ExportedAssetType[]
+ payload?: {
+ value: true
+ }
+ }
+ pollExportStatus: (exportedAsset: ExportedAssetType) => {
+ exportedAsset: ExportedAssetType
+ }
+ removeFresh: (exportedAsset: ExportedAssetType) => {
+ exportedAsset: ExportedAssetType
+ }
+ setAssetFormat: (format: ExporterFormat | null) => {
+ format: ExporterFormat | null
+ }
+ setHasReachedExportFullVideoLimit: (hasReached: boolean) => {
+ hasReached: boolean
+ }
+ startExport: (exportData: TriggerExportProps) => {
+ exportData: TriggerExportProps
+ }
+ startHeatmapExport: (export_context: ExportContext) => {
+ export_context: ExportContext
+ }
+ startReplayExport: (
+ sessionRecordingId: string,
+ format?: ExporterFormat,
+ timestamp?: number,
+ duration?: number,
+ mode?: SessionRecordingPlayerMode,
+ options?: {
+ css_selector?: string
+ filename?: string
+ height?: number
+ skip_inactivity?: boolean
+ width?: number
+ }
+ ) => {
+ duration: number | undefined
+ format: ExporterFormat | undefined
+ mode: SessionRecordingPlayerMode | undefined
+ options:
+ | {
+ css_selector?: string | undefined
+ filename?: string | undefined
+ height?: number | undefined
+ skip_inactivity?: boolean | undefined
+ width?: number | undefined
+ }
+ | undefined
+ sessionRecordingId: string
+ timestamp: number | undefined
+ }
+}
+
+export type exportsLogicType = MakeLogicType<exportsLogicValues, exportsLogicActions>
+
export const exportsLogic = kea<exportsLogicType>([
path(['scenes', 'navigation', 'sidepanel', 'exportsLogic']),
diff --git a/frontend/src/lib/components/FileSystem/ItemSelectModal/itemSelectModalLogic.tsx b/frontend/src/lib/components/FileSystem/ItemSelectModal/itemSelectModalLogic.tsx
index c304d4aa8a32..221128304bd5 100644
--- a/frontend/src/lib/components/FileSystem/ItemSelectModal/itemSelectModalLogic.tsx
+++ b/frontend/src/lib/components/FileSystem/ItemSelectModal/itemSelectModalLogic.tsx
@@ -1,5 +1,6 @@
-import { actions, connect, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { lemonToast } from '@posthog/lemon-ui'
@@ -10,7 +11,100 @@ import { projectTreeDataLogic } from '~/layout/panel-layout/ProjectTree/projectT
import { joinPath, splitPath } from '~/layout/panel-layout/ProjectTree/utils'
import { FileSystemEntry } from '~/queries/schema/schema-general'
-import type { itemSelectModalLogicType } from './itemSelectModalLogicType'
+import type { FeatureFlagsSet } from '../../../logic/featureFlagLogic'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface itemSelectModalLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ shortcutData: FileSystemEntry[] // projectTreeDataLogic
+ form: {
+ item: TreeDataItem | null
+ }
+ formAllErrors: Record<string, any>
+ formChanged: boolean
+ formErrors: DeepPartialMap<
+ {
+ item: TreeDataItem | null
+ },
+ ValidationErrorType
+ >
+ formHasErrors: boolean
+ formManualErrors: Record<string, any>
+ formTouched: boolean
+ formTouches: Record<string, boolean>
+ formValidationErrors: DeepPartialMap<
+ {
+ item: TreeDataItem | null
+ },
+ ValidationErrorType
+ >
+ isFormSubmitting: boolean
+ isFormValid: boolean
+ isOpen: boolean
+ showFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface itemSelectModalLogicActions {
+ addShortcutItem: (item: FileSystemEntry) => {
+ item: FileSystemEntry
+ } // projectTreeDataLogic
+ closeItemSelectModal: () => {
+ value: true
+ }
+ openItemSelectModal: () => {
+ value: true
+ }
+ resetForm: (values?: { item: TreeDataItem | null }) => {
+ values?: {
+ item: TreeDataItem | null
+ }
+ }
+ setFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFormValues: (
+ values: DeepPartial<{
+ item: TreeDataItem | null
+ }>
+ ) => {
+ values: DeepPartial<{
+ item: TreeDataItem | null
+ }>
+ }
+ submitForm: () => {
+ value: boolean
+ }
+ submitFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFormRequest: (form: { item: TreeDataItem | null }) => {
+ form: {
+ item: TreeDataItem | null
+ }
+ }
+ submitFormSuccess: (form: { item: TreeDataItem | null }) => {
+ form: {
+ item: TreeDataItem | null
+ }
+ }
+ touchFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type itemSelectModalLogicType = MakeLogicType<itemSelectModalLogicValues, itemSelectModalLogicActions>
export const itemSelectModalLogic = kea<itemSelectModalLogicType>([
path(['lib', 'components', 'FileSystem', 'ItemSelectModal', 'itemSelectModalLogic']),
diff --git a/frontend/src/lib/components/FileSystem/LinkTo/linkToLogic.tsx b/frontend/src/lib/components/FileSystem/LinkTo/linkToLogic.tsx
index 870f213a011d..b0e63cb7550c 100644
--- a/frontend/src/lib/components/FileSystem/LinkTo/linkToLogic.tsx
+++ b/frontend/src/lib/components/FileSystem/LinkTo/linkToLogic.tsx
@@ -1,5 +1,6 @@
-import { actions, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
@@ -9,7 +10,118 @@ import { projectTreeLogic } from '~/layout/panel-layout/ProjectTree/projectTreeL
import { calculateMovePath, joinPath, splitPath } from '~/layout/panel-layout/ProjectTree/utils'
import { FileSystemEntry } from '~/queries/schema/schema-general'
-import type { linkToLogicType } from './linkToLogicType'
+import type { ProjectTreeRef } from '../../../../types'
+import type { FeatureFlagsSet } from '../../../logic/featureFlagLogic'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkToLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ lastNewFolder: string | null // projectTreeDataLogic
+ projectTreeRef: ProjectTreeRef | null // projectTreeDataLogic
+ projectTreeRefEntry: FileSystemEntry | null // projectTreeDataLogic
+ form: {
+ folder: string | null
+ }
+ formAllErrors: Record<string, any>
+ formChanged: boolean
+ formErrors: DeepPartialMap<
+ {
+ folder: string | null
+ },
+ ValidationErrorType
+ >
+ formHasErrors: boolean
+ formManualErrors: Record<string, any>
+ formTouched: boolean
+ formTouches: Record<string, boolean>
+ formValidationErrors: DeepPartialMap<
+ {
+ folder: string | null
+ },
+ ValidationErrorType
+ >
+ isFormSubmitting: boolean
+ isFormValid: boolean
+ isOpen: boolean
+ linkingItems: FileSystemEntry[]
+ showFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkToLogicActions {
+ linkItem: (
+ oldPath: string,
+ newPath: string,
+ force: boolean,
+ projectTreeLogicKey: string
+ ) => {
+ force: boolean
+ newPath: string
+ oldPath: string
+ projectTreeLogicKey: string
+ } // projectTreeDataLogic
+ setLastNewFolder: (folder: string | null) => {
+ folder: string | null
+ } // projectTreeDataLogic
+ closeLinkToModal: () => {
+ value: true
+ }
+ closedLinkToModal: () => {
+ value: true
+ }
+ openLinkToModal: (items: FileSystemEntry[]) => {
+ items: FileSystemEntry[]
+ }
+ resetForm: (values?: { folder: string | null }) => {
+ values?: {
+ folder: string | null
+ }
+ }
+ setFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFormValues: (
+ values: DeepPartial<{
+ folder: string | null
+ }>
+ ) => {
+ values: DeepPartial<{
+ folder: string | null
+ }>
+ }
+ submitForm: () => {
+ value: boolean
+ }
+ submitFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFormRequest: (form: { folder: string | null }) => {
+ form: {
+ folder: string | null
+ }
+ }
+ submitFormSuccess: (form: { folder: string | null }) => {
+ form: {
+ folder: string | null
+ }
+ }
+ touchFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type linkToLogicType = MakeLogicType<linkToLogicValues, linkToLogicActions>
export const linkToLogic = kea<linkToLogicType>([
path(['lib', 'components', 'LinkTo', 'linkToLogic']),
diff --git a/frontend/src/lib/components/FileSystem/MoveTo/moveToLogic.tsx b/frontend/src/lib/components/FileSystem/MoveTo/moveToLogic.tsx
index 19029cc4ddc9..f8b3bf788671 100644
--- a/frontend/src/lib/components/FileSystem/MoveTo/moveToLogic.tsx
+++ b/frontend/src/lib/components/FileSystem/MoveTo/moveToLogic.tsx
@@ -1,5 +1,6 @@
-import { actions, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
@@ -9,7 +10,118 @@ import { projectTreeLogic } from '~/layout/panel-layout/ProjectTree/projectTreeL
import { calculateMovePath, joinPath, splitPath } from '~/layout/panel-layout/ProjectTree/utils'
import { FileSystemEntry } from '~/queries/schema/schema-general'
-import type { moveToLogicType } from './moveToLogicType'
+import type { ProjectTreeRef } from '../../../../types'
+import type { FeatureFlagsSet } from '../../../logic/featureFlagLogic'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface moveToLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ lastNewFolder: string | null // projectTreeDataLogic
+ projectTreeRef: ProjectTreeRef | null // projectTreeDataLogic
+ projectTreeRefEntry: FileSystemEntry | null // projectTreeDataLogic
+ form: {
+ folder: string | null
+ }
+ formAllErrors: Record<string, any>
+ formChanged: boolean
+ formErrors: DeepPartialMap<
+ {
+ folder: string | null
+ },
+ ValidationErrorType
+ >
+ formHasErrors: boolean
+ formManualErrors: Record<string, any>
+ formTouched: boolean
+ formTouches: Record<string, boolean>
+ formValidationErrors: DeepPartialMap<
+ {
+ folder: string | null
+ },
+ ValidationErrorType
+ >
+ isFormSubmitting: boolean
+ isFormValid: boolean
+ isOpen: boolean
+ movingItems: FileSystemEntry[]
+ showFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface moveToLogicActions {
+ moveItem: (
+ item: FileSystemEntry,
+ newPath: string,
+ force: boolean,
+ projectTreeLogicKey: string
+ ) => {
+ force: boolean
+ item: FileSystemEntry
+ newPath: string
+ projectTreeLogicKey: string
+ } // projectTreeDataLogic
+ setLastNewFolder: (folder: string | null) => {
+ folder: string | null
+ } // projectTreeDataLogic
+ closeMoveToModal: () => {
+ value: true
+ }
+ closedMoveToModal: () => {
+ value: true
+ }
+ openMoveToModal: (items: FileSystemEntry[]) => {
+ items: FileSystemEntry[]
+ }
+ resetForm: (values?: { folder: string | null }) => {
+ values?: {
+ folder: string | null
+ }
+ }
+ setFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFormValues: (
+ values: DeepPartial<{
+ folder: string | null
+ }>
+ ) => {
+ values: DeepPartial<{
+ folder: string | null
+ }>
+ }
+ submitForm: () => {
+ value: boolean
+ }
+ submitFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFormRequest: (form: { folder: string | null }) => {
+ form: {
+ folder: string | null
+ }
+ }
+ submitFormSuccess: (form: { folder: string | null }) => {
+ form: {
+ folder: string | null
+ }
+ }
+ touchFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type moveToLogicType = MakeLogicType<moveToLogicValues, moveToLogicActions>
export const moveToLogic = kea<moveToLogicType>([
path(['lib', 'components', 'MoveTo', 'moveToLogic']),
diff --git a/frontend/src/lib/components/HTMLElementsDisplay/htmlElementsDisplayLogic.ts b/frontend/src/lib/components/HTMLElementsDisplay/htmlElementsDisplayLogic.ts
index 5318d3689016..2b600957ef79 100644
--- a/frontend/src/lib/components/HTMLElementsDisplay/htmlElementsDisplayLogic.ts
+++ b/frontend/src/lib/components/HTMLElementsDisplay/htmlElementsDisplayLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, path, props, propsChanged, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, propsChanged, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import {
@@ -10,8 +10,6 @@ import { objectsEqual } from 'lib/utils/objects'
import { ElementType } from '~/types'
-import type { htmlElementsDisplayLogicType } from './htmlElementsDisplayLogicType'
-
export interface HtmlElementDisplayLogicProps {
checkUniqueness: boolean
onChange?: (selector: string, isUnique?: boolean) => void
@@ -25,6 +23,56 @@ export const elementsChain = (providedElements: ElementType[] | undefined): Elem
return safeElements.reverse()
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface htmlElementsDisplayLogicValues {
+ chosenSelector: string
+ chosenSelectorMatchCount: number | null
+ elements: ElementType[]
+ elementsToShowDepth: number
+ messageStatus: 'info' | 'success' | 'warning'
+ parsedElements: ElementType[]
+ parsedSelectors: Record<number, ParsedCSSSelector>
+ parsedSelectorsRaw: Record<number, ParsedCSSSelector>
+ visibleElements: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface htmlElementsDisplayLogicActions {
+ setElements: (providedElements: ElementType[]) => {
+ providedElements: ElementType[]
+ }
+ setParsedSelectors: (selectors: Record<number, ParsedCSSSelector>) => {
+ selectors: Record<number, ParsedCSSSelector>
+ }
+ showAdditionalElements: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface htmlElementsDisplayLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ parsedSelectors: (
+ parsedSelectorsRaw: Record<number, ParsedCSSSelector>,
+ arg: any,
+ elements: ElementType[]
+ ) => Record<number, ParsedCSSSelector>
+ parsedElements: (elements: ElementType[], visibleElements: number) => ElementType[]
+ elementsToShowDepth: (elements: ElementType[], visibleElements: number) => number
+ chosenSelector: (parsedSelectors: Record<number, ParsedCSSSelector>) => string
+ chosenSelectorMatchCount: (chosenSelector: string, arg: any) => number | null
+ messageStatus: (chosenSelectorMatchCount: number | null) => 'info' | 'success' | 'warning'
+ }
+}
+
+export type htmlElementsDisplayLogicType = MakeLogicType<
+ htmlElementsDisplayLogicValues,
+ htmlElementsDisplayLogicActions,
+ HtmlElementDisplayLogicProps,
+ htmlElementsDisplayLogicMeta
+>
+
export const htmlElementsDisplayLogic = kea<htmlElementsDisplayLogicType>([
path(['lib', 'components', 'HtmlElementsDisplay', 'htmlElementsDisplayLogic']),
props({ checkUniqueness: true } as HtmlElementDisplayLogicProps),
@@ -54,14 +102,18 @@ export const htmlElementsDisplayLogic = kea<htmlElementsDisplayLogicType>([
// each element in the chain has a parsed selector it uses to track which things are selected
parsedSelectors: [
(s) => [s.parsedSelectorsRaw, (_, props) => props.startingSelector, s.elements],
- (parsedSelectorsRaw, startingSelector, providedElements): Record<number, ParsedCSSSelector> =>
+ (
+ parsedSelectorsRaw: Record<number, ParsedCSSSelector>,
+ startingSelector,
+ providedElements: ElementType[]
+ ): Record<number, ParsedCSSSelector> =>
startingSelector && Object.keys(parsedSelectorsRaw).length === 0
? preselect(providedElements, startingSelector)
: parsedSelectorsRaw,
],
parsedElements: [
(s) => [s.elements, s.visibleElements],
- (elements, visibleElements) => {
+ (elements: ElementType[], visibleElements: number) => {
return elements.slice(Math.max(elements.length - visibleElements, 0))
},
],
@@ -74,7 +126,7 @@ export const htmlElementsDisplayLogic = kea<htmlElementsDisplayLogicType>([
// contains the selector string built from the parsed selectors
chosenSelector: [
(s) => [s.parsedSelectors],
- (parsedSelectors): string => {
+ (parsedSelectors: Record<number, ParsedCSSSelector>): string => {
let lastKey = -2
let builtSelector = ''
@@ -102,7 +154,7 @@ export const htmlElementsDisplayLogic = kea<htmlElementsDisplayLogicType>([
],
chosenSelectorMatchCount: [
(s) => [s.chosenSelector, (_, props) => props.checkUniqueness],
- (chosenSelector, checkUniqueness): number | null => {
+ (chosenSelector: string, checkUniqueness): number | null => {
let selectorMatchCount: number | null = null
if (checkUniqueness && chosenSelector !== 'no selectors chosen') {
try {
@@ -117,7 +169,7 @@ export const htmlElementsDisplayLogic = kea<htmlElementsDisplayLogicType>([
],
messageStatus: [
(s) => [s.chosenSelectorMatchCount],
- (chosenSelectorMatchCount) => {
+ (chosenSelectorMatchCount: number | null) => {
return chosenSelectorMatchCount === null
? 'info'
: chosenSelectorMatchCount === 1
diff --git a/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts b/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
index 7316a94960db..6a6d02a99903 100644
--- a/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
+++ b/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
@@ -1,4 +1,15 @@
-import { actions, afterMount, beforeUnmount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ listeners,
+ path,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -11,10 +22,106 @@ import { toolbarConfigLogic } from '~/toolbar/toolbarConfigLogic'
import { toolbarFetch } from '~/toolbar/toolbarFetch'
import { HedgehogConfig, MinimalHedgehogConfig } from '~/types'
+import type { OrganizationMemberType, UserType } from '../../../types'
import { sanitizeHedgehogConfig } from './hedgehog-mode-utils'
-import type { hedgehogModeLogicType } from './hedgehogModeLogicType'
import { HedgehogModeInterface } from './types'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hedgehogModeLogicValues {
+ members: OrganizationMemberType[] | null // membersLogic
+ user: UserType | null // userLogic
+ hedgehogConfig: HedgehogConfig
+ hedgehogMode: HedgehogModeInterface | null
+ hedgehogModeEnabled: boolean
+ minimalHedgehogConfig: MinimalHedgehogConfig
+ remoteConfig: Partial<HedgehogConfig> | null
+ remoteConfigLoading: boolean
+ remoteConfigUpdateDisabled: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hedgehogModeLogicActions {
+ ensureAllMembersLoaded: () => {
+ value: true
+ } // membersLogic
+ loadRemoteConfig: () => {
+ value: true
+ }
+ loadRemoteConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRemoteConfigSuccess: (
+ remoteConfig: Partial<HedgehogConfig> | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ remoteConfig: Partial<HedgehogConfig> | null
+ payload?: {
+ value: true
+ }
+ }
+ setHedgehogMode: (hedgeHogMode: HedgehogModeInterface) => {
+ hedgeHogMode: HedgehogModeInterface
+ }
+ setHedgehogModeEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setRemoteConfigUpdateDisabled: (disabled: boolean) => {
+ disabled: boolean
+ }
+ syncFromState: () => {
+ value: true
+ }
+ syncGame: () => {
+ value: true
+ }
+ toggleHedgehogMode: () => {
+ value: true
+ }
+ updateRemoteConfig: (config: Partial<HedgehogConfig>) => {
+ config: Partial<HedgehogConfig>
+ }
+ updateRemoteConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateRemoteConfigSuccess: (
+ remoteConfig: Partial<HedgehogConfig> | null,
+ payload?: {
+ config: Partial<HedgehogConfig>
+ }
+ ) => {
+ remoteConfig: Partial<HedgehogConfig> | null
+ payload?: {
+ config: Partial<HedgehogConfig>
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hedgehogModeLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hedgehogConfig: (remoteConfig: Partial<HedgehogConfig> | null) => HedgehogConfig
+ hedgehogModeEnabled: (hedgehogConfig: HedgehogConfig) => boolean
+ minimalHedgehogConfig: (hedgehogConfig: HedgehogConfig) => MinimalHedgehogConfig
+ }
+}
+
+export type hedgehogModeLogicType = MakeLogicType<
+ hedgehogModeLogicValues,
+ hedgehogModeLogicActions,
+ Record<string, any>,
+ hedgehogModeLogicMeta
+>
+
export const hedgehogModeLogic = kea<hedgehogModeLogicType>([
path(['hedgehog', 'hedgehogModeLogic']),
connect({
@@ -106,7 +213,7 @@ export const hedgehogModeLogic = kea<hedgehogModeLogicType>([
selectors({
hedgehogConfig: [
(s) => [s.remoteConfig],
- (remoteConfig): HedgehogConfig => {
+ (remoteConfig: Partial<HedgehogConfig> | null): HedgehogConfig => {
return sanitizeHedgehogConfig({
...remoteConfig,
})
@@ -115,14 +222,14 @@ export const hedgehogModeLogic = kea<hedgehogModeLogicType>([
hedgehogModeEnabled: [
(s) => [s.hedgehogConfig],
- (hedgehogConfig): boolean => {
+ (hedgehogConfig: HedgehogConfig): boolean => {
return !!hedgehogConfig.enabled
},
],
minimalHedgehogConfig: [
(s) => [s.hedgehogConfig],
- (hedgehogConfig): MinimalHedgehogConfig => {
+ (hedgehogConfig: HedgehogConfig): MinimalHedgehogConfig => {
const forcedHedeghogProfile: MinimalHedgehogConfig = {
use_as_profile: true,
color: hedgehogConfig?.actor_options?.color,
diff --git a/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx b/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
index ea9b0b08523b..dfc4ebb14f11 100644
--- a/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
+++ b/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
@@ -1,14 +1,57 @@
-import { afterMount, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import type { HealthIssueSummary } from 'scenes/health/types'
import { teamLogic } from 'scenes/teamLogic'
-import type { healthSummaryLogicType } from './healthSummaryLogicType'
-
const REFRESH_INTERVAL = 60 * 1000 * 5
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface healthSummaryLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ criticalCount: number
+ healthSummary: HealthIssueSummary | null
+ healthSummaryLoading: boolean
+ totalIssues: number
+ warningCount: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface healthSummaryLogicActions {
+ loadHealthSummary: () => any
+ loadHealthSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHealthSummarySuccess: (
+ healthSummary: HealthIssueSummary | null,
+ payload?: any
+ ) => {
+ healthSummary: HealthIssueSummary | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface healthSummaryLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ totalIssues: (healthSummary: HealthIssueSummary | null) => number
+ criticalCount: (healthSummary: HealthIssueSummary | null) => number
+ warningCount: (healthSummary: HealthIssueSummary | null) => number
+ }
+}
+
+export type healthSummaryLogicType = MakeLogicType<
+ healthSummaryLogicValues,
+ healthSummaryLogicActions,
+ Record<string, any>,
+ healthSummaryLogicMeta
+>
+
export const healthSummaryLogic = kea<healthSummaryLogicType>([
path(['lib', 'components', 'HelpMenu', 'healthSummaryLogic']),
connect(() => ({ values: [teamLogic, ['currentTeamIdStrict']] })),
diff --git a/frontend/src/lib/components/HelpMenu/helpMenuLogic.tsx b/frontend/src/lib/components/HelpMenu/helpMenuLogic.tsx
index fef45ffea20f..6d963899e8fb 100644
--- a/frontend/src/lib/components/HelpMenu/helpMenuLogic.tsx
+++ b/frontend/src/lib/components/HelpMenu/helpMenuLogic.tsx
@@ -1,10 +1,46 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { healthSummaryLogic } from './healthSummaryLogic'
-import type { helpMenuLogicType } from './helpMenuLogicType'
export type HelpBadgeStatus = 'danger' | 'warning' | 'success'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface helpMenuLogicValues {
+ criticalCount: number // healthSummaryLogic
+ totalIssues: number // healthSummaryLogic
+ warningCount: number // healthSummaryLogic
+ hasHealthIssue: boolean
+ isHelpMenuOpen: boolean
+ triggerBadgeContent: string
+ triggerBadgeStatus: HelpBadgeStatus
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface helpMenuLogicActions {
+ setHelpMenuOpen: (isOpen: boolean) => {
+ isOpen: boolean
+ }
+ toggleHelpMenu: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface helpMenuLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasHealthIssue: (totalIssues: number) => boolean
+ triggerBadgeContent: (hasHealthIssue: boolean) => string
+ triggerBadgeStatus: (hasHealthIssue: boolean, criticalCount: number, warningCount: number) => HelpBadgeStatus
+ }
+}
+
+export type helpMenuLogicType = MakeLogicType<
+ helpMenuLogicValues,
+ helpMenuLogicActions,
+ Record<string, any>,
+ helpMenuLogicMeta
+>
+
export const helpMenuLogic = kea<helpMenuLogicType>([
path(['lib', 'components', 'HelpMenu', 'helpMenuLogic']),
connect(() => ({
@@ -24,11 +60,14 @@ export const helpMenuLogic = kea<helpMenuLogicType>([
],
}),
selectors({
- hasHealthIssue: [(s) => [s.totalIssues], (totalIssues): boolean => totalIssues > 0],
- triggerBadgeContent: [(s) => [s.hasHealthIssue], (hasHealthIssue): string => (hasHealthIssue ? '!' : '')],
+ hasHealthIssue: [(s) => [s.totalIssues], (totalIssues: number): boolean => totalIssues > 0],
+ triggerBadgeContent: [
+ (s) => [s.hasHealthIssue],
+ (hasHealthIssue: boolean): string => (hasHealthIssue ? '!' : ''),
+ ],
triggerBadgeStatus: [
(s) => [s.hasHealthIssue, s.criticalCount, s.warningCount],
- (hasHealthIssue, criticalCount, warningCount): HelpBadgeStatus => {
+ (hasHealthIssue: boolean, criticalCount: number, warningCount: number): HelpBadgeStatus => {
if (!hasHealthIssue) {
return 'success'
}
diff --git a/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx b/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx
index 3956efbb17ae..d8ccc5707c99 100644
--- a/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx
+++ b/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -8,8 +8,9 @@ import { preflightLogic } from 'lib/logic/preflightLogic'
import { Region } from '~/types'
+import type { PreflightStatus } from '../../../types'
+import type { FakeStatusOverride } from '../Superpowers/superpowersLogic'
import { NormalizedStatus, STATUS_PAGE_BASE, setIncidentStatus } from './incidentStatus'
-import type { incidentStatusLogicType } from './incidentStatusLogicType'
// Raw status page API types
export type ComponentStatus = 'operational' | 'degraded_performance' | 'partial_outage' | 'full_outage'
@@ -206,6 +207,69 @@ function getAiIncidentAlerts(summary: Summary | null, relevantGroupName: string
}, [])
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface incidentStatusLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ fakeStatusOverride: FakeStatusOverride // superpowersLogic
+ superpowersEnabled: boolean | undefined // superpowersLogic
+ aiIncidentAlerts: ComponentIncidentAlert[]
+ rawStatus: NormalizedStatus
+ relevantGroupName: string | null
+ status: NormalizedStatus
+ statusDescription: string | null
+ statusPageUrl: string
+ summary: Summary | null
+ summaryLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface incidentStatusLogicActions {
+ loadSummary: () => any
+ loadSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSummarySuccess: (
+ summary: Summary | null,
+ payload?: any
+ ) => {
+ summary: Summary | null
+ payload?: any
+ }
+ setPageVisibility: (visible: boolean) => {
+ visible: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface incidentStatusLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ relevantGroupName: (preflight: PreflightStatus | null) => string | null
+ rawStatus: (summary: Summary | null, relevantGroupName: string | null) => NormalizedStatus
+ status: (
+ rawStatus: NormalizedStatus,
+ fakeStatusOverride: FakeStatusOverride,
+ superpowersEnabled: boolean | undefined
+ ) => NormalizedStatus
+ aiIncidentAlerts: (summary: Summary | null, relevantGroupName: string | null) => ComponentIncidentAlert[]
+ statusDescription: (
+ summary: Summary | null,
+ status: NormalizedStatus,
+ relevantGroupName: string | null
+ ) => string | null
+ }
+}
+
+export type incidentStatusLogicType = MakeLogicType<
+ incidentStatusLogicValues,
+ incidentStatusLogicActions,
+ Record<string, any>,
+ incidentStatusLogicMeta
+>
+
export const incidentStatusLogic = kea<incidentStatusLogicType>([
path(['lib', 'components', 'HelpMenu', 'incidentStatusLogic']),
@@ -254,11 +318,12 @@ export const incidentStatusLogic = kea<incidentStatusLogicType>([
statusPageUrl: [() => [], (): string => getStatusPageUrl()],
relevantGroupName: [
(s) => [s.preflight],
- (preflight): string | null => getRelevantGroupName(preflight?.region),
+ (preflight: null | import('~/types').PreflightStatus): string | null =>
+ getRelevantGroupName(preflight?.region),
],
rawStatus: [
(s) => [s.summary, s.relevantGroupName],
- (summary: Summary | null, relevantGroupName): NormalizedStatus => {
+ (summary: Summary | null, relevantGroupName: string | null): NormalizedStatus => {
if (!summary) {
return 'operational'
}
@@ -267,7 +332,11 @@ export const incidentStatusLogic = kea<incidentStatusLogicType>([
],
status: [
(s) => [s.rawStatus, s.fakeStatusOverride, s.superpowersEnabled],
- (rawStatus, fakeStatusOverride, superpowersEnabled): NormalizedStatus => {
+ (
+ rawStatus: NormalizedStatus,
+ fakeStatusOverride: import('lib/components/Superpowers/superpowersLogic').FakeStatusOverride,
+ superpowersEnabled: boolean | undefined
+ ): NormalizedStatus => {
if (superpowersEnabled && fakeStatusOverride !== 'none') {
return fakeStatusOverride as NormalizedStatus
}
@@ -276,12 +345,12 @@ export const incidentStatusLogic = kea<incidentStatusLogicType>([
],
aiIncidentAlerts: [
(s) => [s.summary, s.relevantGroupName],
- (summary: Summary | null, relevantGroupName): ComponentIncidentAlert[] =>
+ (summary: Summary | null, relevantGroupName: string | null): ComponentIncidentAlert[] =>
getAiIncidentAlerts(summary, relevantGroupName),
],
statusDescription: [
(s) => [s.summary, s.status, s.relevantGroupName],
- (summary, status, relevantGroupName): string | null => {
+ (summary: Summary | null, status: NormalizedStatus, relevantGroupName: string | null): string | null => {
if (!summary) {
return null
}
diff --git a/frontend/src/lib/components/HelpMenu/posthogStatusLogic.tsx b/frontend/src/lib/components/HelpMenu/posthogStatusLogic.tsx
index 581f41c9ea4e..34889c496476 100644
--- a/frontend/src/lib/components/HelpMenu/posthogStatusLogic.tsx
+++ b/frontend/src/lib/components/HelpMenu/posthogStatusLogic.tsx
@@ -1,14 +1,51 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { superpowersLogic } from 'lib/components/Superpowers/superpowersLogic'
import { capitalizeFirstLetter } from 'lib/utils/strings'
+import type { FakeStatusOverride } from '../Superpowers/superpowersLogic'
+import type { NormalizedStatus } from './incidentStatus'
import { incidentStatusLogic } from './incidentStatusLogic'
-import type { posthogStatusLogicType } from './posthogStatusLogicType'
export type PostHogStatusType = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage'
export type PostHogStatusBadgeStatus = 'success' | 'warning' | 'danger'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface posthogStatusLogicValues {
+ status: NormalizedStatus // incidentStatusLogic
+ statusDescription: string | null // incidentStatusLogic
+ statusPageUrl: string // incidentStatusLogic
+ fakeStatusOverride: FakeStatusOverride // superpowersLogic
+ superpowersEnabled: boolean | undefined // superpowersLogic
+ isFakeStatus: boolean
+ postHogStatus: PostHogStatusType
+ postHogStatusBadgeContent: string
+ postHogStatusBadgeStatus: PostHogStatusBadgeStatus
+ postHogStatusTooltip: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface posthogStatusLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ postHogStatus: (status: NormalizedStatus) => PostHogStatusType
+ isFakeStatus: (superpowersEnabled: boolean | undefined, fakeStatusOverride: FakeStatusOverride) => boolean
+ postHogStatusTooltip: (
+ statusDescription: string | null,
+ isFakeStatus: boolean,
+ postHogStatus: PostHogStatusType
+ ) => string | null
+ postHogStatusBadgeContent: (postHogStatus: PostHogStatusType) => string
+ postHogStatusBadgeStatus: (postHogStatus: PostHogStatusType) => PostHogStatusBadgeStatus
+ }
+}
+
+export type posthogStatusLogicType = MakeLogicType<
+ posthogStatusLogicValues,
+ {},
+ Record<string, any>,
+ posthogStatusLogicMeta
+>
+
export const posthogStatusLogic = kea<posthogStatusLogicType>([
path(['lib', 'components', 'HelpMenu', 'posthogStatusLogic']),
connect({
@@ -20,14 +57,24 @@ export const posthogStatusLogic = kea<posthogStatusLogicType>([
],
}),
selectors({
- postHogStatus: [(s) => [s.status], (status): PostHogStatusType => status],
+ postHogStatus: [
+ (s) => [s.status],
+ (status: import('./incidentStatus').NormalizedStatus): PostHogStatusType => status,
+ ],
isFakeStatus: [
(s) => [s.superpowersEnabled, s.fakeStatusOverride],
- (superpowersEnabled, fakeStatusOverride): boolean => !!superpowersEnabled && fakeStatusOverride !== 'none',
+ (
+ superpowersEnabled: boolean | undefined,
+ fakeStatusOverride: import('lib/components/Superpowers/superpowersLogic').FakeStatusOverride
+ ): boolean => !!superpowersEnabled && fakeStatusOverride !== 'none',
],
postHogStatusTooltip: [
(s) => [s.statusDescription, s.isFakeStatus, s.postHogStatus],
- (statusDescription, isFakeStatus, postHogStatus): string | null => {
+ (
+ statusDescription: string | null,
+ isFakeStatus: boolean,
+ postHogStatus: PostHogStatusType
+ ): string | null => {
if (isFakeStatus) {
return `[DRILL] ${capitalizeFirstLetter(postHogStatus.replace(/_/g, ' '))}`
}
@@ -36,11 +83,11 @@ export const posthogStatusLogic = kea<posthogStatusLogicType>([
],
postHogStatusBadgeContent: [
(s) => [s.postHogStatus],
- (postHogStatus): string => (postHogStatus !== 'operational' ? '!' : '✓'),
+ (postHogStatus: PostHogStatusType): string => (postHogStatus !== 'operational' ? '!' : '✓'),
],
postHogStatusBadgeStatus: [
(s) => [s.postHogStatus],
- (postHogStatus): PostHogStatusBadgeStatus => {
+ (postHogStatus: PostHogStatusType): PostHogStatusBadgeStatus => {
if (postHogStatus.includes('outage')) {
return 'danger'
}
diff --git a/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts b/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts
index 47f2dc258b35..7c41c484d3c8 100644
--- a/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts
+++ b/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts
@@ -1,4 +1,16 @@
-import { actions, afterMount, beforeUnmount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import posthog from 'posthog-js'
import { RefObject } from 'react'
@@ -18,7 +30,9 @@ import { teamLogic } from 'scenes/teamLogic'
import { ToolbarUserIntent } from '~/types'
-import type { iframedToolbarBrowserLogicType } from './iframedToolbarBrowserLogicType'
+import type { TeamPublicType, TeamType } from '../../../types'
+import type { KeyedAppUrl } from '../AuthorizedUrlList/authorizedUrlListLogic'
+import type { HeatmapFilters } from '../heatmaps/types'
export type IframedToolbarBrowserLogicProps = {
iframeRef: RefObject<HTMLIFrameElement | null>
@@ -45,6 +59,125 @@ export const UserIntentVerb: {
'preview-product-tour': 'preview the product tour',
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface iframedToolbarBrowserLogicValues {
+ checkUrlIsAuthorized: (url: string) => boolean // authorizedUrlListLogic
+ urlsKeyed: KeyedAppUrl[] // authorizedUrlListLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ browserUrl: string | null
+ commonFilters: CommonFilters
+ currentFullUrl: string | null
+ currentPath: string
+ heatmapColorPalette: string | null
+ heatmapFilters: HeatmapFilters
+ heatmapFixedPositionMode: HeatmapFixedPositionMode
+ iframeBanner: IFrameBanner | null
+ iframeWidth: number | null
+ initialPath: string
+ isBrowserUrlAuthorized: boolean
+ isProposedBrowserUrlAuthorized: boolean
+ loading: boolean
+ proposedBrowserUrl: string | null
+ viewportRange: {
+ max: number
+ min: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface iframedToolbarBrowserLogicActions {
+ addUrl: (
+ url: string,
+ launch?: boolean | undefined
+ ) => {
+ launch: boolean | undefined
+ url: string
+ } // authorizedUrlListLogic
+ updateCurrentTeamSuccess: (
+ currentTeam: TeamPublicType | TeamType,
+ payload?: Partial<TeamType>
+ ) => {
+ currentTeam: TeamPublicType | TeamType
+ payload?: Partial<TeamType>
+ } // teamLogic
+ disableElementSelector: () => {
+ value: true
+ }
+ enableElementSelector: () => {
+ value: true
+ }
+ onIframeLoad: () => {
+ value: true
+ }
+ sendToolbarMessage: (
+ type: PostHogAppToolbarEvent,
+ payload?: Record<string, any>
+ ) => {
+ payload: Record<string, any> | undefined
+ type: PostHogAppToolbarEvent
+ }
+ setBrowserUrl: (url: string | null) => {
+ url: string | null
+ }
+ setCurrentPath: (path: string) => {
+ path: string
+ }
+ setIframeBanner: (banner: IFrameBanner | null) => {
+ banner: IFrameBanner | null
+ }
+ setIframeWidth: (width: number | null) => {
+ width: number | null
+ }
+ setInitialPath: (path: string) => {
+ path: string
+ }
+ setNewActionName: (name: string | null) => {
+ name: string | null
+ }
+ setProposedBrowserUrl: (url: string | null) => {
+ url: string | null
+ }
+ startTrackingLoading: () => {
+ value: true
+ }
+ stopTrackingLoading: () => {
+ value: true
+ }
+ toolbarMessageReceived: (
+ type: PostHogAppToolbarEvent,
+ payload: Record<string, any>
+ ) => {
+ payload: Record<string, any>
+ type: PostHogAppToolbarEvent
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface iframedToolbarBrowserLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isBrowserUrlAuthorized: (browserUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => boolean
+ isProposedBrowserUrlAuthorized: (
+ proposedBrowserUrl: string | null,
+ checkUrlIsAuthorized: (url: string) => boolean
+ ) => boolean
+ viewportRange: (
+ heatmapFilters: HeatmapFilters,
+ iframeWidth: number | null
+ ) => {
+ max: number
+ min: number
+ }
+ currentFullUrl: (browserUrl: string | null, currentPath: string) => string | null
+ }
+}
+
+export type iframedToolbarBrowserLogicType = MakeLogicType<
+ iframedToolbarBrowserLogicValues,
+ iframedToolbarBrowserLogicActions,
+ IframedToolbarBrowserLogicProps,
+ iframedToolbarBrowserLogicMeta
+>
+
export const iframedToolbarBrowserLogic = kea<iframedToolbarBrowserLogicType>([
path(['lib', 'components', 'iframedToolbarBrowser', 'iframedToolbarBrowserLogic']),
props({
@@ -168,7 +301,7 @@ export const iframedToolbarBrowserLogic = kea<iframedToolbarBrowserLogicType>([
selectors({
isBrowserUrlAuthorized: [
(s) => [s.browserUrl, s.checkUrlIsAuthorized],
- (browserUrl, checkUrlIsAuthorized) => {
+ (browserUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => {
if (!browserUrl) {
return false
}
@@ -177,7 +310,7 @@ export const iframedToolbarBrowserLogic = kea<iframedToolbarBrowserLogicType>([
],
isProposedBrowserUrlAuthorized: [
(s) => [s.proposedBrowserUrl, s.checkUrlIsAuthorized],
- (proposedBrowserUrl, checkUrlIsAuthorized) => {
+ (proposedBrowserUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => {
if (!proposedBrowserUrl) {
return false
}
@@ -187,13 +320,13 @@ export const iframedToolbarBrowserLogic = kea<iframedToolbarBrowserLogicType>([
viewportRange: [
(s) => [s.heatmapFilters, s.iframeWidth],
- (heatmapFilters, iframeWidth) => {
+ (heatmapFilters: import('lib/components/heatmaps/types').HeatmapFilters, iframeWidth: number | null) => {
return iframeWidth ? calculateViewportRange(heatmapFilters, iframeWidth) : { min: 0, max: 1800 }
},
],
currentFullUrl: [
(s) => [s.browserUrl, s.currentPath],
- (browserUrl, currentPath) => {
+ (browserUrl: string | null, currentPath: string) => {
if (!browserUrl) {
return null
}
diff --git a/frontend/src/lib/components/IngestionControls/ingestionControlsLogic.tsx b/frontend/src/lib/components/IngestionControls/ingestionControlsLogic.tsx
index 8ff1d82848b1..c7c04394b20d 100644
--- a/frontend/src/lib/components/IngestionControls/ingestionControlsLogic.tsx
+++ b/frontend/src/lib/components/IngestionControls/ingestionControlsLogic.tsx
@@ -1,9 +1,7 @@
-import { actions, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, selectors } from 'kea'
import { AccessControlResourceType } from '~/types'
-import type { ingestionControlsLogicType } from './ingestionControlsLogicType'
-
export type IngestionControlsLogicProps = {
logicKey: string
resourceType: AccessControlResourceType
@@ -11,6 +9,37 @@ export type IngestionControlsLogicProps = {
onChangeMatchType: (matchType: 'any' | 'all') => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface ingestionControlsLogicValues {
+ logicKey: string
+ matchType: 'all' | 'any'
+ resourceType: AccessControlResourceType
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface ingestionControlsLogicActions {
+ onChangeMatchType: (matchType: 'all' | 'any') => {
+ matchType: 'all' | 'any'
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface ingestionControlsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicKey: (logicKey: string) => string
+ resourceType: (resourceType: AccessControlResourceType) => AccessControlResourceType
+ matchType: (matchType: 'all' | 'any') => 'all' | 'any'
+ }
+}
+
+export type ingestionControlsLogicType = MakeLogicType<
+ ingestionControlsLogicValues,
+ ingestionControlsLogicActions,
+ IngestionControlsLogicProps,
+ ingestionControlsLogicMeta
+>
+
export const ingestionControlsLogic = kea<ingestionControlsLogicType>([
props({} as IngestionControlsLogicProps),
key((props) => props.logicKey),
@@ -19,9 +48,9 @@ export const ingestionControlsLogic = kea<ingestionControlsLogicType>([
onChangeMatchType: (matchType: 'any' | 'all') => ({ matchType }),
}),
selectors({
- logicKey: [(_, p) => [p.logicKey], (logicKey) => logicKey],
- resourceType: [(_, p) => [p.resourceType], (resourceType) => resourceType],
- matchType: [(_, p) => [p.matchType], (matchType) => matchType],
+ logicKey: [(_, p) => [p.logicKey], (logicKey: string) => logicKey],
+ resourceType: [(_, p) => [p.resourceType], (resourceType: AccessControlResourceType) => resourceType],
+ matchType: [(_, p) => [p.matchType], (matchType: 'all' | 'any') => matchType],
}),
listeners(({ props }) => ({
onChangeMatchType: ({ matchType }) => {
diff --git a/frontend/src/lib/components/IngestionControls/triggers/FlagTrigger/flagTriggerLogic.ts b/frontend/src/lib/components/IngestionControls/triggers/FlagTrigger/flagTriggerLogic.ts
index 3ea0448d0040..470370e35fde 100644
--- a/frontend/src/lib/components/IngestionControls/triggers/FlagTrigger/flagTriggerLogic.ts
+++ b/frontend/src/lib/components/IngestionControls/triggers/FlagTrigger/flagTriggerLogic.ts
@@ -1,12 +1,12 @@
-import { actions, afterMount, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { isObject } from 'lib/utils/guards'
import { variantKeyToIndexFeatureFlagPayloads } from 'scenes/feature-flags/featureFlagLogic'
+import type { FeatureFlagType } from '../../../../../types'
import { LinkedFeatureFlag } from '../../types'
-import type { flagTriggerLogicType } from './flagTriggerLogicType'
export type FlagTriggerLogicProps = {
logicKey: string
@@ -14,6 +14,56 @@ export type FlagTriggerLogicProps = {
onChange: (flag: LinkedFeatureFlag | null) => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface flagTriggerLogicValues {
+ featureFlag: any
+ featureFlagLoading: boolean
+ flag: LinkedFeatureFlag | null
+ flagHasVariants: boolean
+ linkedFeatureFlagId: number | null
+ linkedFlag: any
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface flagTriggerLogicActions {
+ loadFeatureFlag: () => any
+ loadFeatureFlagFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadFeatureFlagSuccess: (
+ featureFlag: FeatureFlagType | null,
+ payload?: any
+ ) => {
+ featureFlag: FeatureFlagType | null
+ payload?: any
+ }
+ onChange: (flag: LinkedFeatureFlag | null) => {
+ flag: LinkedFeatureFlag | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface flagTriggerLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ linkedFeatureFlagId: (flag: LinkedFeatureFlag | null) => number | null
+ flag: (flag: LinkedFeatureFlag | null) => LinkedFeatureFlag | null
+ linkedFlag: (featureFlag: any, flag: LinkedFeatureFlag | null) => any
+ flagHasVariants: (linkedFlag: any) => boolean
+ }
+}
+
+export type flagTriggerLogicType = MakeLogicType<
+ flagTriggerLogicValues,
+ flagTriggerLogicActions,
+ FlagTriggerLogicProps,
+ flagTriggerLogicMeta
+>
+
export const flagTriggerLogic = kea<flagTriggerLogicType>([
props({} as FlagTriggerLogicProps),
key((props) => props.logicKey),
@@ -33,15 +83,15 @@ export const flagTriggerLogic = kea<flagTriggerLogicType>([
},
})),
selectors({
- linkedFeatureFlagId: [(_, p) => [p.flag], (flag) => flag?.id || null],
- flag: [(_, p) => [p.flag], (flag) => flag],
+ linkedFeatureFlagId: [(_, p) => [p.flag], (flag: LinkedFeatureFlag | null) => flag?.id || null],
+ flag: [(_, p) => [p.flag], (flag: LinkedFeatureFlag | null) => flag],
linkedFlag: [
(s, p) => [s.featureFlag, p.flag],
// an existing linked flag is loaded from the API,
// a newly chosen flag is selected and can be passed in
// the original value is used to ensure that we don't
// show stale values as people change the selection
- (featureFlag, flag) => (flag?.id ? featureFlag : null),
+ (featureFlag, flag: LinkedFeatureFlag | null) => (flag?.id ? featureFlag : null),
],
flagHasVariants: [(s) => [s.linkedFlag], (linkedFlag) => isObject(linkedFlag?.filters.multivariate)],
}),
diff --git a/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/replayTriggersV2Logic.ts b/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/replayTriggersV2Logic.ts
index a63da6c0e63d..c7cd39c526e7 100644
--- a/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/replayTriggersV2Logic.ts
+++ b/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/replayTriggersV2Logic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { uuid } from 'lib/utils/dom'
@@ -10,7 +10,7 @@ import {
SessionRecordingTriggerGroupsConfig,
} from '~/lib/components/IngestionControls/types'
-import type { replayTriggersV2LogicType } from './replayTriggersV2LogicType'
+import type { TeamPublicType, TeamType } from '../../../../../types'
/**
* A conditionless group at 100% sample rate matches every session, so it's the explicit "record
@@ -26,6 +26,121 @@ export function buildRecordEverythingGroup(): SessionRecordingTriggerGroup {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface replayTriggersV2LogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ _savingState: boolean | null
+ _savingStateLoading: boolean
+ deleteModalGroupId: string | null
+ editingGroupId: string | null
+ hasLegacyTriggers: boolean
+ hasV2Config: boolean
+ isAddingGroup: boolean
+ previewLegacyGroups: SessionRecordingTriggerGroup[]
+ shouldShowMigrationBanner: boolean
+ showLegacyModal: boolean
+ triggerGroups: SessionRecordingTriggerGroup[]
+ triggerGroupsConfig: SessionRecordingTriggerGroupsConfig | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface replayTriggersV2LogicActions {
+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic
+ addMultipleTriggerGroups: (groups: SessionRecordingTriggerGroup[]) => {
+ groups: SessionRecordingTriggerGroup[]
+ }
+ addTriggerGroup: (group: SessionRecordingTriggerGroup) => {
+ group: SessionRecordingTriggerGroup
+ }
+ confirmCreateFromLegacy: () => {
+ value: true
+ }
+ confirmCreateFromLegacyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ confirmCreateFromLegacySuccess: (
+ _savingState: boolean,
+ payload?: {
+ value: true
+ }
+ ) => {
+ _savingState: boolean
+ payload?: {
+ value: true
+ }
+ }
+ deleteTriggerGroup: (id: string) => {
+ id: string
+ }
+ hideCreateFromLegacyModal: () => {
+ value: true
+ }
+ saveConfig: () => any
+ saveConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveConfigSuccess: (
+ _savingState: boolean,
+ payload?: any
+ ) => {
+ _savingState: boolean
+ payload?: any
+ }
+ setDeleteModalGroupId: (id: string | null) => {
+ id: string | null
+ }
+ setEditingGroupId: (id: string | null) => {
+ id: string | null
+ }
+ setIsAddingGroup: (isAdding: boolean) => {
+ isAdding: boolean
+ }
+ setTriggerGroupsConfig: (config: SessionRecordingTriggerGroupsConfig | null) => {
+ config: SessionRecordingTriggerGroupsConfig | null
+ }
+ showCreateFromLegacyModal: () => {
+ value: true
+ }
+ updateTriggerGroup: (
+ id: string,
+ updates: Partial<SessionRecordingTriggerGroup>
+ ) => {
+ id: string
+ updates: Partial<SessionRecordingTriggerGroup>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface replayTriggersV2LogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ triggerGroups: (
+ triggerGroupsConfig: SessionRecordingTriggerGroupsConfig | null
+ ) => SessionRecordingTriggerGroup[]
+ hasV2Config: (triggerGroupsConfig: SessionRecordingTriggerGroupsConfig | null) => boolean
+ hasLegacyTriggers: (currentTeam: TeamPublicType | TeamType | null) => boolean
+ shouldShowMigrationBanner: (
+ triggerGroups: SessionRecordingTriggerGroup[],
+ hasLegacyTriggers: boolean
+ ) => boolean
+ previewLegacyGroups: (currentTeam: TeamPublicType | TeamType | null) => SessionRecordingTriggerGroup[]
+ }
+}
+
+export type replayTriggersV2LogicType = MakeLogicType<
+ replayTriggersV2LogicValues,
+ replayTriggersV2LogicActions,
+ Record<string, any>,
+ replayTriggersV2LogicMeta
+>
+
export const replayTriggersV2Logic = kea<replayTriggersV2LogicType>([
path(['lib', 'components', 'IngestionControls', 'triggers', 'triggerGroups', 'replayTriggersV2Logic']),
connect({
@@ -155,19 +270,21 @@ export const replayTriggersV2Logic = kea<replayTriggersV2LogicType>([
selectors({
triggerGroups: [
(s) => [s.triggerGroupsConfig],
- (config): SessionRecordingTriggerGroup[] => {
+ (config: SessionRecordingTriggerGroupsConfig | null): SessionRecordingTriggerGroup[] => {
return config?.groups || []
},
],
hasV2Config: [
(s) => [s.triggerGroupsConfig],
- (config): boolean => {
+ (config: SessionRecordingTriggerGroupsConfig | null): boolean => {
return config !== null && config.version === 2
},
],
hasLegacyTriggers: [
(s) => [s.currentTeam],
- (team): boolean => {
+ (
+ team: null | import('../../../../../types').TeamPublicType | import('../../../../../types').TeamType
+ ): boolean => {
if (!team) {
return false
}
@@ -182,14 +299,16 @@ export const replayTriggersV2Logic = kea<replayTriggersV2LogicType>([
],
shouldShowMigrationBanner: [
(s) => [s.triggerGroups, s.hasLegacyTriggers],
- (triggerGroups, hasLegacyTriggers): boolean => {
+ (triggerGroups: SessionRecordingTriggerGroup[], hasLegacyTriggers: boolean): boolean => {
// Show banner if there are legacy triggers configured but no V2 groups
return hasLegacyTriggers && triggerGroups.length === 0
},
],
previewLegacyGroups: [
(s) => [s.currentTeam],
- (team): SessionRecordingTriggerGroup[] => {
+ (
+ team: null | import('../../../../../types').TeamPublicType | import('../../../../../types').TeamType
+ ): SessionRecordingTriggerGroup[] => {
if (!team) {
return []
}
diff --git a/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/triggerGroupFormLogic.ts b/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/triggerGroupFormLogic.ts
index 8f13ff0dd93b..866fb94d63f4 100644
--- a/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/triggerGroupFormLogic.ts
+++ b/frontend/src/lib/components/IngestionControls/triggers/triggerGroups/triggerGroupFormLogic.ts
@@ -1,5 +1,6 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { lemonToast } from '@posthog/lemon-ui'
@@ -13,8 +14,6 @@ import {
UrlTriggerConfig,
} from '~/lib/components/IngestionControls/types'
-import type { triggerGroupFormLogicType } from './triggerGroupFormLogicType'
-
function isValidRegex(pattern: string): boolean {
try {
new RegExp(pattern)
@@ -35,6 +34,221 @@ export interface TriggerGroupFormLogicProps {
onCancel: () => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface triggerGroupFormLogicValues {
+ expandedEvent: string | null
+ isAddingUrl: boolean
+ isTriggerGroupSubmitting: boolean
+ isTriggerGroupValid: boolean
+ newUrl: string
+ showTriggerGroupErrors: boolean
+ testUrl: string
+ triggerGroup: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }
+ triggerGroupAllErrors: Record<string, any>
+ triggerGroupChanged: boolean
+ triggerGroupErrors: DeepPartialMap<
+ {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ },
+ ValidationErrorType
+ >
+ triggerGroupHasErrors: boolean
+ triggerGroupManualErrors: Record<string, any>
+ triggerGroupTouched: boolean
+ triggerGroupTouches: Record<string, boolean>
+ triggerGroupValidationErrors: DeepPartialMap<
+ {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ },
+ ValidationErrorType
+ >
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface triggerGroupFormLogicActions {
+ addFlag: (
+ _id: number,
+ key: string
+ ) => {
+ key: string
+ }
+ addUrl: (url: string) => {
+ url: string
+ }
+ removeEvent: (eventName: string) => {
+ eventName: string
+ }
+ removeFlag: () => {
+ value: true
+ }
+ removeUrl: (url: string) => {
+ url: string
+ }
+ resetTriggerGroup: (values?: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }) => {
+ values?: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }
+ }
+ setEventProperties: (
+ eventName: string,
+ properties: TriggerPropertyFilter[]
+ ) => {
+ eventName: string
+ properties: TriggerPropertyFilter[]
+ }
+ setExpandedEvent: (eventName: string | null) => {
+ eventName: string | null
+ }
+ setIsAddingUrl: (isAdding: boolean) => {
+ isAdding: boolean
+ }
+ setNewUrl: (url: string) => {
+ url: string
+ }
+ setTestUrl: (url: string) => {
+ url: string
+ }
+ setTriggerGroupManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setTriggerGroupValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setTriggerGroupValues: (
+ values: DeepPartial<{
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }>
+ ) => {
+ values: DeepPartial<{
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }>
+ }
+ submitTriggerGroup: () => {
+ value: boolean
+ }
+ submitTriggerGroupFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitTriggerGroupRequest: (triggerGroup: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }) => {
+ triggerGroup: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }
+ }
+ submitTriggerGroupSuccess: (triggerGroup: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }) => {
+ triggerGroup: {
+ events: EventTriggerConfig[]
+ flag: string | null
+ matchType: 'all' | 'any'
+ minDurationMs: number | null
+ name: string
+ properties: TriggerPropertyFilter[]
+ sampleRate: number
+ urls: UrlTriggerConfig[]
+ }
+ }
+ touchTriggerGroupField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface triggerGroupFormLogicMeta {
+ key: string
+}
+
+export type triggerGroupFormLogicType = MakeLogicType<
+ triggerGroupFormLogicValues,
+ triggerGroupFormLogicActions,
+ TriggerGroupFormLogicProps,
+ triggerGroupFormLogicMeta
+>
+
export const triggerGroupFormLogic = kea<triggerGroupFormLogicType>([
path(['lib', 'components', 'IngestionControls', 'triggers', 'triggerGroups', 'triggerGroupFormLogic']),
props({} as TriggerGroupFormLogicProps),
diff --git a/frontend/src/lib/components/IngestionControls/triggers/urlConfigLogic.ts b/frontend/src/lib/components/IngestionControls/triggers/urlConfigLogic.ts
index 6bf9d93fa1e6..1ada5f7345a3 100644
--- a/frontend/src/lib/components/IngestionControls/triggers/urlConfigLogic.ts
+++ b/frontend/src/lib/components/IngestionControls/triggers/urlConfigLogic.ts
@@ -1,10 +1,9 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { UrlTriggerConfig } from 'lib/components/IngestionControls/types'
-import type { urlConfigLogicType } from './urlConfigLogicType'
-
const NEW_URL_TRIGGER = { url: '', matching: 'regex' }
export function isStringWithLength(x: unknown): x is string {
@@ -23,6 +22,139 @@ export interface UrlConfigLogicProps {
onChange: (urlTriggerConfig: UrlTriggerConfig[]) => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface urlConfigLogicValues {
+ checkUrlTrigger: string
+ checkUrlTriggerResults: {
+ [key: number]: boolean
+ }
+ editUrlTriggerIndex: number | null
+ isAddUrlTriggerConfigFormVisible: boolean
+ isProposedUrlTriggerSubmitting: boolean
+ isProposedUrlTriggerValid: boolean
+ proposedUrlTrigger: UrlTriggerConfig
+ proposedUrlTriggerAllErrors: Record<string, any>
+ proposedUrlTriggerChanged: boolean
+ proposedUrlTriggerErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>
+ proposedUrlTriggerHasErrors: boolean
+ proposedUrlTriggerManualErrors: Record<string, any>
+ proposedUrlTriggerTouched: boolean
+ proposedUrlTriggerTouches: Record<string, boolean>
+ proposedUrlTriggerValidationErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>
+ showProposedUrlTriggerErrors: boolean
+ urlTriggerConfig: UrlTriggerConfig[]
+ urlTriggerInputValidationWarning: string | null
+ urlTriggerToEdit: {
+ matching: string
+ url: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface urlConfigLogicActions {
+ addUrlTrigger: (urlTriggerConfig: UrlTriggerConfig) => {
+ urlTriggerConfig: UrlTriggerConfig
+ }
+ cancelProposingUrlTrigger: () => {
+ value: true
+ }
+ newUrlTrigger: () => {
+ value: true
+ }
+ removeUrlTrigger: (index: number) => {
+ index: number
+ }
+ resetProposedUrlTrigger: (values?: UrlTriggerConfig) => {
+ values?: UrlTriggerConfig
+ }
+ setCheckUrlBlocklist: (url: string) => {
+ url: string
+ }
+ setCheckUrlTrigger: (url: string) => {
+ url: string
+ }
+ setEditUrlTriggerIndex: (originalIndex: number | null) => {
+ originalIndex: number | null
+ }
+ setProposedUrlTriggerManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setProposedUrlTriggerValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setProposedUrlTriggerValues: (values: DeepPartial<UrlTriggerConfig>) => {
+ values: DeepPartial<UrlTriggerConfig>
+ }
+ setUrlTriggerConfig: (urlTriggerConfig: UrlTriggerConfig[]) => {
+ urlTriggerConfig: UrlTriggerConfig[]
+ }
+ submitProposedUrlTrigger: () => {
+ value: boolean
+ }
+ submitProposedUrlTriggerFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitProposedUrlTriggerRequest: (proposedUrlTrigger: UrlTriggerConfig) => {
+ proposedUrlTrigger: UrlTriggerConfig
+ }
+ submitProposedUrlTriggerSuccess: (proposedUrlTrigger: UrlTriggerConfig) => {
+ proposedUrlTrigger: UrlTriggerConfig
+ }
+ touchProposedUrlTriggerField: (key: string) => {
+ key: string
+ }
+ updateUrlTrigger: (
+ index: number,
+ urlTriggerConfig: UrlTriggerConfig
+ ) => {
+ index: number
+ urlTriggerConfig: UrlTriggerConfig
+ }
+ validateUrlInput: (
+ url: string,
+ type: 'blocklist' | 'trigger'
+ ) => {
+ type: 'blocklist' | 'trigger'
+ url: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface urlConfigLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isAddUrlTriggerConfigFormVisible: (editUrlTriggerIndex: number | null) => boolean
+ urlTriggerToEdit: (
+ urlTriggerConfig: UrlTriggerConfig[],
+ editUrlTriggerIndex: number | null
+ ) => {
+ matching: string
+ url: string
+ }
+ checkUrlTriggerResults: (
+ checkUrlTrigger: string,
+ urlTriggerConfig: UrlTriggerConfig[]
+ ) => {
+ [key: number]: boolean
+ }
+ }
+}
+
+export type urlConfigLogicType = MakeLogicType<
+ urlConfigLogicValues,
+ urlConfigLogicActions,
+ UrlConfigLogicProps,
+ urlConfigLogicMeta
+>
+
export const urlConfigLogic = kea<urlConfigLogicType>([
props({} as UrlConfigLogicProps),
key((props) => props.logicKey),
@@ -99,11 +231,11 @@ export const urlConfigLogic = kea<urlConfigLogicType>([
selectors({
isAddUrlTriggerConfigFormVisible: [
(s) => [s.editUrlTriggerIndex],
- (editUrlTriggerIndex) => editUrlTriggerIndex === -1,
+ (editUrlTriggerIndex: number | null) => editUrlTriggerIndex === -1,
],
urlTriggerToEdit: [
(s) => [s.urlTriggerConfig, s.editUrlTriggerIndex],
- (urlTriggerConfig, editUrlTriggerIndex) => {
+ (urlTriggerConfig: UrlTriggerConfig[], editUrlTriggerIndex: number | null) => {
if (
editUrlTriggerIndex === null ||
editUrlTriggerIndex === -1 ||
@@ -117,7 +249,7 @@ export const urlConfigLogic = kea<urlConfigLogicType>([
checkUrlTriggerResults: [
(s) => [s.checkUrlTrigger, s.urlTriggerConfig],
- (checkUrl, urlTriggerConfig): { [key: number]: boolean } => {
+ (checkUrl: string, urlTriggerConfig: UrlTriggerConfig[]): { [key: number]: boolean } => {
if (!checkUrl.trim() || !urlTriggerConfig) {
return {}
}
diff --git a/frontend/src/lib/components/LiveUserCount/liveUserCountLogic.ts b/frontend/src/lib/components/LiveUserCount/liveUserCountLogic.ts
index 20fbc1d3ff4a..d7cee8da0bca 100644
--- a/frontend/src/lib/components/LiveUserCount/liveUserCountLogic.ts
+++ b/frontend/src/lib/components/LiveUserCount/liveUserCountLogic.ts
@@ -1,9 +1,9 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { liveEventsHostOrigin } from 'lib/utils/apiHost'
import { teamLogic } from 'scenes/teamLogic'
-import type { liveUserCountLogicType } from './liveUserCountLogicType'
+import type { TeamPublicType, TeamType } from '../../../types'
export interface LiveUserCountStats {
users_on_product?: number
@@ -14,6 +14,61 @@ export interface LiveUserCountLogicProps {
pollIntervalMs?: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface liveUserCountLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ activeRecordings: number | null
+ isHovering: boolean
+ liveUserCount: number | null
+ now: Date | null
+ stats: LiveUserCountStats | null
+ statsUpdatedSecondsAgo: number | null
+ statsUpdatedTime: Date | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface liveUserCountLogicActions {
+ pauseStream: () => {
+ value: true
+ }
+ pollStats: () => {
+ value: true
+ }
+ resumeStream: () => {
+ value: true
+ }
+ setIsHovering: (isHovering: boolean) => {
+ isHovering: boolean
+ }
+ setNow: (now: Date) => {
+ now: Date
+ }
+ setStats: (
+ stats: LiveUserCountStats,
+ now: Date
+ ) => {
+ now: Date
+ stats: LiveUserCountStats
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface liveUserCountLogicMeta {
+ key: number
+ __keaTypeGenInternalSelectorTypes: {
+ liveUserCount: (stats: LiveUserCountStats | null) => number | null
+ activeRecordings: (stats: LiveUserCountStats | null) => number | null
+ statsUpdatedSecondsAgo: (statsUpdatedTime: Date | null, now: Date | null) => number | null
+ }
+}
+
+export type liveUserCountLogicType = MakeLogicType<
+ liveUserCountLogicValues,
+ liveUserCountLogicActions,
+ LiveUserCountLogicProps,
+ liveUserCountLogicMeta
+>
+
export const liveUserCountLogic = kea<liveUserCountLogicType>([
path((key) => ['lib', 'components', 'LiveUserCount', 'liveUserCountLogic', key]),
key((props) => props.pollIntervalMs ?? 30000),
@@ -57,8 +112,8 @@ export const liveUserCountLogic = kea<liveUserCountLogicType>([
],
}),
selectors({
- liveUserCount: [(s) => [s.stats], (stats) => stats?.users_on_product ?? null],
- activeRecordings: [(s) => [s.stats], (stats) => stats?.active_recordings ?? null],
+ liveUserCount: [(s) => [s.stats], (stats: LiveUserCountStats | null) => stats?.users_on_product ?? null],
+ activeRecordings: [(s) => [s.stats], (stats: LiveUserCountStats | null) => stats?.active_recordings ?? null],
statsUpdatedSecondsAgo: [
(s) => [s.statsUpdatedTime, s.now],
(statsUpdatedTime: Date | null, now: Date | null) => {
diff --git a/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx b/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx
index b44759930f6b..6518893ce633 100644
--- a/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx
+++ b/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { toast } from 'react-toastify'
@@ -12,7 +12,7 @@ import { userLogic } from 'scenes/userLogic'
import { UserType } from '~/types'
-import type { mcpHintLogicType } from './mcpHintLogicType'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import { MCPHintToast } from './MCPHintToast'
import type { SurfaceKey } from './prompts'
@@ -41,6 +41,123 @@ export function tryShowMCPHint(surfaceKey: SurfaceKey, options: TryShowMCPHintOp
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mcpHintLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ user: UserType | null // userLogic
+ dismissedSurfaces: Record<string, true>
+ effectiveOptOut: boolean
+ lastShownAt: number | null
+ localGlobalOptOut: boolean
+ topEvents: string[]
+ topEventsLoading: boolean
+ userRole: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mcpHintLogicActions {
+ reportMCPHintDismissed: (
+ dismissType: 'all' | 'surface',
+ surfaceKey?: string | undefined
+ ) => {
+ dismissType: 'all' | 'surface'
+ surfaceKey: string | undefined
+ } // eventUsageLogic
+ reportMCPHintShown: (surfaceKey: string) => {
+ surfaceKey: string
+ } // eventUsageLogic
+ updateUser: (
+ user: Partial<UserType>,
+ successCallback?: () => void
+ ) => {
+ successCallback: (() => void) | undefined
+ user: Partial<UserType>
+ } // userLogic
+ dismissAll: () => {
+ value: true
+ }
+ dismissSurface: (surfaceKey: SurfaceKey) => {
+ surfaceKey:
+ | 'actions.create'
+ | 'alerts.create'
+ | 'annotations.create'
+ | 'cohorts.create'
+ | 'dashboards.create'
+ | 'data_warehouse_sources.create'
+ | 'data_warehouse_sources.update'
+ | 'early_access_features.create'
+ | 'error_tracking.assign'
+ | 'experiments.create'
+ | 'experiments.launch'
+ | 'feature_flags.create'
+ | 'feature_flags.update'
+ | 'insights.create'
+ | 'sql.execute'
+ | 'surveys.create'
+ | 'workflows.create'
+ }
+ loadTopEvents: () => any
+ loadTopEventsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTopEventsSuccess: (
+ topEvents: string[],
+ payload?: any
+ ) => {
+ topEvents: string[]
+ payload?: any
+ }
+ recordShown: (now: number) => {
+ now: number
+ }
+ reenable: () => {
+ value: true
+ }
+ tryShowHint: (
+ surfaceKey: SurfaceKey,
+ derivedPrompt?: string
+ ) => {
+ derivedPrompt: string | undefined
+ surfaceKey:
+ | 'actions.create'
+ | 'alerts.create'
+ | 'annotations.create'
+ | 'cohorts.create'
+ | 'dashboards.create'
+ | 'data_warehouse_sources.create'
+ | 'data_warehouse_sources.update'
+ | 'early_access_features.create'
+ | 'error_tracking.assign'
+ | 'experiments.create'
+ | 'experiments.launch'
+ | 'feature_flags.create'
+ | 'feature_flags.update'
+ | 'insights.create'
+ | 'sql.execute'
+ | 'surveys.create'
+ | 'workflows.create'
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mcpHintLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ effectiveOptOut: (localGlobalOptOut: boolean, user: UserType | null) => boolean
+ userRole: (user: UserType | null) => string | null
+ }
+}
+
+export type mcpHintLogicType = MakeLogicType<
+ mcpHintLogicValues,
+ mcpHintLogicActions,
+ Record<string, any>,
+ mcpHintLogicMeta
+>
+
export const mcpHintLogic = kea<mcpHintLogicType>([
path(['lib', 'components', 'MCPHint', 'mcpHintLogic']),
connect(() => ({
diff --git a/frontend/src/lib/components/Metalytics/metalyticsLogic.ts b/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
index bcd8099082d2..694329fce313 100644
--- a/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
+++ b/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
@@ -1,4 +1,4 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -11,7 +11,80 @@ import { sidePanelContextLogic } from '~/layout/navigation-3000/sidepanel/sidePa
import { SidePanelSceneContext } from '~/layout/navigation-3000/sidepanel/types'
import { hogql } from '~/queries/utils'
-import type { metalyticsLogicType } from './metalyticsLogicType'
+import type { OrganizationMemberType } from '../../../types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metalyticsLogicValues {
+ members: OrganizationMemberType[] | null // membersLogic
+ sceneSidePanelContext: SidePanelSceneContext // sidePanelContextLogic
+ currentProjectId: number | string // teamLogic
+ instanceId: string | null
+ recentUserMembers: OrganizationMemberType[]
+ recentUsers: string[]
+ recentUsersLoading: boolean
+ scope: string | undefined
+ viewCount: {
+ users: number
+ views: number
+ } | null
+ viewCountLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metalyticsLogicActions {
+ loadUsersLast30days: () => any
+ loadUsersLast30daysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadUsersLast30daysSuccess: (
+ recentUsers: string[],
+ payload?: any
+ ) => {
+ recentUsers: string[]
+ payload?: any
+ }
+ loadViewCount: () => any
+ loadViewCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadViewCountSuccess: (
+ viewCount: {
+ users: number
+ views: number
+ },
+ payload?: any
+ ) => {
+ viewCount: {
+ users: number
+ views: number
+ }
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metalyticsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ instanceId: (sceneSidePanelContext: SidePanelSceneContext) => string | null
+ scope: (sceneSidePanelContext: SidePanelSceneContext) => string | undefined
+ recentUserMembers: (recentUsers: string[], members: OrganizationMemberType[] | null) => OrganizationMemberType[]
+ }
+}
+
+export type metalyticsLogicType = MakeLogicType<
+ metalyticsLogicValues,
+ metalyticsLogicActions,
+ Record<string, any>,
+ metalyticsLogicMeta
+>
export const metalyticsLogic = kea<metalyticsLogicType>([
path(['lib', 'components', 'metalytics', 'metalyticsLogic']),
@@ -90,7 +163,7 @@ export const metalyticsLogic = kea<metalyticsLogicType>([
recentUserMembers: [
(s) => [s.recentUsers, s.members],
- (recentUsers, members) => {
+ (recentUsers: string[], members: import('../../../types').OrganizationMemberType[] | null) => {
if (!members || !recentUsers) {
return []
}
diff --git a/frontend/src/lib/components/NavPanelAdvertisement/NavPanelAdvertisementLogic.ts b/frontend/src/lib/components/NavPanelAdvertisement/NavPanelAdvertisementLogic.ts
index f397bffe7d26..9fa1024791c8 100644
--- a/frontend/src/lib/components/NavPanelAdvertisement/NavPanelAdvertisementLogic.ts
+++ b/frontend/src/lib/components/NavPanelAdvertisement/NavPanelAdvertisementLogic.ts
@@ -1,11 +1,32 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
-
-import type { navPanelAdvertisementLogicType } from './NavPanelAdvertisementLogicType'
+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'
export type NavPanelAdvertisementLogicProps = {
campaign: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelAdvertisementLogicValues {
+ hidden: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelAdvertisementLogicActions {
+ hideAdvertisement: () => boolean
+ showAdvertisement: () => boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelAdvertisementLogicMeta {
+ key: string
+}
+
+export type navPanelAdvertisementLogicType = MakeLogicType<
+ navPanelAdvertisementLogicValues,
+ navPanelAdvertisementLogicActions,
+ NavPanelAdvertisementLogicProps,
+ navPanelAdvertisementLogicMeta
+>
+
export const navPanelAdvertisementLogic = kea<navPanelAdvertisementLogicType>([
path(['lib', 'components', 'NavPanelAdvertisementLogic']),
props({} as NavPanelAdvertisementLogicProps),
diff --git a/frontend/src/lib/components/NavPanelAdvertisement/navPanelAdvertisementRecommendedLogic.ts b/frontend/src/lib/components/NavPanelAdvertisement/navPanelAdvertisementRecommendedLogic.ts
index 497fbb589e97..bd726fdc99af 100644
--- a/frontend/src/lib/components/NavPanelAdvertisement/navPanelAdvertisementRecommendedLogic.ts
+++ b/frontend/src/lib/components/NavPanelAdvertisement/navPanelAdvertisementRecommendedLogic.ts
@@ -1,16 +1,36 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { customProductsLogic } from '~/layout/panel-layout/ProjectTree/customProductsLogic'
import { type UserProductListItem, UserProductListReason } from '~/queries/schema/schema-general'
-import type { navPanelAdvertisementRecommendedLogicType } from './navPanelAdvertisementRecommendedLogicType'
-
const RECOMMENDED_PRODUCT_CREATED_AT_THRESHOLD_IN_DAYS = 7
const RECOMMENDED_PRODUCT_REASONS: UserProductListReason[] = [
UserProductListReason.SALES_LED,
UserProductListReason.NEW_PRODUCT,
]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelAdvertisementRecommendedLogicValues {
+ customProducts: UserProductListItem[] // customProductsLogic
+ oldestRecommendedProduct: UserProductListItem | null
+ recommendedProducts: UserProductListItem[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelAdvertisementRecommendedLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ recommendedProducts: (customProducts: UserProductListItem[]) => UserProductListItem[]
+ oldestRecommendedProduct: (recommendedProducts: UserProductListItem[]) => UserProductListItem | null
+ }
+}
+
+export type navPanelAdvertisementRecommendedLogicType = MakeLogicType<
+ navPanelAdvertisementRecommendedLogicValues,
+ {},
+ Record<string, any>,
+ navPanelAdvertisementRecommendedLogicMeta
+>
+
export const navPanelAdvertisementRecommendedLogic = kea<navPanelAdvertisementRecommendedLogicType>([
path(['lib', 'components', 'NavPanelAdvertisement', 'navPanelAdvertisementRecommendedLogic']),
connect(() => ({
diff --git a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushAdLogic.ts b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushAdLogic.ts
index e5447cc61f88..7bba0f2b2923 100644
--- a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushAdLogic.ts
+++ b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushAdLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
import posthog from 'posthog-js'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
@@ -9,9 +9,9 @@ import { FileSystemImport, ProductIntentContext, ProductKey } from '~/queries/sc
import type { ProductPushCampaignApi } from 'products/growth/frontend/generated/api.schemas'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import type { ProductPushDisplay } from './navPanelAdShared'
import { navPanelAdvertisementLogic } from './NavPanelAdvertisementLogic'
-import type { navPanelProductPushAdLogicType } from './navPanelProductPushAdLogicType'
import { getProductPushDisplay } from './navPanelProductPushDisplay'
export type NavPanelProductPushAdLogicProps = {
@@ -22,6 +22,47 @@ export type NavPanelProductPushAdLogicProps = {
// card's dismiss button), so key it the same way here to read the same `hidden` flag.
const dismissKey = (campaign: ProductPushCampaignApi): string => `product-push-${campaign.id}`
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelProductPushAdLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ hidden: boolean // navPanelAdvertisementLogic
+ display: ProductPushDisplay
+ flagGated: boolean
+ productInfo: FileSystemImport | undefined
+ shouldRender: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelProductPushAdLogicActions {
+ reportAdClicked: () => {
+ value: true
+ }
+ reportAdDismissed: () => {
+ value: true
+ }
+ reportAdShown: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelProductPushAdLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ productInfo: (arg: any) => FileSystemImport | undefined
+ display: (arg: any) => ProductPushDisplay
+ flagGated: (productInfo: FileSystemImport | undefined, featureFlags: FeatureFlagsSet) => boolean
+ shouldRender: (hidden: boolean, productInfo: FileSystemImport | undefined, flagGated: boolean) => boolean
+ }
+}
+
+export type navPanelProductPushAdLogicType = MakeLogicType<
+ navPanelProductPushAdLogicValues,
+ navPanelProductPushAdLogicActions,
+ NavPanelProductPushAdLogicProps,
+ navPanelProductPushAdLogicMeta
+>
+
export const navPanelProductPushAdLogic = kea<navPanelProductPushAdLogicType>([
path(['lib', 'components', 'NavPanelAdvertisement', 'navPanelProductPushAdLogic']),
props({} as NavPanelProductPushAdLogicProps),
@@ -52,12 +93,15 @@ export const navPanelProductPushAdLogic = kea<navPanelProductPushAdLogicType>([
// Never advertise a product this user can't open (mirrors the sidebar's flag filtering)
flagGated: [
(s) => [s.productInfo, s.featureFlags],
- (productInfo, featureFlags): boolean =>
- !!productInfo?.flag && !(featureFlags as Record<string, boolean>)[productInfo.flag],
+ (
+ productInfo: FileSystemImport | undefined,
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): boolean => !!productInfo?.flag && !(featureFlags as Record<string, boolean>)[productInfo.flag],
],
shouldRender: [
(s) => [s.hidden, s.productInfo, s.flagGated],
- (hidden, productInfo, flagGated): boolean => !hidden && !!productInfo && !flagGated,
+ (hidden: boolean, productInfo: FileSystemImport | undefined, flagGated: boolean): boolean =>
+ !hidden && !!productInfo && !flagGated,
],
}),
listeners(({ props }) => ({
diff --git a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushLogic.ts b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushLogic.ts
index 1b55c22ee24d..dc9d00188b41 100644
--- a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushLogic.ts
+++ b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, listeners, path } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'
import { loaders } from 'kea-loaders'
import { preflightLogic } from 'lib/logic/preflightLogic'
@@ -8,7 +8,40 @@ import { teamLogic } from 'scenes/teamLogic'
import * as api from 'products/growth/frontend/generated/api'
import type { ProductPushCampaignApi } from 'products/growth/frontend/generated/api.schemas'
-import type { navPanelProductPushLogicType } from './navPanelProductPushLogicType'
+import type { OrganizationType } from '../../../types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelProductPushLogicValues {
+ currentOrganization: OrganizationType | null // organizationLogic
+ isCloudOrDev: boolean | undefined // preflightLogic
+ currentTeamId: number | null // teamLogic
+ activeCampaign: ProductPushCampaignApi | null
+ activeCampaignLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface navPanelProductPushLogicActions {
+ loadActiveCampaign: () => any
+ loadActiveCampaignFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadActiveCampaignSuccess: (
+ activeCampaign: ProductPushCampaignApi | null,
+ payload?: any
+ ) => {
+ activeCampaign: ProductPushCampaignApi | null
+ payload?: any
+ }
+}
+
+export type navPanelProductPushLogicType = MakeLogicType<
+ navPanelProductPushLogicValues,
+ navPanelProductPushLogicActions
+>
export const navPanelProductPushLogic = kea<navPanelProductPushLogicType>([
path(['lib', 'components', 'NavPanelAdvertisement', 'navPanelProductPushLogic']),
diff --git a/frontend/src/lib/components/NotificationsMenu/notificationsMenuLogic.tsx b/frontend/src/lib/components/NotificationsMenu/notificationsMenuLogic.tsx
index 951033c01fd5..a17a9be64175 100644
--- a/frontend/src/lib/components/NotificationsMenu/notificationsMenuLogic.tsx
+++ b/frontend/src/lib/components/NotificationsMenu/notificationsMenuLogic.tsx
@@ -1,12 +1,45 @@
-import { actions, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers } from 'kea'
import { sidePanelNotificationsLogic } from '~/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic'
import { panelLayoutLogic } from '~/layout/panel-layout/panelLayoutLogic'
-import type { notificationsMenuLogicType } from './notificationsMenuLogicType'
+import type { PanelLayoutNavIdentifier } from '../../../layout/panel-layout/panelLayoutLogic'
export type NotificationTab = 'all' | 'unread' | 'archived'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface notificationsMenuLogicValues {
+ activeTab: NotificationTab
+ isNotificationsMenuOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface notificationsMenuLogicActions {
+ setActivePanelIdentifier: (identifier: PanelLayoutNavIdentifier) => {
+ identifier: PanelLayoutNavIdentifier
+ } // panelLayoutLogic
+ showLayoutPanel: (visible: boolean) => {
+ visible: boolean
+ } // panelLayoutLogic
+ loadArchivedNotifications: () => {
+ value: true
+ } // sidePanelNotificationsLogic
+ openToUnread: () => {
+ value: true
+ }
+ setActiveTab: (tab: NotificationTab) => {
+ tab: NotificationTab
+ }
+ setNotificationsMenuOpen: (isOpen: boolean) => {
+ isOpen: boolean
+ }
+ toggleNotificationsMenu: () => {
+ value: true
+ }
+}
+
+export type notificationsMenuLogicType = MakeLogicType<notificationsMenuLogicValues, notificationsMenuLogicActions>
+
export const notificationsMenuLogic = kea<notificationsMenuLogicType>([
path(['lib', 'components', 'NotificationsMenu', 'notificationsMenuLogic']),
connect(() => ({
diff --git a/frontend/src/lib/components/ObjectTags/objectTagsLogic.ts b/frontend/src/lib/components/ObjectTags/objectTagsLogic.ts
index 9e1d32d792c6..e8572775f942 100644
--- a/frontend/src/lib/components/ObjectTags/objectTagsLogic.ts
+++ b/frontend/src/lib/components/ObjectTags/objectTagsLogic.ts
@@ -1,9 +1,7 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { uniqueBy } from 'lib/utils/arrays'
-import type { objectTagsLogicType } from './objectTagsLogicType'
-
export interface ObjectTagsLogicProps {
id: string | number
onChange?: (tags: string[]) => void
@@ -14,6 +12,33 @@ function cleanTag(tag?: string): string {
return (tag ?? '').trim().toLowerCase()
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface objectTagsLogicValues {
+ editingTags: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface objectTagsLogicActions {
+ setEditingTags: (editingTags: boolean) => {
+ editingTags: boolean
+ }
+ setTags: (tags: string[]) => {
+ tags: string[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface objectTagsLogicMeta {
+ key: number | string
+}
+
+export type objectTagsLogicType = MakeLogicType<
+ objectTagsLogicValues,
+ objectTagsLogicActions,
+ ObjectTagsLogicProps,
+ objectTagsLogicMeta
+>
+
export const objectTagsLogic = kea<objectTagsLogicType>([
path(['lib', 'components', 'ObjectTags', 'objectTagsLogic']),
props({} as ObjectTagsLogicProps),
diff --git a/frontend/src/lib/components/PayGateMini/PayGateButton.tsx b/frontend/src/lib/components/PayGateMini/PayGateButton.tsx
index acbbe5305ca4..5db3b49b683a 100644
--- a/frontend/src/lib/components/PayGateMini/PayGateButton.tsx
+++ b/frontend/src/lib/components/PayGateMini/PayGateButton.tsx
@@ -9,7 +9,7 @@ import { paymentEntryLogic } from 'scenes/billing/paymentEntryLogic'
import { BillingProductV2Type } from '~/types'
import { PayGateMiniLogicProps, payGateMiniLogic } from './payGateMiniLogic'
-import { payGateMiniLogicType } from './payGateMiniLogicType'
+import type { payGateMiniLogicType } from './payGateMiniLogic'
type UsePayGateButtonReturn = Pick<
payGateMiniLogicType['values'],
diff --git a/frontend/src/lib/components/PayGateMini/payGateMiniLogic.tsx b/frontend/src/lib/components/PayGateMini/payGateMiniLogic.tsx
index 648d28ca731d..c90a25fc8049 100644
--- a/frontend/src/lib/components/PayGateMini/payGateMiniLogic.tsx
+++ b/frontend/src/lib/components/PayGateMini/payGateMiniLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { preflightLogic } from 'lib/logic/preflightLogic'
import { billingLogic } from 'scenes/billing/billingLogic'
@@ -6,7 +6,7 @@ import { userLogic } from 'scenes/userLogic'
import { AvailableFeature, BillingProductV2AddonType, BillingProductV2Type } from '~/types'
-import type { payGateMiniLogicType } from './payGateMiniLogicType'
+import type { BillingFeatureType, BillingPlanType, BillingType, UserType } from '../../../types'
export interface PayGateMiniLogicProps {
feature: AvailableFeature
@@ -15,6 +15,100 @@ export interface PayGateMiniLogicProps {
export type GateVariantType = 'add-card' | 'contact-sales' | 'move-to-cloud' | null
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface payGateMiniLogicValues {
+ billing: BillingType | null // billingLogic
+ billingLoading: boolean // billingLogic
+ isCloudOrDev: boolean | undefined // preflightLogic
+ availableFeature: (feature: AvailableFeature) => BillingFeatureType | null | undefined // userLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ user: UserType | null // userLogic
+ addonTrialModalOpen: boolean
+ bypassPaywall: boolean
+ ctaLabel: 'Contact sales' | 'Move to PostHog Cloud' | 'Upgrade now' | 'View plans'
+ ctaLink: string | undefined
+ featureAvailableOnOrg: BillingFeatureType | null | undefined
+ featureInfo: BillingFeatureType | undefined
+ featureInfoOnNextPlan: BillingFeatureType | undefined
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null
+ isAddonProduct: boolean | undefined
+ isPaymentEntryFlow: boolean
+ minimumPlanWithFeature: BillingPlanType | undefined
+ nextPlanWithFeature: BillingPlanType | null | undefined
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface payGateMiniLogicActions {
+ closeAddonTrialModal: () => {
+ value: true
+ }
+ openAddonTrialModal: () => {
+ value: true
+ }
+ setBypassPaywall: (bypassPaywall: boolean) => {
+ bypassPaywall: boolean
+ }
+ setGateVariant: (gateVariant: GateVariantType) => {
+ gateVariant: GateVariantType
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface payGateMiniLogicMeta {
+ key: AvailableFeature
+ __keaTypeGenInternalSelectorTypes: {
+ productWithFeature: (
+ billing: BillingType | null
+ ) => BillingProductV2AddonType | BillingProductV2Type | undefined
+ isAddonProduct: (
+ billing: BillingType | null,
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+ ) => boolean | undefined
+ featureInfo: (
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+ ) => BillingFeatureType | undefined
+ featureAvailableOnOrg: (user: UserType | null, arg: any) => BillingFeatureType | null | undefined
+ minimumPlanWithFeature: (
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+ ) => BillingPlanType | undefined
+ nextPlanWithFeature: (
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+ ) => BillingPlanType | null | undefined
+ featureInfoOnNextPlan: (
+ nextPlanWithFeature: BillingPlanType | null | undefined
+ ) => BillingFeatureType | undefined
+ gateVariant: (
+ billingLoading: boolean,
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean,
+ minimumPlanWithFeature: BillingPlanType | undefined,
+ arg: any,
+ arg2: any
+ ) => 'add-card' | 'contact-sales' | 'move-to-cloud' | null
+ ctaLink: (
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null,
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined,
+ featureInfo: BillingFeatureType | undefined
+ ) => string | undefined
+ ctaLabel: (
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null,
+ isPaymentEntryFlow: boolean
+ ) => 'Contact sales' | 'Move to PostHog Cloud' | 'Upgrade now' | 'View plans'
+ isPaymentEntryFlow: (
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null,
+ isAddonProduct: boolean | undefined,
+ billing: BillingType | null
+ ) => boolean
+ }
+}
+
+export type payGateMiniLogicType = MakeLogicType<
+ payGateMiniLogicValues,
+ payGateMiniLogicActions,
+ PayGateMiniLogicProps,
+ payGateMiniLogicMeta
+>
+
export const payGateMiniLogic = kea<payGateMiniLogicType>([
props({} as PayGateMiniLogicProps),
path(['lib', 'components', 'payGateMini', 'payGateMiniLogic']),
@@ -54,7 +148,7 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
selectors(({ values, props }) => ({
productWithFeature: [
(s) => [s.billing],
- (billing) => {
+ (billing: null | import('~/types').BillingType) => {
// TODO(@zach): revisit this logic after subscribe to all products is released
// There are some features where we want to check the product first
const checkProductFirst = [AvailableFeature.ORGANIZATIONS_PROJECTS]
@@ -85,29 +179,33 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
],
isAddonProduct: [
(s) => [s.billing, s.productWithFeature],
- (billing, productWithFeature) =>
+ (
+ billing: null | import('~/types').BillingType,
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined
+ ) =>
billing?.products?.some((product) =>
product.addons?.some((addon) => addon.type === productWithFeature?.type)
),
],
featureInfo: [
(s) => [s.productWithFeature],
- (productWithFeature) => productWithFeature?.features.find((f) => f.key === props.feature),
+ (productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined) =>
+ productWithFeature?.features.find((f) => f.key === props.feature),
],
featureAvailableOnOrg: [
(s) => [s.user, (_, props) => props.feature],
- (_user, feature) => {
+ (_user: null | import('~/types').UserType, feature) => {
return values.availableFeature(feature)
},
],
minimumPlanWithFeature: [
(s) => [s.productWithFeature],
- (productWithFeature) =>
+ (productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined) =>
productWithFeature?.plans.find((plan) => plan.features?.some((f) => f.key === props.feature)),
],
nextPlanWithFeature: [
(s) => [s.productWithFeature],
- (productWithFeature) => {
+ (productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined) => {
const currentPlanIndex = productWithFeature?.plans.findIndex((plan) => plan.current_plan)
if (currentPlanIndex === undefined || currentPlanIndex < 0) {
return null
@@ -117,7 +215,8 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
],
featureInfoOnNextPlan: [
(s) => [s.nextPlanWithFeature],
- (nextPlanWithFeature) => nextPlanWithFeature?.features.find((f) => f.key === props.feature),
+ (nextPlanWithFeature: null | import('~/types').BillingPlanType | undefined) =>
+ nextPlanWithFeature?.features.find((f) => f.key === props.feature),
],
gateVariant: [
(s) => [
@@ -127,7 +226,13 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
(_, props) => props.feature,
(_, props) => props.currentUsage,
],
- (billingLoading, hasAvailableFeature, minimumPlanWithFeature, feature, currentUsage) => {
+ (
+ billingLoading: boolean,
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean,
+ minimumPlanWithFeature: import('~/types').BillingPlanType | undefined,
+ feature,
+ currentUsage
+ ) => {
if (hasAvailableFeature(feature, currentUsage)) {
return null
}
@@ -145,7 +250,11 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
],
ctaLink: [
(s) => [s.gateVariant, s.productWithFeature, s.featureInfo],
- (gateVariant, productWithFeature, featureInfo) => {
+ (
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null,
+ productWithFeature: BillingProductV2AddonType | BillingProductV2Type | undefined,
+ featureInfo: import('~/types').BillingFeatureType | undefined
+ ) => {
// product activation is already handled in the startPaymentEntryFlow,
// ctaLink is used only when isPaymentEntryFlow is false
if (gateVariant === 'add-card') {
@@ -160,7 +269,7 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
],
ctaLabel: [
(s) => [s.gateVariant, s.isPaymentEntryFlow],
- (gateVariant, isPaymentEntryFlow) => {
+ (gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null, isPaymentEntryFlow: boolean) => {
if (gateVariant === 'contact-sales') {
return 'Contact sales'
}
@@ -178,7 +287,11 @@ export const payGateMiniLogic = kea<payGateMiniLogicType>([
],
isPaymentEntryFlow: [
(s) => [s.gateVariant, s.isAddonProduct, s.billing],
- (gateVariant, isAddonProduct, billing): boolean => {
+ (
+ gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null,
+ isAddonProduct: boolean | undefined,
+ billing: null | import('~/types').BillingType
+ ): boolean => {
// Show payment entry flow only for free customers trying to upgrade to a paid plan
// to use core features (not addons)
return gateVariant === 'add-card' && !isAddonProduct && billing?.subscription_level === 'free'
diff --git a/frontend/src/lib/components/ProductSetup/globalSetupLogic.ts b/frontend/src/lib/components/ProductSetup/globalSetupLogic.ts
index dfa7dfe5ccbf..9b9cbe0433be 100644
--- a/frontend/src/lib/components/ProductSetup/globalSetupLogic.ts
+++ b/frontend/src/lib/components/ProductSetup/globalSetupLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -9,9 +9,75 @@ import { teamLogic as globalTeamLogic } from 'scenes/teamLogic'
import { ProductKey } from '~/queries/schema/schema-general'
import { ActivationTaskStatus } from '~/types'
-import type { globalSetupLogicType } from './globalSetupLogicType'
+import type { AvailableSetupTaskIdsEnumApi } from '../../../generated/core/api.schemas'
import { PRODUCTS_WITH_SETUP } from './productSetupRegistry'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface globalSetupLogicValues {
+ activeSceneProductKey: ProductKey | null // sceneLogic
+ availableProducts: ProductKey[]
+ highlightSelector: string | null
+ isGlobalModalOpen: boolean
+ isProductSelectionLocked: boolean
+ optimisticTaskStatuses: Record<string, ActivationTaskStatus | null>
+ sceneHasNoSetup: boolean
+ sceneProductKey: ProductKey | null
+ selectedProduct: ProductKey
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface globalSetupLogicActions {
+ clearHighlightSelector: () => {
+ value: true
+ }
+ clearOptimisticTaskStatuses: (taskIds: SetupTaskId[]) => {
+ taskIds: AvailableSetupTaskIdsEnumApi[]
+ }
+ closeGlobalSetup: () => {
+ value: true
+ }
+ markTaskAsCompleted: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ }
+ markTaskAsSkipped: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ }
+ openGlobalSetup: () => {
+ value: true
+ }
+ setHighlightSelector: (selector: string | null) => {
+ selector: string | null
+ }
+ setOptimisticTaskStatuses: (statuses: Record<string, ActivationTaskStatus | null>) => {
+ statuses: Record<string, ActivationTaskStatus | null>
+ }
+ setSelectedProduct: (productKey: ProductKey) => {
+ productKey: ProductKey
+ }
+ unmarkTaskAsCompleted: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ }
+ unmarkTaskAsSkipped: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface globalSetupLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ sceneProductKey: (activeSceneProductKey: ProductKey | null) => ProductKey | null
+ sceneHasNoSetup: (activeSceneProductKey: ProductKey | null) => boolean
+ isProductSelectionLocked: (sceneProductKey: ProductKey | null) => boolean
+ }
+}
+
+export type globalSetupLogicType = MakeLogicType<
+ globalSetupLogicValues,
+ globalSetupLogicActions,
+ Record<string, any>,
+ globalSetupLogicMeta
+>
+
/**
* Global setup logic - the single source of truth for task completion and UI state.
*
@@ -97,7 +163,7 @@ export const globalSetupLogic = kea<globalSetupLogicType>([
// Used for auto-selecting the product in the popover
sceneProductKey: [
(s) => [s.activeSceneProductKey],
- (activeSceneProductKey): ProductKey | null => {
+ (activeSceneProductKey: ProductKey | null): ProductKey | null => {
if (activeSceneProductKey && PRODUCTS_WITH_SETUP.includes(activeSceneProductKey)) {
return activeSceneProductKey
}
@@ -108,12 +174,15 @@ export const globalSetupLogic = kea<globalSetupLogicType>([
// Used to hide the Quick Start button on scenes for products without onboarding
sceneHasNoSetup: [
(s) => [s.activeSceneProductKey],
- (activeSceneProductKey): boolean => {
+ (activeSceneProductKey: ProductKey | null): boolean => {
return activeSceneProductKey !== null && !PRODUCTS_WITH_SETUP.includes(activeSceneProductKey)
},
],
// Whether the product selection is locked to the current scene
- isProductSelectionLocked: [(s) => [s.sceneProductKey], (sceneProductKey) => sceneProductKey !== null],
+ isProductSelectionLocked: [
+ (s) => [s.sceneProductKey],
+ (sceneProductKey: ProductKey | null) => sceneProductKey !== null,
+ ],
}),
// NOTE: Not using `connect` here because the teamLogic might not have mounted yet
// by the time this logic is mounted
diff --git a/frontend/src/lib/components/ProductSetup/productSetupLogic.ts b/frontend/src/lib/components/ProductSetup/productSetupLogic.ts
index 76a6506c6e96..7bbeee5f0d51 100644
--- a/frontend/src/lib/components/ProductSetup/productSetupLogic.ts
+++ b/frontend/src/lib/components/ProductSetup/productSetupLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { router } from 'kea-router'
import posthog from 'posthog-js'
@@ -11,11 +11,13 @@ import { teamLogic } from 'scenes/teamLogic'
import { ProductKey } from '~/queries/schema/schema-general'
import { ActivationTaskStatus } from '~/types'
+import type { AvailableSetupTaskIdsEnumApi } from '../../../generated/core/api.schemas'
+import type { TeamPublicType, TeamType } from '../../../types'
import { reverseProxyCheckerLogic } from '../ReverseProxyChecker/reverseProxyCheckerLogic'
import { globalSetupLogic } from './globalSetupLogic'
-import type { productSetupLogicType } from './productSetupLogicType'
import { getProductSetupConfig, getTasksForProduct } from './productSetupRegistry'
import type { SetupTaskWithState } from './types'
+import type { ProductSetupConfig, SetupTask } from './types'
export interface ProductSetupLogicProps {
productKey: ProductKey
@@ -23,6 +25,124 @@ export interface ProductSetupLogicProps {
const DISMISSED_STORAGE_KEY = 'posthog_product_setup_dismissed'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productSetupLogicValues {
+ optimisticTaskStatuses: Record<string, ActivationTaskStatus | null> // globalSetupLogic
+ isCurrentOrganizationNew: boolean // organizationLogic
+ isCloudOrDev: boolean | undefined // preflightLogic
+ hasReverseProxy: boolean | null // reverseProxyCheckerLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ activeTasks: SetupTaskWithState[]
+ allTasks: SetupTask[]
+ completedCount: number
+ completedTasks: SetupTaskWithState[]
+ completionPercent: number
+ firstAvailableTask: SetupTaskWithState | null
+ isDismissed: boolean
+ isModalOpen: boolean
+ isSetupComplete: boolean
+ productConfig: ProductSetupConfig | null
+ remainingCount: number
+ savedOnboardingTasks: Record<string, ActivationTaskStatus | null>
+ shouldShowSetup: boolean
+ showCelebration: boolean
+ skippedTasks: SetupTaskWithState[]
+ tasksWithState: SetupTaskWithState[]
+ totalTasks: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productSetupLogicActions {
+ closeGlobalSetup: () => {
+ value: true
+ } // globalSetupLogic
+ markTaskAsCompleted: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ } // globalSetupLogic
+ markTaskAsSkipped: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ } // globalSetupLogic
+ openGlobalSetup: () => {
+ value: true
+ } // globalSetupLogic
+ setHighlightSelector: (selector: string | null) => {
+ selector: string | null
+ } // globalSetupLogic
+ unmarkTaskAsCompleted: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ } // globalSetupLogic
+ unmarkTaskAsSkipped: (taskIdOrIds: SetupTaskId | SetupTaskId[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ } // globalSetupLogic
+ showInviteModal: () => {
+ value: true
+ } // inviteLogic
+ loadHasReverseProxy: () => any // reverseProxyCheckerLogic
+ closeSetupModal: () => {
+ value: true
+ }
+ dismissSetup: () => {
+ value: true
+ }
+ loadCompletionData: () => {
+ value: true
+ }
+ openSetupModal: () => {
+ value: true
+ }
+ runTask: (taskId: SetupTaskId) => {
+ taskId: AvailableSetupTaskIdsEnumApi
+ }
+ setExpandedTaskId: (taskId: SetupTaskId | null) => {
+ taskId: AvailableSetupTaskIdsEnumApi | null
+ }
+ setShowCelebration: (show: boolean) => {
+ show: boolean
+ }
+ undismissSetup: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productSetupLogicMeta {
+ key: ProductKey
+ __keaTypeGenInternalSelectorTypes: {
+ productConfig: (productKey: ProductKey) => ProductSetupConfig | null
+ allTasks: (productKey: ProductKey, isCloudOrDev: boolean | undefined) => SetupTask[]
+ savedOnboardingTasks: (
+ currentTeam: TeamPublicType | TeamType | null,
+ optimisticTaskStatuses: Record<string, ActivationTaskStatus | null>
+ ) => Record<string, ActivationTaskStatus | null>
+ tasksWithState: (
+ allTasks: SetupTask[],
+ savedOnboardingTasks: Record<string, ActivationTaskStatus | null>,
+ hasReverseProxy: boolean | null
+ ) => SetupTaskWithState[]
+ activeTasks: (tasksWithState: SetupTaskWithState[]) => SetupTaskWithState[]
+ completedTasks: (tasksWithState: SetupTaskWithState[]) => SetupTaskWithState[]
+ skippedTasks: (tasksWithState: SetupTaskWithState[]) => SetupTaskWithState[]
+ totalTasks: (tasksWithState: SetupTaskWithState[]) => number
+ completedCount: (completedTasks: SetupTaskWithState[], skippedTasks: SetupTaskWithState[]) => number
+ remainingCount: (activeTasks: SetupTaskWithState[]) => number
+ completionPercent: (completedCount: number, totalTasks: number) => number
+ isSetupComplete: (remainingCount: number) => boolean
+ shouldShowSetup: (
+ isSetupComplete: boolean,
+ productConfig: ProductSetupConfig | null,
+ isCurrentOrganizationNew: boolean
+ ) => boolean
+ firstAvailableTask: (activeTasks: SetupTaskWithState[]) => SetupTaskWithState | null
+ }
+}
+
+export type productSetupLogicType = MakeLogicType<
+ productSetupLogicValues,
+ productSetupLogicActions,
+ ProductSetupLogicProps,
+ productSetupLogicMeta
+>
+
/**
* Product setup logic - handles product-specific state and UI for the setup experience.
*
@@ -107,10 +227,10 @@ export const productSetupLogic = kea<productSetupLogicType>([
],
})),
selectors({
- productConfig: [(_, p) => [p.productKey], (productKey) => getProductSetupConfig(productKey)],
+ productConfig: [(_, p) => [p.productKey], (productKey: ProductKey) => getProductSetupConfig(productKey)],
allTasks: [
(s, p) => [p.productKey, s.isCloudOrDev],
- (productKey, isCloudOrDev) => {
+ (productKey: ProductKey, isCloudOrDev: boolean | undefined) => {
const tasks = getTasksForProduct(productKey)
if (!isCloudOrDev) {
return tasks.filter((task) => task.id !== SetupTaskId.SetUpReverseProxy)
@@ -122,14 +242,21 @@ export const productSetupLogic = kea<productSetupLogicType>([
// null in optimistic means "unmarked" - takes priority over saved status
savedOnboardingTasks: [
(s) => [s.currentTeam, s.optimisticTaskStatuses],
- (currentTeam, optimisticTaskStatuses): Record<string, ActivationTaskStatus | null> => ({
+ (
+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,
+ optimisticTaskStatuses: Record<string, ActivationTaskStatus | null>
+ ): Record<string, ActivationTaskStatus | null> => ({
...currentTeam?.onboarding_tasks,
...optimisticTaskStatuses,
}),
],
tasksWithState: [
(s) => [s.allTasks, s.savedOnboardingTasks, s.hasReverseProxy],
- (allTasks, savedOnboardingTasks, hasReverseProxy): SetupTaskWithState[] => {
+ (
+ allTasks: import('lib/components/ProductSetup').SetupTask[],
+ savedOnboardingTasks: Record<string, ActivationTaskStatus | null>,
+ hasReverseProxy: boolean | null
+ ): SetupTaskWithState[] => {
return allTasks.map((task) => {
// Check for auto-completion conditions
let isAutoCompleted = false
@@ -166,18 +293,27 @@ export const productSetupLogic = kea<productSetupLogicType>([
})
},
],
- activeTasks: [(s) => [s.tasksWithState], (tasks) => tasks.filter((task) => !task.completed && !task.skipped)],
- completedTasks: [(s) => [s.tasksWithState], (tasks) => tasks.filter((task) => task.completed)],
- skippedTasks: [(s) => [s.tasksWithState], (tasks) => tasks.filter((task) => task.skipped)],
- totalTasks: [(s) => [s.tasksWithState], (tasks) => tasks.length],
+ activeTasks: [
+ (s) => [s.tasksWithState],
+ (tasks: SetupTaskWithState[]) => tasks.filter((task) => !task.completed && !task.skipped),
+ ],
+ completedTasks: [
+ (s) => [s.tasksWithState],
+ (tasks: SetupTaskWithState[]) => tasks.filter((task) => task.completed),
+ ],
+ skippedTasks: [
+ (s) => [s.tasksWithState],
+ (tasks: SetupTaskWithState[]) => tasks.filter((task) => task.skipped),
+ ],
+ totalTasks: [(s) => [s.tasksWithState], (tasks: SetupTaskWithState[]) => tasks.length],
completedCount: [
(s) => [s.completedTasks, s.skippedTasks],
(completed: SetupTaskWithState[], skipped: SetupTaskWithState[]) => completed.length + skipped.length,
],
- remainingCount: [(s) => [s.activeTasks], (tasks) => tasks.length],
+ remainingCount: [(s) => [s.activeTasks], (tasks: SetupTaskWithState[]) => tasks.length],
completionPercent: [
(s) => [s.completedCount, s.totalTasks],
- (completed, total) => {
+ (completed: number, total: number) => {
if (total === 0) {
return 100
}
@@ -185,10 +321,14 @@ export const productSetupLogic = kea<productSetupLogicType>([
return percent >= 5 ? percent : 5 // Min 5% for visibility
},
],
- isSetupComplete: [(s) => [s.remainingCount], (remaining) => remaining === 0],
+ isSetupComplete: [(s) => [s.remainingCount], (remaining: number) => remaining === 0],
shouldShowSetup: [
(s) => [s.isSetupComplete, s.productConfig, s.isCurrentOrganizationNew],
- (isComplete, config, isNewOrg) => {
+ (
+ isComplete: boolean,
+ config: null | import('lib/components/ProductSetup').ProductSetupConfig,
+ isNewOrg: boolean
+ ) => {
// Don't show if no valid config
if (!config || !config.title) {
return false
@@ -201,7 +341,10 @@ export const productSetupLogic = kea<productSetupLogicType>([
return !isComplete
},
],
- firstAvailableTask: [(s) => [s.activeTasks], (tasks) => tasks.find((t) => !t.lockedReason) ?? null],
+ firstAvailableTask: [
+ (s) => [s.activeTasks],
+ (tasks: SetupTaskWithState[]) => tasks.find((t) => !t.lockedReason) ?? null,
+ ],
}),
listeners(({ props, actions, values }) => ({
runTask: async ({ taskId }) => {
diff --git a/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts b/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
index e9ee86d08209..70af806311f9 100644
--- a/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
+++ b/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -10,8 +10,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { Properties } from '~/legacy-plugin-scaffold'
import { ActorType, PropertiesTimelineFilterType } from '~/types'
-import type { propertiesTimelineLogicType } from './propertiesTimelineLogicType'
-
export interface PropertiesTimelinePoint {
timestamp: Dayjs
properties: Properties
@@ -36,6 +34,57 @@ export interface PropertiesTimelineProps {
filter: PropertiesTimelineFilterType
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertiesTimelineLogicValues {
+ currentTeamId: number | null // teamLogic
+ timezone: string // teamLogic
+ crucialPropertyKeys: (keyof Properties)[]
+ dateRange: [Dayjs, Dayjs] | null
+ points: PropertiesTimelinePoint[]
+ result: RawPropertiesTimelineResult | null
+ resultLoading: boolean
+ selectedPointIndex: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertiesTimelineLogicActions {
+ loadResult: () => any
+ loadResultFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadResultSuccess: (
+ result: RawPropertiesTimelineResult,
+ payload?: any
+ ) => {
+ result: RawPropertiesTimelineResult
+ payload?: any
+ }
+ setSelectedPointIndex: (index: number | null) => {
+ index: number | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertiesTimelineLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ points: (result: RawPropertiesTimelineResult | null, timezone: string) => PropertiesTimelinePoint[]
+ crucialPropertyKeys: (result: RawPropertiesTimelineResult | null) => (keyof Properties)[]
+ dateRange: (result: RawPropertiesTimelineResult | null, timezone: string) => [Dayjs, Dayjs] | null
+ }
+}
+
+export type propertiesTimelineLogicType = MakeLogicType<
+ propertiesTimelineLogicValues,
+ propertiesTimelineLogicActions,
+ PropertiesTimelineProps,
+ propertiesTimelineLogicMeta
+>
+
export const propertiesTimelineLogic = kea<propertiesTimelineLogicType>([
path(['lib', 'components', 'PropertiesTimeline', 'propertiesTimelineLogic']),
props({} as PropertiesTimelineProps),
@@ -90,7 +139,7 @@ export const propertiesTimelineLogic = kea<propertiesTimelineLogicType>([
selectors({
points: [
(s) => [s.result, s.timezone],
- (result, timezone) =>
+ (result: RawPropertiesTimelineResult | null, timezone: string) =>
result
? result.points.map(
(point): PropertiesTimelinePoint => ({
@@ -103,11 +152,12 @@ export const propertiesTimelineLogic = kea<propertiesTimelineLogicType>([
],
crucialPropertyKeys: [
(s) => [s.result],
- (result): (keyof Properties)[] => (result ? result.crucial_property_keys : []),
+ (result: RawPropertiesTimelineResult | null): (keyof Properties)[] =>
+ result ? result.crucial_property_keys : [],
],
dateRange: [
(s) => [s.result, s.timezone],
- (result, timezone): [Dayjs, Dayjs] | null =>
+ (result: RawPropertiesTimelineResult | null, timezone: string): [Dayjs, Dayjs] | null =>
result && [
dayjsUtcToTimezone(result.effective_date_from, timezone),
dayjsUtcToTimezone(result.effective_date_to, timezone),
diff --git a/frontend/src/lib/components/PropertyFilters/components/distinctIdSelectLogic.ts b/frontend/src/lib/components/PropertyFilters/components/distinctIdSelectLogic.ts
index 7b86ead4ec49..3ccf9551909c 100644
--- a/frontend/src/lib/components/PropertyFilters/components/distinctIdSelectLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/distinctIdSelectLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,8 +7,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { PersonType } from '~/types'
-import type { distinctIdSelectLogicType } from './distinctIdSelectLogicType'
-
export interface DistinctIdSelectLogicProps {
/** Stable per-instance key so two pickers mounted side-by-side don't share state. */
instanceKey: string
@@ -36,6 +34,72 @@ export async function resolveDistinctIdNames(distinctIds: string[]): Promise<Rec
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface distinctIdSelectLogicValues {
+ currentTeamId: number | null // teamLogic
+ mergedOptions: {
+ key: string
+ label: string
+ }[]
+ persons: PersonType[]
+ personsLoading: boolean
+ resolvedNames: Record<string, string>
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface distinctIdSelectLogicActions {
+ loadPersons: ({ search }: { search?: string }) => {
+ search?: string
+ }
+ loadPersonsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonsSuccess: (
+ persons: PersonType[],
+ payload?: {
+ search?: string
+ }
+ ) => {
+ persons: PersonType[]
+ payload?: {
+ search?: string
+ }
+ }
+ setResolvedNames: (names: Record<string, string>) => {
+ names: Record<string, string>
+ }
+ setSearchQuery: (query: string) => {
+ query: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface distinctIdSelectLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ mergedOptions: (
+ persons: PersonType[],
+ resolvedNames: Record<string, string>,
+ value: string[]
+ ) => {
+ key: string
+ label: string
+ }[]
+ }
+}
+
+export type distinctIdSelectLogicType = MakeLogicType<
+ distinctIdSelectLogicValues,
+ distinctIdSelectLogicActions,
+ DistinctIdSelectLogicProps,
+ distinctIdSelectLogicMeta
+>
+
export const distinctIdSelectLogic = kea<distinctIdSelectLogicType>([
props({} as DistinctIdSelectLogicProps),
key((props) => props.instanceKey),
diff --git a/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts b/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
index 73e875677c98..f2e09a41e68b 100644
--- a/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,8 +9,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { Group, GroupTypeIndex } from '~/types'
-import type { groupKeySelectLogicType } from './groupKeySelectLogicType'
-
export interface GroupKeySelectLogicProps {
groupTypeIndex: GroupTypeIndex
value: string[]
@@ -67,6 +65,58 @@ export async function resolveGroupNames(
return names
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeySelectLogicValues {
+ currentTeamId: number | null // teamLogic
+ groups: Group[]
+ groupsLoading: boolean
+ resolvedNames: Record<string, string>
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeySelectLogicActions {
+ loadGroups: ({ search }: { search?: string }) => {
+ search?: string
+ }
+ loadGroupsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGroupsSuccess: (
+ groups: Group[],
+ payload?: {
+ search?: string
+ }
+ ) => {
+ groups: Group[]
+ payload?: {
+ search?: string
+ }
+ }
+ setResolvedNames: (names: Record<string, string>) => {
+ names: Record<string, string>
+ }
+ setSearchQuery: (query: string) => {
+ query: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeySelectLogicMeta {
+ key: string
+}
+
+export type groupKeySelectLogicType = MakeLogicType<
+ groupKeySelectLogicValues,
+ groupKeySelectLogicActions,
+ GroupKeySelectLogicProps,
+ groupKeySelectLogicMeta
+>
+
export const groupKeySelectLogic = kea<groupKeySelectLogicType>([
props({} as GroupKeySelectLogicProps),
key((props) => `${props.groupTypeIndex}`),
diff --git a/frontend/src/lib/components/PropertyFilters/components/groupKeyTooltipLogic.ts b/frontend/src/lib/components/PropertyFilters/components/groupKeyTooltipLogic.ts
index 0a536426589f..f5f27dc6e04b 100644
--- a/frontend/src/lib/components/PropertyFilters/components/groupKeyTooltipLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/groupKeyTooltipLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, key, path, props } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -6,7 +6,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { Group, GroupTypeIndex } from '~/types'
import { findGroups } from './groupKeySelectLogic'
-import type { groupKeyTooltipLogicType } from './groupKeyTooltipLogicType'
export interface GroupKeyTooltipLogicProps {
groupTypeIndex: GroupTypeIndex
@@ -51,6 +50,44 @@ async function cachedFindGroup(
return null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeyTooltipLogicValues {
+ currentTeamId: number | null // teamLogic
+ group: Group | null
+ groupLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeyTooltipLogicActions {
+ loadGroup: () => any
+ loadGroupFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGroupSuccess: (
+ group: Group | null,
+ payload?: any
+ ) => {
+ group: Group | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupKeyTooltipLogicMeta {
+ key: string
+}
+
+export type groupKeyTooltipLogicType = MakeLogicType<
+ groupKeyTooltipLogicValues,
+ groupKeyTooltipLogicActions,
+ GroupKeyTooltipLogicProps,
+ groupKeyTooltipLogicMeta
+>
+
export const groupKeyTooltipLogic = kea<groupKeyTooltipLogicType>([
props({} as GroupKeyTooltipLogicProps),
key((props) => `${props.groupTypeIndex}-${props.groupKey}`),
diff --git a/frontend/src/lib/components/PropertyFilters/components/propertyFilterBetweenLogic.ts b/frontend/src/lib/components/PropertyFilters/components/propertyFilterBetweenLogic.ts
index 413f9b77c1ef..9a59b4736b7e 100644
--- a/frontend/src/lib/components/PropertyFilters/components/propertyFilterBetweenLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/propertyFilterBetweenLogic.ts
@@ -1,9 +1,7 @@
-import { actions, kea, key, listeners, path, props, propsChanged, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, propsChanged, reducers } from 'kea'
import { PropertyFilterBaseValue, PropertyFilterValue } from '~/types'
-import type { propertyFilterBetweenLogicType } from './propertyFilterBetweenLogicType'
-
export interface PropertyFilterBetweenLogicProps {
key: string
value: PropertyFilterValue
@@ -23,6 +21,34 @@ function valuesMatch(a?: PropertyFilterBaseValue, b?: PropertyFilterBaseValue):
return Number.isNaN(a) === Number.isNaN(b) ? true : a === b
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterBetweenLogicValues {
+ localMax: number | null
+ localMin: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterBetweenLogicActions {
+ setLocalMax: (value: number | null) => {
+ value: number | null
+ }
+ setLocalMin: (value: number | null) => {
+ value: number | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterBetweenLogicMeta {
+ key: string
+}
+
+export type propertyFilterBetweenLogicType = MakeLogicType<
+ propertyFilterBetweenLogicValues,
+ propertyFilterBetweenLogicActions,
+ PropertyFilterBetweenLogicProps,
+ propertyFilterBetweenLogicMeta
+>
+
export const propertyFilterBetweenLogic = kea<propertyFilterBetweenLogicType>([
path(['lib', 'components', 'PropertyFilters', 'components', 'propertyFilterBetweenLogic']),
props({} as PropertyFilterBetweenLogicProps),
diff --git a/frontend/src/lib/components/PropertyFilters/components/propertyValueLogic.ts b/frontend/src/lib/components/PropertyFilters/components/propertyValueLogic.ts
index 00e005fc1d59..cd293eb7ac8f 100644
--- a/frontend/src/lib/components/PropertyFilters/components/propertyValueLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/propertyValueLogic.ts
@@ -1,23 +1,53 @@
-import { connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'
import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'
import { PropertyDefinitionType } from '~/types'
-import type { propertyValueLogicType } from './propertyValueLogicType'
+import type { Option } from '../../../../models/propertyDefinitionsModel'
export interface PropertyValueLogicProps {
propertyKey: string
type: PropertyDefinitionType
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyValueLogicValues {
+ options: Record<string, Option> // propertyDefinitionsModel
+ isRefreshing: boolean
+ propertyOption: Option
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyValueLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ propertyOption: (options: Record<string, Option>) => Option
+ isRefreshing: (propertyOption: Option) => boolean
+ }
+}
+
+export type propertyValueLogicType = MakeLogicType<
+ propertyValueLogicValues,
+ {},
+ PropertyValueLogicProps,
+ propertyValueLogicMeta
+>
+
export const propertyValueLogic = kea<propertyValueLogicType>([
path(['lib', 'components', 'PropertyFilters', 'propertyValueLogic']),
props({} as PropertyValueLogicProps),
key((props) => `${props.type}/${props.propertyKey}`),
connect(() => ({ values: [propertyDefinitionsModel, ['options']] })),
selectors(({ props }) => ({
- propertyOption: [(s) => [s.options], (options) => options[props.propertyKey]],
+ propertyOption: [
+ (s) => [s.options],
+ (options: Record<string, import('~/models/propertyDefinitionsModel').Option>) => options[props.propertyKey],
+ ],
/** Whether a background cache refresh is currently in progress for this property. */
- isRefreshing: [(s) => [s.propertyOption], (propertyOption): boolean => propertyOption?.refreshing ?? false],
+ isRefreshing: [
+ (s) => [s.propertyOption],
+ (propertyOption: import('~/models/propertyDefinitionsModel').Option): boolean =>
+ propertyOption?.refreshing ?? false,
+ ],
})),
])
diff --git a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts
index e78eb0b4a050..61d2edad2203 100644
--- a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { TaxonomicPropertyFilterLogicProps } from 'lib/components/PropertyFilters/types'
import { isValidPropertyFilter } from 'lib/components/PropertyFilters/utils'
@@ -31,7 +31,60 @@ import {
PropertyOperator,
} from '~/types'
-import type { taxonomicPropertyFilterLogicType } from './taxonomicPropertyFilterLogicType'
+import type { PropertyDefinitionType, PropertyType } from '../../../../types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicPropertyFilterLogicValues {
+ describeProperty: (
+ s: TaxonomicFilterValue,
+ type: PropertyDefinitionType,
+ groupTypeIndex?: number
+ ) => PropertyType | null // propertyDefinitionsModel
+ taxonomicGroups: TaxonomicFilterGroup[] // taxonomicFilterLogic
+ activeTaxonomicGroup: TaxonomicFilterGroup | undefined
+ dropdownOpen: boolean
+ filter: AnyPropertyFilter | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicPropertyFilterLogicActions {
+ closeDropdown: () => {
+ value: true
+ }
+ openDropdown: () => {
+ value: true
+ }
+ selectItem: (
+ taxonomicGroup: TaxonomicFilterGroup,
+ propertyKey?: TaxonomicFilterValue,
+ itemPropertyFilterType?: PropertyFilterType,
+ item?: any
+ ) => {
+ item: any
+ itemPropertyFilterType: PropertyFilterType | undefined
+ propertyKey: TaxonomicFilterValue | undefined
+ taxonomicGroup: TaxonomicFilterGroup
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicPropertyFilterLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ filter: (filters: AnyPropertyFilter[], filterIndex: number) => AnyPropertyFilter | null
+ activeTaxonomicGroup: (
+ filter: AnyPropertyFilter | null,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => TaxonomicFilterGroup | undefined
+ }
+}
+
+export type taxonomicPropertyFilterLogicType = MakeLogicType<
+ taxonomicPropertyFilterLogicValues,
+ taxonomicPropertyFilterLogicActions,
+ TaxonomicPropertyFilterLogicProps,
+ taxonomicPropertyFilterLogicMeta
+>
export const taxonomicPropertyFilterLogic = kea<taxonomicPropertyFilterLogicType>([
props({} as TaxonomicPropertyFilterLogicProps),
@@ -80,12 +133,12 @@ export const taxonomicPropertyFilterLogic = kea<taxonomicPropertyFilterLogicType
selectors({
filter: [
(_, p) => [p.filters, p.filterIndex],
- (filters, filterIndex): AnyPropertyFilter | null =>
+ (filters: AnyPropertyFilter[], filterIndex: number): AnyPropertyFilter | null =>
filters[filterIndex] ? sanitizePropertyFilter(filters[filterIndex]) : null,
],
activeTaxonomicGroup: [
(s) => [s.filter, s.taxonomicGroups],
- (filter, groups): TaxonomicFilterGroup | undefined => {
+ (filter: AnyPropertyFilter | null, groups: TaxonomicFilterGroup[]): TaxonomicFilterGroup | undefined => {
if (isAnyPropertyfilter(filter)) {
const taxonomicGroupType = propertyFilterTypeToTaxonomicFilterType(filter)
return groups.find((group) => group.type === taxonomicGroupType)
diff --git a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts
index da4078161708..fb40500e708c 100644
--- a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
import { PropertyFilterLogicProps } from 'lib/components/PropertyFilters/types'
import {
@@ -37,8 +37,6 @@ const TAXONOMIC_GROUP_TYPE_TO_DISPLAY_NAME: Partial<Record<TaxonomicFilterGroupT
[TaxonomicFilterGroupType.RevenueAnalyticsProperties]: 'Revenue analytics',
}
-import type { propertyFilterLogicType } from './propertyFilterLogicType'
-
export interface FilterItem {
_id: number
filter: AnyPropertyFilter
@@ -56,6 +54,59 @@ function initFiltersState(filters: AnyPropertyFilter[]): FiltersState {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterLogicValues {
+ _filtersState: FiltersState
+ filledFilters: AnyPropertyFilter[]
+ filterIds: number[]
+ filterIdsWithNew: number[]
+ filters: AnyPropertyFilter[]
+ filtersWithNew: AnyPropertyFilter[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterLogicActions {
+ remove: (index: number) => {
+ index: number
+ }
+ setFilter: (
+ index: number,
+ property: AnyPropertyFilter
+ ) => {
+ index: number
+ property: AnyPropertyFilter
+ }
+ setFilters: (filters: AnyPropertyFilter[]) => {
+ filters: AnyPropertyFilter[]
+ }
+ update: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface propertyFilterLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (_filtersState: FiltersState) => AnyPropertyFilter[]
+ filterIds: (_filtersState: FiltersState) => number[]
+ filledFilters: (filters: AnyPropertyFilter[]) => AnyPropertyFilter[]
+ filtersWithNew: (filters: AnyPropertyFilter[]) => AnyPropertyFilter[]
+ filterIdsWithNew: (
+ filterIds: number[],
+ _filtersState: FiltersState,
+ filtersWithNew: AnyPropertyFilter[]
+ ) => number[]
+ }
+}
+
+export type propertyFilterLogicType = MakeLogicType<
+ propertyFilterLogicValues,
+ propertyFilterLogicActions,
+ PropertyFilterLogicProps,
+ propertyFilterLogicMeta
+>
+
export const propertyFilterLogic = kea<propertyFilterLogicType>([
path((key) => ['lib', 'components', 'PropertyFilters', 'propertyFilterLogic', key]),
props({} as PropertyFilterLogicProps),
@@ -165,10 +216,10 @@ export const propertyFilterLogic = kea<propertyFilterLogicType>([
(state: FiltersState): AnyPropertyFilter[] => state.items.map((i) => i.filter),
],
filterIds: [(s) => [s._filtersState], (state: FiltersState): number[] => state.items.map((i) => i._id)],
- filledFilters: [(s) => [s.filters], (filters) => filters.filter(isValidPropertyFilter)],
+ filledFilters: [(s) => [s.filters], (filters: AnyPropertyFilter[]) => filters.filter(isValidPropertyFilter)],
filtersWithNew: [
(s) => [s.filters],
- (filters) => {
+ (filters: AnyPropertyFilter[]) => {
if (filters.length === 0 || isValidPropertyFilter(filters[filters.length - 1])) {
return [...filters, {} as AnyPropertyFilter]
}
diff --git a/frontend/src/lib/components/QuickFilters/quickFilterFormLogic.ts b/frontend/src/lib/components/QuickFilters/quickFilterFormLogic.ts
index 604a47176b96..bbc57f7d4233 100644
--- a/frontend/src/lib/components/QuickFilters/quickFilterFormLogic.ts
+++ b/frontend/src/lib/components/QuickFilters/quickFilterFormLogic.ts
@@ -1,5 +1,6 @@
-import { LogicWrapper, actions, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, LogicWrapper, actions, connect, kea, key, listeners, path, props, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { propertyFilterTypeToPropertyDefinitionType } from 'lib/components/PropertyFilters/utils'
import { uuid } from 'lib/utils/dom'
@@ -7,7 +8,8 @@ import { uuid } from 'lib/utils/dom'
import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'
import { PropertyFilterType, PropertyOperator, QuickFilter, QuickFilterOption } from '~/types'
-import type { quickFilterFormLogicType } from './quickFilterFormLogicType'
+import type { Option } from '../../../models/propertyDefinitionsModel'
+import type { PropertyDefinitionType } from '../../../types'
import { quickFiltersLogic } from './quickFiltersLogic'
import { ModalView, QuickFiltersModalLogicProps, quickFiltersModalLogic } from './quickFiltersModalLogic'
@@ -43,6 +45,128 @@ const trimValue = (value: string | string[] | null): string | string[] | null =>
export const operatorsWithoutValues = [PropertyOperator.IsSet, PropertyOperator.IsNotSet]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFilterFormLogicValues {
+ propertyOptions: Record<string, Option> // propertyDefinitionsModel
+ isQuickFilterSubmitting: boolean
+ isQuickFilterValid: boolean
+ name: string
+ options: QuickFilterOption[]
+ propertyName: string
+ quickFilter: QuickFilterFormValues
+ quickFilterAllErrors: Record<string, any>
+ quickFilterChanged: boolean
+ quickFilterErrors: DeepPartialMap<QuickFilterFormValues, ValidationErrorType>
+ quickFilterHasErrors: boolean
+ quickFilterManualErrors: Record<string, any>
+ quickFilterTouched: boolean
+ quickFilterTouches: Record<string, boolean>
+ quickFilterValidationErrors: DeepPartialMap<QuickFilterFormValues, ValidationErrorType>
+ showQuickFilterErrors: boolean
+ suggestions: any[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFilterFormLogicActions {
+ loadPropertyValues: (payload: {
+ endpoint: string | undefined
+ eventNames?: string[]
+ newInput: string | undefined
+ properties?: {
+ key: string
+ values: string | string[]
+ }[]
+ propertyKey: string
+ refresh?: string
+ type: PropertyDefinitionType
+ }) => {
+ endpoint: string | undefined
+ eventNames?: string[] | undefined
+ newInput: string | undefined
+ properties?:
+ | {
+ key: string
+ values: string | string[]
+ }[]
+ | undefined
+ propertyKey: string
+ refresh?: string | undefined
+ type: PropertyDefinitionType
+ } // propertyDefinitionsModel
+ closeModal: () => {
+ value: true
+ } // quickFiltersModalLogic
+ setView: (view: ModalView) => {
+ view: ModalView
+ } // quickFiltersModalLogic
+ addOption: () => {
+ value: true
+ }
+ removeOption: (index: number) => {
+ index: number
+ }
+ resetQuickFilter: (values?: QuickFilterFormValues) => {
+ values?: QuickFilterFormValues
+ }
+ setQuickFilterManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setQuickFilterValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setQuickFilterValues: (values: DeepPartial<QuickFilterFormValues>) => {
+ values: DeepPartial<QuickFilterFormValues>
+ }
+ submitQuickFilter: () => {
+ value: boolean
+ }
+ submitQuickFilterFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitQuickFilterRequest: (quickFilter: QuickFilterFormValues) => {
+ quickFilter: QuickFilterFormValues
+ }
+ submitQuickFilterSuccess: (quickFilter: QuickFilterFormValues) => {
+ quickFilter: QuickFilterFormValues
+ }
+ touchQuickFilterField: (key: string) => {
+ key: string
+ }
+ updateOption: (
+ index: number,
+ updates: Partial<QuickFilterOption>
+ ) => {
+ index: number
+ updates: Partial<QuickFilterOption>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFilterFormLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ name: (quickFilter: QuickFilterFormValues) => string
+ propertyName: (quickFilter: QuickFilterFormValues) => string
+ options: (quickFilter: QuickFilterFormValues) => QuickFilterOption[]
+ suggestions: (propertyName: string, propertyOptions: Record<string, Option>) => any[]
+ }
+}
+
+export type quickFilterFormLogicType = MakeLogicType<
+ quickFilterFormLogicValues,
+ quickFilterFormLogicActions,
+ QuickFilterFormLogicProps,
+ quickFilterFormLogicMeta
+>
+
export const quickFilterFormLogic: LogicWrapper<quickFilterFormLogicType> = kea<quickFilterFormLogicType>([
path(['lib', 'components', 'QuickFilters', 'quickFilterFormLogic']),
props({} as QuickFilterFormLogicProps),
@@ -143,12 +267,15 @@ export const quickFilterFormLogic: LogicWrapper<quickFilterFormLogicType> = kea<
})),
selectors({
- name: [(s) => [s.quickFilter], (quickFilter) => quickFilter.name],
- propertyName: [(s) => [s.quickFilter], (quickFilter) => quickFilter.propertyName],
- options: [(s) => [s.quickFilter], (quickFilter) => quickFilter.options],
+ name: [(s) => [s.quickFilter], (quickFilter: QuickFilterFormValues) => quickFilter.name],
+ propertyName: [(s) => [s.quickFilter], (quickFilter: QuickFilterFormValues) => quickFilter.propertyName],
+ options: [(s) => [s.quickFilter], (quickFilter: QuickFilterFormValues) => quickFilter.options],
suggestions: [
(s) => [s.propertyName, s.propertyOptions],
- (propertyName, propertyOptions): any[] => {
+ (
+ propertyName: string,
+ propertyOptions: Record<string, import('~/models/propertyDefinitionsModel').Option>
+ ): any[] => {
return propertyName ? propertyOptions[propertyName]?.values || [] : []
},
],
diff --git a/frontend/src/lib/components/QuickFilters/quickFiltersLogic.ts b/frontend/src/lib/components/QuickFilters/quickFiltersLogic.ts
index ebddc5952111..4bd28a75101d 100644
--- a/frontend/src/lib/components/QuickFilters/quickFiltersLogic.ts
+++ b/frontend/src/lib/components/QuickFilters/quickFiltersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -10,12 +10,120 @@ import { QuickFilterContext } from '~/queries/schema/schema-general'
import { QuickFilter } from '~/types'
import { QuickFiltersEvents } from './consts'
-import type { quickFiltersLogicType } from './quickFiltersLogicType'
export interface QuickFiltersLogicProps {
context: QuickFilterContext
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersLogicValues {
+ quickFilters: QuickFilter[]
+ quickFiltersLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersLogicActions {
+ createFilter: (payload: Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>) => {
+ payload: Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>
+ }
+ createFilterFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createFilterSuccess: (
+ quickFilters: QuickFilter[],
+ payload?: {
+ payload: Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>
+ }
+ ) => {
+ quickFilters: QuickFilter[]
+ payload?: {
+ payload: Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>
+ }
+ }
+ deleteFilter: (id: string) => {
+ id: string
+ }
+ deleteFilterFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteFilterSuccess: (
+ quickFilters: QuickFilter[],
+ payload?: {
+ id: string
+ }
+ ) => {
+ quickFilters: QuickFilter[]
+ payload?: {
+ id: string
+ }
+ }
+ filterUpdated: (filter: QuickFilter) => {
+ filter: QuickFilter
+ }
+ loadQuickFilters: () => any
+ loadQuickFiltersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQuickFiltersSuccess: (
+ quickFilters: QuickFilter[],
+ payload?: any
+ ) => {
+ quickFilters: QuickFilter[]
+ payload?: any
+ }
+ updateFilter: (
+ id: string,
+ payload: Partial<Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>>
+ ) => {
+ id: string
+ payload: Partial<Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>>
+ }
+ updateFilterFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateFilterSuccess: (
+ quickFilters: QuickFilter[],
+ payload?: {
+ id: string
+ payload: Partial<Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>>
+ }
+ ) => {
+ quickFilters: QuickFilter[]
+ payload?: {
+ id: string
+ payload: Partial<Pick<QuickFilter, 'name' | 'options' | 'property_name' | 'type'>>
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersLogicMeta {
+ key: QuickFilterContext
+}
+
+export type quickFiltersLogicType = MakeLogicType<
+ quickFiltersLogicValues,
+ quickFiltersLogicActions,
+ QuickFiltersLogicProps,
+ quickFiltersLogicMeta
+>
+
export const quickFiltersLogic = kea<quickFiltersLogicType>([
path(['lib', 'components', 'QuickFilters', 'quickFiltersLogic']),
props({} as QuickFiltersLogicProps),
diff --git a/frontend/src/lib/components/QuickFilters/quickFiltersModalLogic.ts b/frontend/src/lib/components/QuickFilters/quickFiltersModalLogic.ts
index 03c9ccb8f27b..7f128655c09d 100644
--- a/frontend/src/lib/components/QuickFilters/quickFiltersModalLogic.ts
+++ b/frontend/src/lib/components/QuickFilters/quickFiltersModalLogic.ts
@@ -1,13 +1,25 @@
-import { LogicWrapper, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ LogicWrapper,
+ actions,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import posthog from 'posthog-js'
import { LemonDialog } from '@posthog/lemon-ui'
import { QuickFilter } from '~/types'
+import type { QuickFilterContext } from '../../../queries/schema/schema-general'
import { QuickFiltersEvents } from './consts'
import { QuickFiltersLogicProps, quickFiltersLogic } from './quickFiltersLogic'
-import type { quickFiltersModalLogicType } from './quickFiltersModalLogicType'
export enum ModalView {
List = 'list',
@@ -19,6 +31,70 @@ export interface QuickFiltersModalLogicProps extends QuickFiltersLogicProps {
onNewFilterCreated?: (filter: QuickFilter) => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersModalLogicValues {
+ quickFilters: QuickFilter[] // quickFiltersLogic
+ editedFilter: QuickFilter | null
+ filteredQuickFilters: QuickFilter[]
+ isModalOpen: boolean
+ modalTitle: string
+ searchQuery: string
+ view: ModalView
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersModalLogicActions {
+ deleteFilter: (id: string) => {
+ id: string
+ } // quickFiltersLogic
+ closeModal: () => {
+ value: true
+ }
+ confirmDelete: (id: string) => {
+ id: string
+ }
+ handleFormBack: () => {
+ value: true
+ }
+ newFilterCreated: (filter: QuickFilter) => {
+ filter: QuickFilter
+ }
+ openModal: () => {
+ value: true
+ }
+ setEditingFilter: (filter: QuickFilter | null) => {
+ filter: QuickFilter | null
+ }
+ setSearchQuery: (query: string) => {
+ query: string
+ }
+ setView: (view: ModalView) => {
+ view: ModalView
+ }
+ startAddNew: () => {
+ value: true
+ }
+ startEdit: (filter: QuickFilter) => {
+ filter: QuickFilter
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersModalLogicMeta {
+ key: QuickFilterContext
+ __keaTypeGenInternalSelectorTypes: {
+ modalTitle: (view: ModalView, editedFilter: QuickFilter | null) => string
+ filteredQuickFilters: (quickFilters: QuickFilter[], searchQuery: string) => QuickFilter[]
+ }
+}
+
+export type quickFiltersModalLogicType = MakeLogicType<
+ quickFiltersModalLogicValues,
+ quickFiltersModalLogicActions,
+ QuickFiltersModalLogicProps,
+ quickFiltersModalLogicMeta
+>
+
export const quickFiltersModalLogic: LogicWrapper<quickFiltersModalLogicType> = kea<quickFiltersModalLogicType>([
path(['lib', 'components', 'QuickFilters', 'quickFiltersModalLogic']),
props({} as QuickFiltersModalLogicProps),
diff --git a/frontend/src/lib/components/QuickFilters/quickFiltersSectionLogic.ts b/frontend/src/lib/components/QuickFilters/quickFiltersSectionLogic.ts
index a4f15d860c69..aa1542dab73b 100644
--- a/frontend/src/lib/components/QuickFilters/quickFiltersSectionLogic.ts
+++ b/frontend/src/lib/components/QuickFilters/quickFiltersSectionLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -7,8 +7,8 @@ import { quickFiltersLogic } from 'lib/components/QuickFilters'
import { QuickFilterContext } from '~/queries/schema/schema-general'
import { PropertyOperator, QuickFilterOption } from '~/types'
+import type { QuickFilter } from '../../../types'
import { QuickFiltersEvents } from './consts'
-import type { quickFiltersSectionLogicType } from './quickFiltersSectionLogicType'
const QUICK_FILTERS_URL_PARAM = 'quick_filters'
@@ -77,6 +77,75 @@ const removeQuickFilter = (
return newState
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersSectionLogicValues {
+ quickFilters: QuickFilter[] // quickFiltersLogic
+ selectedQuickFilters: Record<string, SelectedQuickFilter>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersSectionLogicActions {
+ deleteFilter: (id: string) => {
+ id: string
+ } // quickFiltersLogic
+ filterUpdated: (filter: QuickFilter) => {
+ filter: QuickFilter
+ } // quickFiltersLogic
+ loadQuickFiltersSuccess: (
+ quickFilters: QuickFilter[],
+ payload?: any
+ ) => {
+ payload?: any
+ quickFilters: QuickFilter[]
+ } // quickFiltersLogic
+ clearQuickFilter: (filterId: string) => {
+ filterId: string
+ }
+ quickFiltersChanged: () => {
+ value: true
+ }
+ quickFiltersCommitted: () => {
+ value: true
+ }
+ quickFiltersUrlRestoreComplete: () => {
+ value: true
+ }
+ restoreClearQuickFilter: (filterId: string) => {
+ filterId: string
+ }
+ restoreFiltersFromUrl: () => {}
+ restoreQuickFilterValue: (
+ filterId: string,
+ propertyName: string,
+ option: QuickFilterOption
+ ) => {
+ filterId: string
+ option: QuickFilterOption
+ propertyName: string
+ }
+ setQuickFilterValue: (
+ filterId: string,
+ propertyName: string,
+ option: QuickFilterOption
+ ) => {
+ filterId: string
+ option: QuickFilterOption
+ propertyName: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickFiltersSectionLogicMeta {
+ key: string
+}
+
+export type quickFiltersSectionLogicType = MakeLogicType<
+ quickFiltersSectionLogicValues,
+ quickFiltersSectionLogicActions,
+ QuickFiltersSectionLogicProps,
+ quickFiltersSectionLogicMeta
+>
+
export const quickFiltersSectionLogic = kea<quickFiltersSectionLogicType>([
path(['lib', 'components', 'QuickFilters', 'quickFiltersSectionLogic']),
props({} as QuickFiltersSectionLogicProps),
diff --git a/frontend/src/lib/components/Resizer/resizerLogic.ts b/frontend/src/lib/components/Resizer/resizerLogic.ts
index a68b6cd0d660..b6118f3440ae 100644
--- a/frontend/src/lib/components/Resizer/resizerLogic.ts
+++ b/frontend/src/lib/components/Resizer/resizerLogic.ts
@@ -1,8 +1,6 @@
-import { actions, beforeUnmount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, beforeUnmount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import posthog from 'posthog-js'
-import type { resizerLogicType } from './resizerLogicType'
-
export type ResizerEvent = {
desiredSize: number
}
@@ -21,6 +19,52 @@ export type ResizerLogicProps = {
onDoubleClick?: () => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface resizerLogicValues {
+ desiredSize: number | null
+ isResizeInProgress: boolean
+ isStart: boolean
+ isVertical: boolean
+ resizingSize: number | null
+ size: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface resizerLogicActions {
+ beginResize: (startXOrY: number) => {
+ startXOrY: number
+ }
+ endResize: () => {
+ value: true
+ }
+ resetDesiredSize: () => {
+ value: true
+ }
+ setDesiredSize: (size: number | null) => {
+ size: number | null
+ }
+ setResizingSize: (size: number | null) => {
+ size: number | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface resizerLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ desiredSize: (size: number | null, resizingSize: number | null, isResizeInProgress: boolean) => number | null
+ isVertical: (placement: 'bottom' | 'left' | 'right' | 'top') => boolean
+ isStart: (placement: 'bottom' | 'left' | 'right' | 'top') => boolean
+ }
+}
+
+export type resizerLogicType = MakeLogicType<
+ resizerLogicValues,
+ resizerLogicActions,
+ ResizerLogicProps,
+ resizerLogicMeta
+>
+
export const resizerLogic = kea<resizerLogicType>([
props({} as ResizerLogicProps),
key((props) => props.logicKey),
@@ -61,12 +105,18 @@ export const resizerLogic = kea<resizerLogicType>([
selectors({
desiredSize: [
(s) => [s.size, s.resizingSize, s.isResizeInProgress],
- (size, resizingSize, isResizeInProgress) => {
+ (size: number | null, resizingSize: number | null, isResizeInProgress: boolean) => {
return isResizeInProgress ? (resizingSize ?? size) : size
},
],
- isVertical: [(_, p) => [p.placement], (placement) => ['left', 'right'].includes(placement)],
- isStart: [(_, p) => [p.placement], (placement) => ['left', 'top'].includes(placement)],
+ isVertical: [
+ (_, p) => [p.placement],
+ (placement: 'bottom' | 'left' | 'right' | 'top') => ['left', 'right'].includes(placement),
+ ],
+ isStart: [
+ (_, p) => [p.placement],
+ (placement: 'bottom' | 'left' | 'right' | 'top') => ['left', 'top'].includes(placement),
+ ],
}),
listeners(({ cache, props, actions, values }) => ({
beginResize: ({ startXOrY }) => {
diff --git a/frontend/src/lib/components/ReverseProxyChecker/reverseProxyCheckerLogic.ts b/frontend/src/lib/components/ReverseProxyChecker/reverseProxyCheckerLogic.ts
index 44818de1ae8d..6b41c848b32a 100644
--- a/frontend/src/lib/components/ReverseProxyChecker/reverseProxyCheckerLogic.ts
+++ b/frontend/src/lib/components/ReverseProxyChecker/reverseProxyCheckerLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, kea, listeners, path } from 'kea'
+import { MakeLogicType, afterMount, kea, listeners, path } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -8,10 +8,38 @@ import { sceneLogic } from 'scenes/sceneLogic'
import { hogql } from '~/queries/utils'
-import type { reverseProxyCheckerLogicType } from './reverseProxyCheckerLogicType'
-
const CHECK_INTERVAL_MS = 1000 * 60 * 10 // 10 minutes
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reverseProxyCheckerLogicValues {
+ hasReverseProxy: boolean | null
+ hasReverseProxyLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reverseProxyCheckerLogicActions {
+ loadHasReverseProxy: () => any
+ loadHasReverseProxyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHasReverseProxySuccess: (
+ hasReverseProxy: boolean | null,
+ payload?: any
+ ) => {
+ hasReverseProxy: boolean | null
+ payload?: any
+ }
+}
+
+export type reverseProxyCheckerLogicType = MakeLogicType<
+ reverseProxyCheckerLogicValues,
+ reverseProxyCheckerLogicActions
+>
+
export const reverseProxyCheckerLogic = kea<reverseProxyCheckerLogicType>([
path(['components', 'ReverseProxyChecker', 'reverseProxyCheckerLogic']),
loaders(({ values, cache }) => ({
diff --git a/frontend/src/lib/components/RichContentEditor/richContentEditorLogic.ts b/frontend/src/lib/components/RichContentEditor/richContentEditorLogic.ts
index df5909e3b502..2ea34cb94f33 100644
--- a/frontend/src/lib/components/RichContentEditor/richContentEditorLogic.ts
+++ b/frontend/src/lib/components/RichContentEditor/richContentEditorLogic.ts
@@ -1,6 +1,5 @@
-import { kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, kea, key, path, props, selectors } from 'kea'
-import type { richContentEditorLogicType } from './richContentEditorLogicType'
import { RichContentEditorType, TTEditor } from './types'
import { createEditor } from './utils'
@@ -9,12 +8,34 @@ export interface RichContentEditorLogicProps {
editor: TTEditor
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface richContentEditorLogicValues {
+ richContentEditor: RichContentEditorType
+ ttEditor: TTEditor
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface richContentEditorLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ ttEditor: (editor: TTEditor) => TTEditor
+ richContentEditor: (ttEditor: TTEditor) => RichContentEditorType
+ }
+}
+
+export type richContentEditorLogicType = MakeLogicType<
+ richContentEditorLogicValues,
+ {},
+ RichContentEditorLogicProps,
+ richContentEditorLogicMeta
+>
+
export const richContentEditorLogic = kea<richContentEditorLogicType>([
path(['lib', 'components', 'RichContentEditor', 'richContentEditorLogic']),
props({} as RichContentEditorLogicProps),
key(({ logicKey }) => `RichContentEditor.${logicKey}`),
selectors({
- ttEditor: [(_, p) => [p.editor], (editor): TTEditor => editor],
- richContentEditor: [(s) => [s.ttEditor], (ttEditor): RichContentEditorType => createEditor(ttEditor)],
+ ttEditor: [(_, p) => [p.editor], (editor: TTEditor): TTEditor => editor],
+ richContentEditor: [(s) => [s.ttEditor], (ttEditor: TTEditor): RichContentEditorType => createEditor(ttEditor)],
}),
])
diff --git a/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts b/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
index 515dc9c407e5..a0f86aef90ed 100644
--- a/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
+++ b/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -13,8 +13,6 @@ import { urls } from 'scenes/urls'
import { ActorsQuery } from '~/queries/schema/schema-general'
import { CohortType } from '~/types'
-import type { saveToCohortModalContentLogicType } from './saveToCohortModalContentLogicType'
-
const COHORTS_PER_PAGE = 100
export interface CohortFilters {
@@ -29,6 +27,80 @@ const DEFAULT_COHORT_FILTERS: CohortFilters = {
type: 'static',
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToCohortModalContentLogicValues {
+ currentProjectId: number | null // projectLogic
+ cohortFilters: CohortFilters
+ cohorts: CountedPaginatedResponse<CohortType>
+ cohortsLoading: boolean
+ count: number
+ pagination: PaginationManual
+ paramsFromFilters: {
+ limit: number
+ offset: number
+ page?: number | undefined
+ search?: string | undefined
+ type: 'dynamic' | 'static'
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToCohortModalContentLogicActions {
+ loadCohorts: () => any
+ loadCohortsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadCohortsSuccess: (
+ cohorts: {
+ count: number
+ results: CohortType[]
+ },
+ payload?: any
+ ) => {
+ cohorts: {
+ count: number
+ results: CohortType[]
+ }
+ payload?: any
+ }
+ saveQueryToCohort: (
+ cohort: CohortType,
+ query: ActorsQuery
+ ) => {
+ cohort: CohortType
+ query: ActorsQuery
+ }
+ setCohortFilters: (filters: Partial<CohortFilters>) => {
+ filters: Partial<CohortFilters>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToCohortModalContentLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ count: (cohorts: CountedPaginatedResponse<CohortType>) => number
+ paramsFromFilters: (cohortFilters: CohortFilters) => {
+ limit: number
+ offset: number
+ page?: number | undefined
+ search?: string | undefined
+ type: 'dynamic' | 'static'
+ }
+ pagination: (cohortFilters: CohortFilters, count: number) => PaginationManual
+ }
+}
+
+export type saveToCohortModalContentLogicType = MakeLogicType<
+ saveToCohortModalContentLogicValues,
+ saveToCohortModalContentLogicActions,
+ Record<string, any>,
+ saveToCohortModalContentLogicMeta
+>
+
export const saveToCohortModalContentLogic = kea<saveToCohortModalContentLogicType>([
path(['lib', 'components', 'SaveToCohortModal', 'saveToCohortModalContentLogic']),
connect(() => ({
@@ -64,7 +136,7 @@ export const saveToCohortModalContentLogic = kea<saveToCohortModalContentLogicTy
},
})),
selectors(({ actions }) => ({
- count: [(selectors) => [selectors.cohorts], (cohorts) => cohorts.count],
+ count: [(selectors) => [selectors.cohorts], (cohorts: CountedPaginatedResponse<CohortType>) => cohorts.count],
paramsFromFilters: [
(s) => [s.cohortFilters],
(filters: CohortFilters) => ({
@@ -75,7 +147,7 @@ export const saveToCohortModalContentLogic = kea<saveToCohortModalContentLogicTy
],
pagination: [
(s) => [s.cohortFilters, s.count],
- (filters, count): PaginationManual => {
+ (filters: CohortFilters, count: number): PaginationManual => {
return {
controlled: true,
pageSize: COHORTS_PER_PAGE,
diff --git a/frontend/src/lib/components/SceneDashboardChoice/sceneDashboardChoiceModalLogic.ts b/frontend/src/lib/components/SceneDashboardChoice/sceneDashboardChoiceModalLogic.ts
index 49d24cafa423..63f8f19e6f2f 100644
--- a/frontend/src/lib/components/SceneDashboardChoice/sceneDashboardChoiceModalLogic.ts
+++ b/frontend/src/lib/components/SceneDashboardChoice/sceneDashboardChoiceModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import posthog from 'posthog-js'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
@@ -10,7 +10,8 @@ import { userLogic } from 'scenes/userLogic'
import { dashboardsModel } from '~/models/dashboardsModel'
import { DashboardBasicType } from '~/types'
-import type { sceneDashboardChoiceModalLogicType } from './sceneDashboardChoiceModalLogicType'
+import type { Node } from '../../../queries/schema/schema-general'
+import type { DashboardType, QueryBasedInsightModel, TeamPublicType, TeamType, UserType } from '../../../types'
export type DashboardCompatibleScenes = Scene.ProjectHomepage | Scene.Person | Scene.Group
@@ -24,6 +25,59 @@ export const sceneDescription: Record<DashboardCompatibleScenes, string> = {
[Scene.ProjectHomepage]: 'this project',
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sceneDashboardChoiceModalLogicValues {
+ nameSortedDashboards: (DashboardBasicType | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>)[] // dashboardsModel
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ user: UserType | null // userLogic
+ currentDashboardId: number | null
+ dashboards: (DashboardBasicType | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>)[]
+ isOpen: boolean
+ searchTerm: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sceneDashboardChoiceModalLogicActions {
+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic
+ setUserScenePersonalisation: (
+ scene: DashboardCompatibleScenes,
+ dashboard: number
+ ) => {
+ dashboard: number
+ scene: DashboardCompatibleScenes
+ } // userLogic
+ closeSceneDashboardChoiceModal: () => boolean
+ setSceneDashboardChoice: (dashboardId: number | null) => {
+ dashboardId: number | null
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ showSceneDashboardChoiceModal: () => boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sceneDashboardChoiceModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ currentDashboardId: (currentTeam: TeamPublicType | TeamType | null, user: UserType | null) => number | null
+ dashboards: (
+ searchTerm: string | null,
+ nameSortedDashboards: (
+ | DashboardBasicType
+ | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ )[]
+ ) => (DashboardBasicType | DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>)[]
+ }
+}
+
+export type sceneDashboardChoiceModalLogicType = MakeLogicType<
+ sceneDashboardChoiceModalLogicValues,
+ sceneDashboardChoiceModalLogicActions,
+ SceneDashboardChoiceModalProps,
+ sceneDashboardChoiceModalLogicMeta
+>
+
export const sceneDashboardChoiceModalLogic = kea<sceneDashboardChoiceModalLogicType>([
path((key) => ['lib', 'components', 'SceneDashboardChoice', 'sceneDashboardChoiceModalLogic', key || 'unknown']),
props({} as SceneDashboardChoiceModalProps),
@@ -46,7 +100,10 @@ export const sceneDashboardChoiceModalLogic = kea<sceneDashboardChoiceModalLogic
selectors(({ props }) => ({
currentDashboardId: [
(s) => [s.currentTeam, s.user],
- (currentTeam, user) => {
+ (
+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,
+ user: null | import('~/types').UserType
+ ) => {
let currentDashboard: number | DashboardBasicType | null =
user?.scene_personalisation?.find((choice) => choice.scene === props.scene)?.dashboard ?? null
@@ -59,7 +116,17 @@ export const sceneDashboardChoiceModalLogic = kea<sceneDashboardChoiceModalLogic
],
dashboards: [
(s) => [s.searchTerm, s.nameSortedDashboards],
- (searchTerm, dashboards) => {
+ (
+ searchTerm: string | null,
+ dashboards: (
+ | DashboardBasicType
+ | import('~/types').DashboardType<
+ import('~/types').QueryBasedInsightModel<
+ import('../../../queries/schema').Node<Record<string, any>>
+ >
+ >
+ )[]
+ ) => {
dashboards = dashboards
.filter((d) => !d.deleted)
.sort((a, b) => (a.name ?? 'Untitled').localeCompare(b.name ?? 'Untitled'))
diff --git a/frontend/src/lib/components/Search/searchLogic.tsx b/frontend/src/lib/components/Search/searchLogic.tsx
index d619dc745dfb..e1d36c0e81cf 100644
--- a/frontend/src/lib/components/Search/searchLogic.tsx
+++ b/frontend/src/lib/components/Search/searchLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { IconBell, IconClock, IconDownload, IconLeave, IconNotification } from '@posthog/icons'
@@ -25,7 +25,10 @@ import { matchesFlagDefinition } from '~/scenes/settings/flagGating'
import { Setting, SettingSection, SettingSectionId } from '~/scenes/settings/types'
import { ActivityTab, FileSystemIconColor, GroupTypeIndex, PersonType, SearchResponse } from '~/types'
-import type { searchLogicType } from './searchLogicType'
+import type { Noun } from '../../../models/groupsModel'
+import type { FileSystemImport } from '../../../queries/schema/schema-general'
+import type { GroupType, IntegrationType, UserType } from '../../../types'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import { filterSearchItems } from './utils'
let cachedProductIconColorByType: Map<string, FileSystemIconColor> | null = null
@@ -157,6 +160,276 @@ export interface SettingsSectionSummary {
}[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface searchLogicValues {
+ isCommandOpen: boolean // commandLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel
+ organizationIntegrations: IntegrationType[] | null // organizationIntegrationsLogic
+ isDev: boolean | undefined // preflightLogic
+ cachedStarred: FileSystemEntry[] // projectTreeDataLogic
+ shortcutDataHasLoaded: boolean // projectTreeDataLogic
+ treeGroupItems: FileSystemImport[] // projectTreeDataLogic
+ cachedRecents: FileSystemEntry[] // recentItemsModel
+ recentsHasLoaded: boolean // recentItemsModel
+ sceneLogViewsByRef: Record<string, string> // recentItemsModel
+ sceneLogViewsHasLoaded: boolean // recentItemsModel
+ user: UserType | null // userLogic
+ allCategories: SearchCategory[]
+ dataManagementItems: SearchItem[]
+ groupItems: SearchItem[]
+ groupSearchResults: Partial<Record<GroupTypeIndex, GroupQueryResult[]>>
+ groupSearchResultsLoading: boolean
+ healthItems: SearchItem[]
+ isSearching: boolean
+ loadingStates: {
+ groupSearchResultsLoading: boolean
+ isToolsLoading: boolean
+ personSearchResultsLoading: boolean
+ playlistSearchResultsLoading: boolean
+ recentsHasLoaded: boolean
+ recentsLoading: boolean
+ starredHasLoaded: boolean
+ starredLoading: boolean
+ unifiedSearchResultsLoading: boolean
+ }
+ miscItems: SearchItem[]
+ newItems: SearchItem[]
+ peopleItems: SearchItem[]
+ personItems: SearchItem[]
+ personSearchResults: PersonType[]
+ personSearchResultsLoading: boolean
+ playlistItems: SearchItem[]
+ playlistSearchResults: FileSystemEntry[]
+ playlistSearchResultsLoading: boolean
+ recentItems: SearchItem[]
+ search: string
+ searchPending: boolean
+ searchedRecents: FileSystemEntry[] | null
+ searchedRecentsLoading: boolean
+ settingsItems: SearchItem[]
+ settingsSections: SettingsSectionSummary[]
+ starredItems: SearchItem[]
+ toolsItems: SearchItem[]
+ unifiedSearchItems: Record<string, SearchItem[]>
+ unifiedSearchResults: SearchResponse | null
+ unifiedSearchResultsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface searchLogicActions {
+ loadGroupSearchResults: ({ searchTerm }: { searchTerm: string }) => {
+ searchTerm: string
+ }
+ loadGroupSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGroupSearchResultsSuccess: (
+ groupSearchResults: Partial<Record<GroupTypeIndex, GroupQueryResult[]>>,
+ payload?: {
+ searchTerm: string
+ }
+ ) => {
+ groupSearchResults: Partial<Record<GroupTypeIndex, GroupQueryResult[]>>
+ payload?: {
+ searchTerm: string
+ }
+ }
+ loadPersonSearchResults: ({ searchTerm }: { searchTerm: string }) => {
+ searchTerm: string
+ }
+ loadPersonSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonSearchResultsSuccess: (
+ personSearchResults: PersonType[],
+ payload?: {
+ searchTerm: string
+ }
+ ) => {
+ personSearchResults: PersonType[]
+ payload?: {
+ searchTerm: string
+ }
+ }
+ loadPlaylistSearchResults: ({ searchTerm }: { searchTerm: string }) => {
+ searchTerm: string
+ }
+ loadPlaylistSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPlaylistSearchResultsSuccess: (
+ playlistSearchResults: FileSystemEntry[],
+ payload?: {
+ searchTerm: string
+ }
+ ) => {
+ playlistSearchResults: FileSystemEntry[]
+ payload?: {
+ searchTerm: string
+ }
+ }
+ loadUnifiedSearchResults: ({ searchTerm }: { searchTerm: string }) => {
+ searchTerm: string
+ }
+ loadUnifiedSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadUnifiedSearchResultsSuccess: (
+ unifiedSearchResults: SearchResponse | null,
+ payload?: {
+ searchTerm: string
+ }
+ ) => {
+ unifiedSearchResults: SearchResponse | null
+ payload?: {
+ searchTerm: string
+ }
+ }
+ searchRecents: ({ search }: { search: string }) => {
+ search: string
+ }
+ searchRecentsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ searchRecentsSuccess: (
+ searchedRecents: FileSystemEntry[] | null,
+ payload?: {
+ search: string
+ }
+ ) => {
+ searchedRecents: FileSystemEntry[] | null
+ payload?: {
+ search: string
+ }
+ }
+ setSearch: (search: string) => {
+ search: string
+ }
+ setSettingsSections: (sections: SettingsSectionSummary[]) => {
+ sections: SettingsSectionSummary[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface searchLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isSearching: (
+ searchedRecentsLoading: boolean,
+ unifiedSearchResultsLoading: boolean,
+ groupSearchResultsLoading: boolean,
+ personSearchResultsLoading: boolean,
+ playlistSearchResultsLoading: boolean,
+ searchPending: boolean,
+ search: string
+ ) => boolean
+ recentItems: (
+ searchedRecents: FileSystemEntry[] | null,
+ cachedRecents: FileSystemEntry[],
+ search: string
+ ) => SearchItem[]
+ starredItems: (cachedStarred: FileSystemEntry[]) => SearchItem[]
+ toolsItems: (
+ featureFlags: FeatureFlagsSet,
+ isDev: boolean | undefined,
+ user: UserType | null,
+ sceneLogViewsByRef: Record<string, string>
+ ) => SearchItem[]
+ dataManagementItems: (
+ featureFlags: FeatureFlagsSet,
+ isDev: boolean | undefined,
+ user: UserType | null,
+ sceneLogViewsByRef: Record<string, string>
+ ) => SearchItem[]
+ newItems: (featureFlags: FeatureFlagsSet, isDev: boolean | undefined, user: UserType | null) => SearchItem[]
+ peopleItems: (treeGroupItems: FileSystemImport[], sceneLogViewsByRef: Record<string, string>) => SearchItem[]
+ groupItems: (
+ groupSearchResults: Partial<Record<GroupTypeIndex, GroupQueryResult[]>>,
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun
+ ) => SearchItem[]
+ personItems: (personSearchResults: PersonType[]) => SearchItem[]
+ playlistItems: (playlistSearchResults: FileSystemEntry[]) => SearchItem[]
+ healthItems: (sceneLogViewsByRef: Record<string, string>) => SearchItem[]
+ miscItems: (sceneLogViewsByRef: Record<string, string>) => SearchItem[]
+ settingsItems: (
+ featureFlags: FeatureFlagsSet,
+ organizationIntegrations: IntegrationType[] | null,
+ settingsSections: SettingsSectionSummary[]
+ ) => SearchItem[]
+ unifiedSearchItems: (unifiedSearchResults: SearchResponse | null) => Record<string, SearchItem[]>
+ loadingStates: (
+ unifiedSearchResultsLoading: boolean,
+ recentsHasLoaded: boolean,
+ shortcutDataHasLoaded: boolean,
+ sceneLogViewsHasLoaded: boolean,
+ personSearchResultsLoading: boolean,
+ groupSearchResultsLoading: boolean,
+ playlistSearchResultsLoading: boolean
+ ) => {
+ groupSearchResultsLoading: boolean
+ isToolsLoading: boolean
+ personSearchResultsLoading: boolean
+ playlistSearchResultsLoading: boolean
+ recentsHasLoaded: boolean
+ recentsLoading: boolean
+ starredHasLoaded: boolean
+ starredLoading: boolean
+ unifiedSearchResultsLoading: boolean
+ }
+ allCategories: (
+ recentItems: SearchItem[],
+ starredItems: SearchItem[],
+ toolsItems: SearchItem[],
+ dataManagementItems: SearchItem[],
+ peopleItems: SearchItem[],
+ healthItems: SearchItem[],
+ miscItems: SearchItem[],
+ settingsItems: SearchItem[],
+ newItems: SearchItem[],
+ personItems: SearchItem[],
+ groupItems: SearchItem[],
+ playlistItems: SearchItem[],
+ unifiedSearchItems: Record<string, SearchItem[]>,
+ loadingStates: {
+ groupSearchResultsLoading: boolean
+ isToolsLoading: boolean
+ personSearchResultsLoading: boolean
+ playlistSearchResultsLoading: boolean
+ recentsHasLoaded: boolean
+ recentsLoading: boolean
+ starredHasLoaded: boolean
+ starredLoading: boolean
+ unifiedSearchResultsLoading: boolean
+ },
+ search: string
+ ) => SearchCategory[]
+ }
+}
+
+export type searchLogicType = MakeLogicType<searchLogicValues, searchLogicActions, SearchLogicProps, searchLogicMeta>
+
export const searchLogic = kea<searchLogicType>([
path((logicKey) => ['lib', 'components', 'Search', 'searchLogic', logicKey]),
props({} as SearchLogicProps),
@@ -355,14 +628,18 @@ export const searchLogic = kea<searchLogicType>([
],
recentItems: [
(s) => [s.searchedRecents, s.cachedRecents, s.search],
- (searchedRecents, cachedRecents, search): SearchItem[] => {
+ (
+ searchedRecents: FileSystemEntry[] | null,
+ cachedRecents: FileSystemEntry[],
+ search: string
+ ): SearchItem[] => {
const source = search.trim() ? (searchedRecents ?? []) : cachedRecents.slice(0, RECENTS_LIMIT)
return source.map((item) => fileSystemEntryToSearchItem(item, { id: item.path, category: 'recents' }))
},
],
starredItems: [
(s) => [s.cachedStarred],
- (cachedStarred): SearchItem[] => {
+ (cachedStarred: FileSystemEntry[]): SearchItem[] => {
return cachedStarred
.filter((e) => e.type !== 'folder')
.slice(0, STARRED_LIMIT)
@@ -377,7 +654,12 @@ export const searchLogic = kea<searchLogicType>([
],
toolsItems: [
(s) => [s.featureFlags, s.isDev, s.user, s.sceneLogViewsByRef],
- (featureFlags, isDev, user, sceneLogViewsByRef): SearchItem[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ isDev: boolean | undefined,
+ user: null | import('~/types').UserType,
+ sceneLogViewsByRef: Record<string, string>
+ ): SearchItem[] => {
const allProducts = getTreeItemsProducts()
const filteredProducts = allProducts.filter((product) => {
if (!product.href) {
@@ -444,7 +726,12 @@ export const searchLogic = kea<searchLogicType>([
],
dataManagementItems: [
(s) => [s.featureFlags, s.isDev, s.user, s.sceneLogViewsByRef],
- (featureFlags, isDev, user, sceneLogViewsByRef): SearchItem[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ isDev: boolean | undefined,
+ user: null | import('~/types').UserType,
+ sceneLogViewsByRef: Record<string, string>
+ ): SearchItem[] => {
const allMetadata = getTreeItemsMetadata()
const filteredMetadata = allMetadata.filter((item) => {
if (!isDev && !user?.is_staff && item.category === 'Unreleased') {
@@ -496,7 +783,11 @@ export const searchLogic = kea<searchLogicType>([
],
newItems: [
(s) => [s.featureFlags, s.isDev, s.user],
- (featureFlags, isDev, user): SearchItem[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ isDev: boolean | undefined,
+ user: null | import('~/types').UserType
+ ): SearchItem[] => {
const allNewItems = getTreeItemsNew()
const filteredItems = allNewItems.filter((item) => {
if (!isDev && !user?.is_staff && item.category === 'Unreleased') {
@@ -545,7 +836,10 @@ export const searchLogic = kea<searchLogicType>([
],
peopleItems: [
(s) => [s.treeGroupItems, s.sceneLogViewsByRef],
- (treeGroupItems, sceneLogViewsByRef): SearchItem[] => {
+ (
+ treeGroupItems: import('~/queries/schema/schema-general').FileSystemImport[],
+ sceneLogViewsByRef: Record<string, string>
+ ): SearchItem[] => {
const combined = [...getDefaultTreePersons(), ...treeGroupItems]
return combined.map((item) => ({
id: `people-${item.path}`,
@@ -567,7 +861,13 @@ export const searchLogic = kea<searchLogicType>([
],
groupItems: [
(s) => [s.groupSearchResults, s.aggregationLabel],
- (groupSearchResults, aggregationLabel): SearchItem[] => {
+ (
+ groupSearchResults: Partial<Record<GroupTypeIndex, GroupQueryResult[]>>,
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun
+ ): SearchItem[] => {
const items: SearchItem[] = []
for (const [groupTypeIndexString, groups] of Object.entries(groupSearchResults)) {
const groupTypeIndex = parseInt(groupTypeIndexString, 10) as GroupTypeIndex
@@ -596,7 +896,7 @@ export const searchLogic = kea<searchLogicType>([
],
personItems: [
(s) => [s.personSearchResults],
- (personSearchResults): SearchItem[] => {
+ (personSearchResults: PersonType[]): SearchItem[] => {
return personSearchResults
.filter((person) => person.uuid) // Skip persons without uuid to avoid invalid URLs
.map((person) => {
@@ -624,7 +924,7 @@ export const searchLogic = kea<searchLogicType>([
],
playlistItems: [
(s) => [s.playlistSearchResults],
- (playlistSearchResults): SearchItem[] => {
+ (playlistSearchResults: FileSystemEntry[]): SearchItem[] => {
return playlistSearchResults.map((item) => {
const name = splitPath(item.path).pop()
return {
@@ -641,7 +941,7 @@ export const searchLogic = kea<searchLogicType>([
],
healthItems: [
(s) => [s.sceneLogViewsByRef],
- (sceneLogViewsByRef): SearchItem[] => [
+ (sceneLogViewsByRef: Record<string, string>): SearchItem[] => [
{
id: 'health-pipeline-status',
name: 'Pipeline status',
@@ -666,7 +966,7 @@ export const searchLogic = kea<searchLogicType>([
],
miscItems: [
(s) => [s.sceneLogViewsByRef],
- (sceneLogViewsByRef): SearchItem[] => [
+ (sceneLogViewsByRef: Record<string, string>): SearchItem[] => [
{
id: 'misc-exports',
name: 'Exports',
@@ -715,7 +1015,11 @@ export const searchLogic = kea<searchLogicType>([
],
settingsItems: [
(s) => [s.featureFlags, s.organizationIntegrations, s.settingsSections],
- (featureFlags, organizationIntegrations, settingsSections): SearchItem[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ organizationIntegrations: import('~/types').IntegrationType[] | null,
+ settingsSections: SettingsSectionSummary[]
+ ): SearchItem[] => {
const checkFlag = (flagKey: Pick<Setting, 'flag'>['flag']): boolean =>
matchesFlagDefinition(flagKey, featureFlags)
@@ -798,7 +1102,7 @@ export const searchLogic = kea<searchLogicType>([
],
unifiedSearchItems: [
(s) => [s.unifiedSearchResults],
- (unifiedSearchResults): Record<string, SearchItem[]> => {
+ (unifiedSearchResults: SearchResponse | null): Record<string, SearchItem[]> => {
if (!unifiedSearchResults) {
return {}
}
diff --git a/frontend/src/lib/components/Sharing/sharePasswordsLogic.ts b/frontend/src/lib/components/Sharing/sharePasswordsLogic.ts
index 5d7a7d2030b7..5d0fe6d8d83b 100644
--- a/frontend/src/lib/components/Sharing/sharePasswordsLogic.ts
+++ b/frontend/src/lib/components/Sharing/sharePasswordsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -6,8 +6,6 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { SharePasswordType } from '~/types'
-import type { sharePasswordsLogicType } from './sharePasswordsLogicType'
-
export interface SharePasswordsLogicProps {
dashboardId?: number
insightId?: number
@@ -15,6 +13,83 @@ export interface SharePasswordsLogicProps {
notebookShortId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharePasswordsLogicValues {
+ createdPasswordResult: {
+ created_at: string
+ created_by_email: string
+ id: string
+ note: string
+ password: string
+ } | null
+ isCreatingPassword: boolean
+ newPasswordModalOpen: boolean
+ sharePasswords: SharePasswordType[]
+ sharePasswordsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharePasswordsLogicActions {
+ clearCreatedPasswordResult: () => {
+ value: true
+ }
+ createPassword: (
+ password?: string,
+ note?: string
+ ) => {
+ note: string | undefined
+ password: string | undefined
+ }
+ createPasswordFailure: (error: any) => {
+ error: any
+ }
+ createPasswordSuccess: (response: any) => {
+ response: any
+ }
+ deletePassword: (passwordId: string) => {
+ passwordId: string
+ }
+ loadSharePasswords: () => {
+ value: true
+ }
+ loadSharePasswordsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSharePasswordsSuccess: (
+ sharePasswords: SharePasswordType[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ sharePasswords: SharePasswordType[]
+ payload?: {
+ value: true
+ }
+ }
+ setNewPasswordModalOpen: (open: boolean) => {
+ open: boolean
+ }
+ setSharePasswords: (passwords: SharePasswordType[]) => {
+ passwords: SharePasswordType[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharePasswordsLogicMeta {
+ key: string
+}
+
+export type sharePasswordsLogicType = MakeLogicType<
+ sharePasswordsLogicValues,
+ sharePasswordsLogicActions,
+ SharePasswordsLogicProps,
+ sharePasswordsLogicMeta
+>
+
export const sharePasswordsLogic = kea<sharePasswordsLogicType>([
path(['lib', 'components', 'Sharing', 'sharePasswordsLogic']),
props({} as SharePasswordsLogicProps),
diff --git a/frontend/src/lib/components/Sharing/sharingLogic.ts b/frontend/src/lib/components/Sharing/sharingLogic.ts
index c13bcab25b56..571b8d4e42be 100644
--- a/frontend/src/lib/components/Sharing/sharingLogic.ts
+++ b/frontend/src/lib/components/Sharing/sharingLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -13,8 +14,6 @@ import { userLogic } from 'scenes/userLogic'
import { dashboardsModel } from '~/models/dashboardsModel'
import { AvailableFeature, InsightShortId, OrganizationType, SharingConfigurationType } from '~/types'
-import type { sharingLogicType } from './sharingLogicType'
-
export interface SharingLogicProps {
dashboardId?: number
insightShortId?: InsightShortId
@@ -60,6 +59,287 @@ const propsToApiParams = async (
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharingLogicValues {
+ accessControlAvailable: boolean
+ embedCode: string
+ embedLink: string
+ iframeKey: number
+ iframeProperties: {
+ allowFullScreen: true
+ frameBorder: number
+ height: string
+ key: number
+ sandbox: string
+ src: string
+ width: string
+ }
+ isSharingSettingsSubmitting: boolean
+ isSharingSettingsValid: boolean
+ params: any
+ shareLink: string
+ sharingAllowed: boolean
+ sharingConfiguration: SharingConfigurationType | null
+ sharingConfigurationLoading: boolean
+ sharingSettings: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }
+ sharingSettingsAllErrors: Record<string, any>
+ sharingSettingsChanged: boolean
+ sharingSettingsErrors: DeepPartialMap<
+ {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ },
+ ValidationErrorType
+ >
+ sharingSettingsHasErrors: boolean
+ sharingSettingsManualErrors: Record<string, any>
+ sharingSettingsTouched: boolean
+ sharingSettingsTouches: Record<string, boolean>
+ sharingSettingsValidationErrors: DeepPartialMap<
+ {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ },
+ ValidationErrorType
+ >
+ showPreview: boolean
+ showSharingSettingsErrors: boolean
+ siteUrl: string | undefined
+ whitelabelAvailable: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharingLogicActions {
+ loadSharingConfiguration: () => any
+ loadSharingConfigurationFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSharingConfigurationSuccess: (
+ sharingConfiguration: SharingConfigurationType | null,
+ payload?: any
+ ) => {
+ sharingConfiguration: SharingConfigurationType | null
+ payload?: any
+ }
+ reloadIframe: () => {
+ value: true
+ }
+ resetSharingSettings: (values?: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }) => {
+ values?: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }
+ }
+ setIsEnabled: (enabled: boolean) => boolean
+ setIsEnabledFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setIsEnabledSuccess: (
+ sharingConfiguration: SharingConfigurationType | null,
+ payload?: boolean
+ ) => {
+ sharingConfiguration: SharingConfigurationType | null
+ payload?: boolean
+ }
+ setPasswordRequired: (password_required: boolean) => boolean
+ setPasswordRequiredFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setPasswordRequiredSuccess: (
+ sharingConfiguration: SharingConfigurationType | null,
+ payload?: boolean
+ ) => {
+ sharingConfiguration: SharingConfigurationType | null
+ payload?: boolean
+ }
+ setSharingSettingsManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSharingSettingsValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSharingSettingsValues: (
+ values: DeepPartial<{
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }>
+ ) => {
+ values: DeepPartial<{
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }>
+ }
+ submitSharingSettings: () => {
+ value: boolean
+ }
+ submitSharingSettingsFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSharingSettingsRequest: (sharingSettings: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }) => {
+ sharingSettings: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }
+ }
+ submitSharingSettingsSuccess: (sharingSettings: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }) => {
+ sharingSettings: {
+ hideExtraDetails: boolean
+ legend: boolean
+ noHeader: boolean
+ showInspector: boolean
+ theme: string
+ whitelabel: boolean
+ }
+ }
+ togglePreview: () => {
+ value: true
+ }
+ touchSharingSettingsField: (key: string) => {
+ key: string
+ }
+ updateSettings: (settings: Record<string, any>) => Record<string, any>
+ updateSettingsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateSettingsSuccess: (
+ sharingConfiguration: SharingConfigurationType | null,
+ payload?: Record<string, any>
+ ) => {
+ sharingConfiguration: SharingConfigurationType | null
+ payload?: Record<string, any>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sharingLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ siteUrl: (preflight: null | import('~/types').PreflightStatus) => string | undefined
+ whitelabelAvailable: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ accessControlAvailable: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ sharingAllowed: (currentOrganization: OrganizationType | null) => boolean
+ params: (arg: any) => any
+ shareLink: (
+ siteUrl: string | undefined,
+ sharingConfiguration: SharingConfigurationType | null,
+ params: any
+ ) => string
+ embedLink: (
+ siteUrl: string | undefined,
+ sharingConfiguration: SharingConfigurationType | null,
+ params: any
+ ) => string
+ iframeProperties: (
+ embedLink: string,
+ iframeKey: number
+ ) => {
+ allowFullScreen: true
+ frameBorder: number
+ height: string
+ key: number
+ sandbox: string
+ src: string
+ width: string
+ }
+ embedCode: (iframeProperties: {
+ allowFullScreen: true
+ frameBorder: number
+ height: string
+ key: number
+ sandbox: string
+ src: string
+ width: string
+ }) => string
+ }
+}
+
+export type sharingLogicType = MakeLogicType<
+ sharingLogicValues,
+ sharingLogicActions,
+ SharingLogicProps,
+ sharingLogicMeta
+>
+
export const sharingLogic = kea<sharingLogicType>([
path(['lib', 'components', 'Sharing', 'sharingLogic']),
props({} as SharingLogicProps),
@@ -152,15 +432,20 @@ export const sharingLogic = kea<sharingLogicType>([
},
}),
selectors({
- siteUrl: [() => [preflightLogic.selectors.preflight], (preflight) => preflight?.site_url],
+ siteUrl: [
+ () => [preflightLogic.selectors.preflight],
+ (preflight: null | import('~/types').PreflightStatus) => preflight?.site_url,
+ ],
whitelabelAvailable: [
() => [userLogic.selectors.hasAvailableFeature],
- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.WHITE_LABELLING),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>
+ hasAvailableFeature(AvailableFeature.WHITE_LABELLING),
],
accessControlAvailable: [
() => [userLogic.selectors.hasAvailableFeature],
- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.ACCESS_CONTROL),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>
+ hasAvailableFeature(AvailableFeature.ACCESS_CONTROL),
],
sharingAllowed: [
@@ -177,19 +462,19 @@ export const sharingLogic = kea<sharingLogicType>([
shareLink: [
(s) => [s.siteUrl, s.sharingConfiguration, s.params],
- (siteUrl, sharingConfiguration, params) =>
+ (siteUrl: string | undefined, sharingConfiguration: SharingConfigurationType | null, params) =>
sharingConfiguration ? siteUrl + urls.shared(sharingConfiguration.access_token, params) : '',
],
embedLink: [
(s) => [s.siteUrl, s.sharingConfiguration, s.params],
- (siteUrl, sharingConfiguration, params) =>
+ (siteUrl: string | undefined, sharingConfiguration: SharingConfigurationType | null, params) =>
sharingConfiguration ? siteUrl + urls.embedded(sharingConfiguration.access_token, params) : '',
],
iframeProperties: [
(s) => [s.embedLink, s.iframeKey],
- (embedLink, iframeKey) => ({
+ (embedLink: string, iframeKey: number) => ({
width: defaultIframeConfig.width,
height: defaultIframeConfig.height,
frameBorder: 0,
@@ -203,7 +488,15 @@ export const sharingLogic = kea<sharingLogicType>([
embedCode: [
(s) => [s.iframeProperties],
- (iframeProperties) =>
+ (iframeProperties: {
+ allowFullScreen: true
+ frameBorder: number
+ height: string
+ key: number
+ sandbox: string
+ src: string
+ width: string
+ }) =>
`<iframe ${Object.entries(iframeProperties)
.map(([key, value]) => {
if (value === true) {
diff --git a/frontend/src/lib/components/Shortcuts/shortcutLogic.tsx b/frontend/src/lib/components/Shortcuts/shortcutLogic.tsx
index d74fc657f9ce..a6c40ce162fd 100644
--- a/frontend/src/lib/components/Shortcuts/shortcutLogic.tsx
+++ b/frontend/src/lib/components/Shortcuts/shortcutLogic.tsx
@@ -1,11 +1,9 @@
-import { actions, afterMount, beforeUnmount, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, beforeUnmount, kea, path, reducers } from 'kea'
import posthog from 'lib/posthog-typed'
import { isMac } from 'lib/utils/dom'
import { Scene } from 'scenes/sceneTypes'
-import type { shortcutLogicType } from './shortcutLogicType'
-
const IS_MAC = isMac()
const COMMAND_OR_CTRL = IS_MAC ? 'command' : 'ctrl'
@@ -102,6 +100,31 @@ function isEditableElement(event: KeyboardEvent): boolean {
)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface shortcutLogicValues {
+ disabledShortcutNames: string[]
+ registeredShortcuts: ShortcutType[]
+ shortcutMenuOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface shortcutLogicActions {
+ registerShortcut: (shortcut: ShortcutType) => {
+ shortcut: ShortcutType
+ }
+ setShortcutMenuOpen: (open: boolean) => {
+ open: boolean
+ }
+ toggleShortcutDisabled: (name: string) => {
+ name: string
+ }
+ unregisterShortcut: (name: string) => {
+ name: string
+ }
+}
+
+export type shortcutLogicType = MakeLogicType<shortcutLogicValues, shortcutLogicActions>
+
export const shortcutLogic = kea<shortcutLogicType>([
path(['lib', 'components', 'Shortcuts', 'shortcutLogic']),
actions({
diff --git a/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx b/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
index 339d5f624d3b..20ccb1b41b90 100644
--- a/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
+++ b/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
@@ -1,6 +1,6 @@
import ChartDataLabels from 'chartjs-plugin-datalabels'
import ChartjsPluginStacked100 from 'chartjs-plugin-stacked100'
-import { actions, afterMount, kea, path, reducers, selectors, useActions, useValues } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, path, reducers, selectors, useActions, useValues } from 'kea'
import { loaders } from 'kea-loaders'
import { useMemo, useState } from 'react'
@@ -23,7 +23,6 @@ import { urls } from 'scenes/urls'
import { FilterLogicalOperator, PropertyFilterType, PropertyOperator } from '~/types'
import { CodeSnippet, Language } from '../../CodeSnippet'
-import type { debugCHQueriesLogicType } from './DebugCHQueriesImplType'
export interface Stats {
total_queries: number
@@ -63,6 +62,52 @@ export interface DebugResponse {
hourly_stats: DataPoint[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugCHQueriesLogicValues {
+ debugResponse: DebugResponse
+ debugResponseLoading: boolean
+ filteredQueries: Query[]
+ pathFilter: string | null
+ paths: [string, number][] | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugCHQueriesLogicActions {
+ loadDebugResponse: () => any
+ loadDebugResponseFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDebugResponseSuccess: (
+ debugResponse: DebugResponse,
+ payload?: any
+ ) => {
+ debugResponse: DebugResponse
+ payload?: any
+ }
+ setPathFilter: (path: string | null) => {
+ path: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugCHQueriesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ paths: (debugResponse: DebugResponse) => [string, number][] | null
+ filteredQueries: (debugResponse: DebugResponse, pathFilter: string | null) => Query[]
+ }
+}
+
+export type debugCHQueriesLogicType = MakeLogicType<
+ debugCHQueriesLogicValues,
+ debugCHQueriesLogicActions,
+ Record<string, any>,
+ debugCHQueriesLogicMeta
+>
+
const debugCHQueriesLogic = kea<debugCHQueriesLogicType>([
path(['lib', 'components', 'CommandPalette', 'DebugCHQueries']),
actions({
diff --git a/frontend/src/lib/components/Superpowers/superpowersLogic.ts b/frontend/src/lib/components/Superpowers/superpowersLogic.ts
index bb17e0c89ed9..c0d29d56d5ea 100644
--- a/frontend/src/lib/components/Superpowers/superpowersLogic.ts
+++ b/frontend/src/lib/components/Superpowers/superpowersLogic.ts
@@ -1,15 +1,62 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { mcpHintLogic } from 'lib/components/MCPHint/mcpHintLogic'
import { preflightLogic } from 'lib/logic/preflightLogic'
// eslint-disable-next-line import/no-cycle
import { userLogic } from 'scenes/userLogic'
-import type { superpowersLogicType } from './superpowersLogicType'
+import type { PreflightStatus, UserType } from '../../../types'
export type FakeStatusOverride = 'none' | 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage'
export type FakeBillingAlert = 'none' | 'info' | 'warning' | 'error'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface superpowersLogicValues {
+ dismissedSurfaces: Record<string, true> // mcpHintLogic
+ effectiveOptOut: boolean // mcpHintLogic
+ preflight: PreflightStatus | null // preflightLogic
+ user: UserType | null // userLogic
+ fakeBillingAlert: FakeBillingAlert
+ fakeStatusOverride: FakeStatusOverride
+ isSuperpowersOpen: boolean
+ mcpHintsDismissed: boolean
+ superpowersEnabled: boolean | undefined
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface superpowersLogicActions {
+ reenableMCPHints: () => {
+ value: true
+ } // mcpHintLogic
+ closeSuperpowers: () => {
+ value: true
+ }
+ openSuperpowers: () => {
+ value: true
+ }
+ setFakeBillingAlert: (alert: FakeBillingAlert) => {
+ alert: FakeBillingAlert
+ }
+ setFakeStatusOverride: (status: FakeStatusOverride) => {
+ status: FakeStatusOverride
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface superpowersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ superpowersEnabled: (user: UserType | null, preflight: PreflightStatus | null) => boolean | undefined
+ mcpHintsDismissed: (dismissedSurfaces: Record<string, true>, effectiveOptOut: boolean) => boolean
+ }
+}
+
+export type superpowersLogicType = MakeLogicType<
+ superpowersLogicValues,
+ superpowersLogicActions,
+ Record<string, any>,
+ superpowersLogicMeta
+>
+
export const superpowersLogic = kea<superpowersLogicType>([
path(['lib', 'components', 'Superpowers', 'superpowersLogic']),
connect(() => ({
@@ -53,7 +100,10 @@ export const superpowersLogic = kea<superpowersLogicType>([
selectors({
superpowersEnabled: [
(s) => [s.user, s.preflight],
- (user, preflight) => {
+ (
+ user: null | import('../../../types').UserType,
+ preflight: null | import('../../../types').PreflightStatus
+ ) => {
return user?.is_staff || preflight?.is_debug || preflight?.instance_preferences?.debug_queries
},
],
diff --git a/frontend/src/lib/components/Support/supportLogic.ts b/frontend/src/lib/components/Support/supportLogic.ts
index 27c61b41d362..32cb1c1f1624 100644
--- a/frontend/src/lib/components/Support/supportLogic.ts
+++ b/frontend/src/lib/components/Support/supportLogic.ts
@@ -1,5 +1,6 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import posthog from 'posthog-js'
import { LemonSelectOptions } from '@posthog/lemon-ui'
@@ -27,8 +28,9 @@ import {
UserType,
} from '~/types'
+import type { BillingType, PreflightStatus } from '../../../types'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import { parseExceptionEvent } from './exceptionUtils'
-import type { supportLogicType } from './supportLogicType'
import { openSupportModal } from './SupportModal'
export function getPublicSupportSnippet(
@@ -468,6 +470,141 @@ export type SupportFormFields = {
tags?: string[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface supportLogicValues {
+ billing: BillingType | null // billingLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ isCurrentOrganizationNew: boolean // organizationLogic
+ preflight: PreflightStatus | null // preflightLogic
+ sidePanelAvailable: boolean // sidePanelStateLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ user: UserType | null // userLogic
+ conversationsFlagEnabled: boolean
+ isEmailFormOpen: boolean
+ isSendSupportRequestSubmitting: boolean
+ isSendSupportRequestValid: boolean
+ isSupportFormOpen: boolean
+ lastSubmittedTicketId: string | null
+ pendingViewTicket: {
+ created_at: string
+ id: string
+ status: string
+ } | null
+ sendSupportRequest: SupportFormFields
+ sendSupportRequestAllErrors: Record<string, any>
+ sendSupportRequestChanged: boolean
+ sendSupportRequestErrors: DeepPartialMap<SupportFormFields, ValidationErrorType>
+ sendSupportRequestHasErrors: boolean
+ sendSupportRequestManualErrors: Record<string, any>
+ sendSupportRequestTouched: boolean
+ sendSupportRequestTouches: Record<string, boolean>
+ sendSupportRequestValidationErrors: DeepPartialMap<SupportFormFields, ValidationErrorType>
+ showSendSupportRequestErrors: boolean
+ targetArea: SupportTicketTargetArea | null
+ title: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface supportLogicActions {
+ openSidePanel: (
+ tab: SidePanelTab,
+ options?: string
+ ) => {
+ options: string | undefined
+ tab: SidePanelTab
+ } // sidePanelStateLogic
+ setSidePanelOptions: (options: string | null) => {
+ options: string | null
+ } // sidePanelStateLogic
+ clearPendingViewTicket: () => {
+ value: true
+ }
+ closeEmailForm: () => {
+ value: true
+ }
+ closeSupportForm: () => {
+ value: true
+ }
+ ensureZendeskOrganization: () => {
+ value: true
+ }
+ openEmailForm: () => {
+ value: true
+ }
+ openSupportForm: (
+ values: Partial<SupportFormFields> & {
+ target?: 'modal' | 'sidePanel'
+ }
+ ) => Partial<SupportFormFields> & {
+ target?: 'modal' | 'sidePanel' | undefined
+ }
+ resetSendSupportRequest: (values?: SupportFormFields) => {
+ values?: SupportFormFields
+ }
+ setLastSubmittedTicketId: (ticketId: string | null) => {
+ ticketId: string | null
+ }
+ setSendSupportRequestManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSendSupportRequestValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSendSupportRequestValues: (values: DeepPartial<SupportFormFields>) => {
+ values: DeepPartial<SupportFormFields>
+ }
+ submitSendSupportRequest: () => {
+ value: boolean
+ }
+ submitSendSupportRequestFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSendSupportRequestRequest: (sendSupportRequest: SupportFormFields) => {
+ sendSupportRequest: SupportFormFields
+ }
+ submitSendSupportRequestSuccess: (sendSupportRequest: SupportFormFields) => {
+ sendSupportRequest: SupportFormFields
+ }
+ submitSupportTicket: (form: SupportFormFields) => SupportFormFields
+ touchSendSupportRequestField: (key: string) => {
+ key: string
+ }
+ updateUrlParams: () => {
+ value: true
+ }
+ viewConversationsTicket: (ticket: { created_at: string; id: string; status: string }) => {
+ ticket: {
+ created_at: string
+ id: string
+ status: string
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface supportLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ title: (arg: SupportFormFields) => string
+ targetArea: (sendSupportRequest: SupportFormFields) => SupportTicketTargetArea | null
+ conversationsFlagEnabled: (featureFlags: FeatureFlagsSet) => boolean
+ }
+}
+
+export type supportLogicType = MakeLogicType<
+ supportLogicValues,
+ supportLogicActions,
+ SupportFormLogicProps,
+ supportLogicMeta
+>
+
export const supportLogic = kea<supportLogicType>([
props({} as SupportFormLogicProps),
path(['lib', 'components', 'support', 'supportLogic']),
@@ -568,7 +705,7 @@ export const supportLogic = kea<supportLogicType>([
selectors({
title: [
(s) => [s.sendSupportRequest ?? null],
- (sendSupportRequest) =>
+ (sendSupportRequest: SupportFormFields) =>
sendSupportRequest.kind
? SUPPORT_TICKET_KIND_TO_TITLE[sendSupportRequest.kind]
: 'Leave a message with PostHog',
@@ -579,7 +716,8 @@ export const supportLogic = kea<supportLogicType>([
],
conversationsFlagEnabled: [
(s) => [s.featureFlags],
- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.PRODUCT_SUPPORT_SIDE_PANEL],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.PRODUCT_SUPPORT_SIDE_PANEL],
],
}),
listeners(({ actions, props, values }) => ({
diff --git a/frontend/src/lib/components/Support/supportRouterLogic.ts b/frontend/src/lib/components/Support/supportRouterLogic.ts
index 183dcf18058e..5c2b9405bf2b 100644
--- a/frontend/src/lib/components/Support/supportRouterLogic.ts
+++ b/frontend/src/lib/components/Support/supportRouterLogic.ts
@@ -1,4 +1,4 @@
-import { kea, path } from 'kea'
+import { MakeLogicType, kea, path } from 'kea'
import { urlToAction } from 'kea-router'
import { organizationLogic } from 'scenes/organizationLogic'
@@ -13,7 +13,6 @@ import {
supportLogic,
TARGET_AREA_TO_NAME,
} from './supportLogic'
-import type { supportRouterLogicType } from './supportRouterLogicType'
// Mirrors navigationLogic's `mode === 'full'` (the condition that mounts <SidePanel />), derived from
// sources supportLogic can't import without a billingLogic init cycle. Keep here, not in supportLogic.
@@ -28,6 +27,9 @@ function shouldUseSidePanel(searchParams: Record<string, any>): boolean {
return sceneLogic.findMounted()?.values.sceneConfig?.layout !== 'plain'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export type supportRouterLogicType = MakeLogicType<{}, {}>
+
export const supportRouterLogic = kea<supportRouterLogicType>([
path(['lib', 'components', 'support', 'supportRouterLogic']),
urlToAction(() => ({
diff --git a/frontend/src/lib/components/TablePreview/databaseTablePreviewLogic.ts b/frontend/src/lib/components/TablePreview/databaseTablePreviewLogic.ts
index 08f7aed86923..6793498352e9 100644
--- a/frontend/src/lib/components/TablePreview/databaseTablePreviewLogic.ts
+++ b/frontend/src/lib/components/TablePreview/databaseTablePreviewLogic.ts
@@ -1,11 +1,10 @@
-import { afterMount, kea, key, path, props, propsChanged } from 'kea'
+import { MakeLogicType, afterMount, kea, key, path, props, propsChanged } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
import { hogqlQuery } from '~/queries/query'
import { hogql } from '~/queries/utils'
-import type { databaseTablePreviewLogicType } from './databaseTablePreviewLogicType'
import type { TablePreviewExpressionColumn } from './types'
export interface DatabaseTablePreviewLogicProps {
@@ -18,6 +17,47 @@ export interface DatabaseTablePreviewLogicProps {
const DEFAULT_LIMIT = 10
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface databaseTablePreviewLogicValues {
+ previewData: Record<string, any>[]
+ previewDataLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface databaseTablePreviewLogicActions {
+ loadPreviewData: () => any
+ loadPreviewDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPreviewDataSuccess: (
+ previewData: {
+ [k: string]: any
+ }[],
+ payload?: any
+ ) => {
+ previewData: {
+ [k: string]: any
+ }[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface databaseTablePreviewLogicMeta {
+ key: string
+}
+
+export type databaseTablePreviewLogicType = MakeLogicType<
+ databaseTablePreviewLogicValues,
+ databaseTablePreviewLogicActions,
+ DatabaseTablePreviewLogicProps,
+ databaseTablePreviewLogicMeta
+>
+
export const databaseTablePreviewLogic = kea<databaseTablePreviewLogicType>([
path((logicKey) => ['lib', 'components', 'TablePreview', 'databaseTablePreviewLogic', logicKey]),
props({} as DatabaseTablePreviewLogicProps),
diff --git a/frontend/src/lib/components/TakeScreenshot/takeScreenshotLogic.ts b/frontend/src/lib/components/TakeScreenshot/takeScreenshotLogic.ts
index ee6773119684..e1502d1758d7 100644
--- a/frontend/src/lib/components/TakeScreenshot/takeScreenshotLogic.ts
+++ b/frontend/src/lib/components/TakeScreenshot/takeScreenshotLogic.ts
@@ -1,10 +1,8 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
-import type { takeScreenshotLogicType } from './takeScreenshotLogicType'
-
// Define interfaces for better type safety
export interface Point {
x: number
@@ -35,6 +33,105 @@ export interface TakeScreenshotLogicProps {
screenshotKey?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface takeScreenshotLogicValues {
+ color: string
+ currentPath: any[]
+ currentText: string
+ dragStartOffset: Point | null
+ drawings: any[]
+ fontSize: number
+ historyStack: any[]
+ imageFile: File | null
+ isDrawing: boolean
+ isLoading: boolean
+ isOpen: boolean
+ lineWidth: number
+ mode: string
+ originalImage: HTMLImageElement | null
+ selectedTextIndex: number | null
+ textInputPosition: {
+ visible: boolean
+ x: number
+ y: number
+ }
+ texts: any[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface takeScreenshotLogicActions {
+ setBlob: (blob: Blob) => {
+ blob: Blob
+ }
+ setColor: (color: string) => {
+ color: string
+ }
+ setCurrentPath: (currentPath: Point[]) => {
+ currentPath: Point[]
+ }
+ setCurrentText: (currentText: string) => {
+ currentText: string
+ }
+ setDragStartOffset: (dragStartOffset: Point | null) => {
+ dragStartOffset: Point | null
+ }
+ setDrawings: (drawings: DrawingItem[]) => {
+ drawings: DrawingItem[]
+ }
+ setFontSize: (fontSize: number) => {
+ fontSize: number
+ }
+ setHistoryStack: (historyStack: HistoryItem[]) => {
+ historyStack: HistoryItem[]
+ }
+ setImageFile: (imageFile: File | null) => {
+ imageFile: File | null
+ }
+ setIsDrawing: (isDrawing: boolean) => {
+ isDrawing: boolean
+ }
+ setIsLoading: (isLoading: boolean) => {
+ isLoading: boolean
+ }
+ setIsOpen: (isOpen: boolean) => {
+ isOpen: boolean
+ }
+ setLineWidth: (lineWidth: number) => {
+ lineWidth: number
+ }
+ setMode: (mode: 'draw' | 'moveText' | 'text') => {
+ mode: 'draw' | 'moveText' | 'text'
+ }
+ setOriginalImage: (originalImage: HTMLImageElement | null) => {
+ originalImage: HTMLImageElement | null
+ }
+ setSelectedTextIndex: (selectedTextIndex: number | null) => {
+ selectedTextIndex: number | null
+ }
+ setTextInputPosition: (textInputPosition: { visible: boolean; x: number; y: number }) => {
+ textInputPosition: {
+ visible: boolean
+ x: number
+ y: number
+ }
+ }
+ setTexts: (texts: TextItem[]) => {
+ texts: TextItem[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface takeScreenshotLogicMeta {
+ key: string
+}
+
+export type takeScreenshotLogicType = MakeLogicType<
+ takeScreenshotLogicValues,
+ takeScreenshotLogicActions,
+ TakeScreenshotLogicProps,
+ takeScreenshotLogicMeta
+>
+
export const takeScreenshotLogic = kea<takeScreenshotLogicType>([
path((key) => ['lib', 'components', 'TakeScreenshot', 'takeScreenshotLogic', key]),
props({} as TakeScreenshotLogicProps),
diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
index 61ce86f6425b..ec7c87fd9519 100644
--- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
@@ -1,4 +1,17 @@
-import { actions, connect, events, isBreakpoint, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ connect,
+ events,
+ isBreakpoint,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { combineUrl } from 'kea-router'
import posthog from 'posthog-js'
@@ -55,7 +68,7 @@ import { CohortType, EventDefinition, GroupTypeIndex, PropertyType } from '~/typ
import { teamLogic } from '../../../scenes/teamLogic'
import { getItemGroup } from './InfiniteList'
-import type { infiniteListLogicType } from './infiniteListLogicType'
+import type { SelectItemMeta, TopMatchItem } from './taxonomicFilterLogic'
function pinnedItemMatchesSearch(
item: TaxonomicDefinitionTypes,
@@ -228,6 +241,560 @@ async function fetchCachedListResponse(path: string, searchParams: Record<string
return response
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infiniteListLogicValues {
+ recentFilterItems: TaxonomicDefinitionTypes[] // recentTaxonomicFiltersLogic
+ activeTab: TaxonomicFilterGroupType // taxonomicFilterLogic
+ anyGroupLoading: boolean // taxonomicFilterLogic
+ anyGroupStale: boolean // taxonomicFilterLogic
+ groupType: any // taxonomicFilterLogic
+ includeStaleEvents: boolean // taxonomicFilterLogic
+ searchQuery: string // taxonomicFilterLogic
+ taxonomicGroupTypes: TaxonomicFilterGroupType[] // taxonomicFilterLogic
+ taxonomicGroups: TaxonomicFilterGroup[] // taxonomicFilterLogic
+ topMatchItemsWithSkeletons: (SkeletonItem | TopMatchItem)[] // taxonomicFilterLogic
+ value: any // taxonomicFilterLogic
+ pinnedFilterItems: TaxonomicDefinitionTypes[] // taxonomicFilterPinnedPropertiesLogic
+ currentTeamId: number | null // teamLogic
+ allowNonCapturedEvents: boolean
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[]
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[]
+ dedupedTopMatches: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ excludedProperties: string[] | undefined
+ expandedCount: number
+ fuse: ListFuse
+ group: TaxonomicFilterGroup | undefined
+ hasAppliedInitialPin: boolean
+ hasMore: boolean
+ hasRemoteDataSource: boolean
+ hasRenderFunction: boolean
+ index: number
+ initialPinnedRowIndex: number | null
+ isActiveTab: boolean
+ isExpandable: boolean
+ isExpandableButtonSelected: boolean
+ isExpanded: boolean
+ isLoading: boolean
+ isLocalDataLoading: boolean
+ isSoleSubstantiveGroup: boolean
+ isSuggestedFilters: boolean
+ items:
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ keywordShortcutItems: QuickFilterItem[]
+ limit: number
+ listGroupType: TaxonomicFilterGroupType
+ localItems: ListStorage
+ minSearchQueryLength: any
+ needsMoreSearchCharacters: boolean
+ pinnedRowIndex: number | null
+ propertyAllowList: string[] | undefined
+ rawLocalItems: (CohortType | EventDefinition)[]
+ remoteEndpoint: string | null
+ remoteFetchFailed: string | null
+ remoteItems: ListStorage
+ remoteItemsLoading: boolean
+ remoteResultsAreFresh: boolean
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[]
+ rowCount: number
+ scopedRemoteEndpoint: string | null
+ selectedItem: TaxonomicDefinitionTypes | undefined
+ selectedItemInView: boolean
+ selectedItemValue: number | string | null
+ selectionPromotionContext: {
+ group: TaxonomicFilterGroup | undefined
+ groupType: TaxonomicFilterGroupType | undefined
+ value: TaxonomicFilterValue | undefined
+ }
+ showEmptyState: boolean
+ showLoadingState: boolean
+ showNonCapturedEventOption: boolean
+ showPopover: boolean
+ showSuggestedFiltersEmptyState: boolean
+ soleGroupHasGetValue: boolean
+ startIndex: number
+ stopIndex: number
+ suggestedFiltersSettling: boolean
+ suggestedPinnedMatches: TaxonomicDefinitionTypes[]
+ suggestedRecentMatches: TaxonomicDefinitionTypes[]
+ topMatchesForQuery: TaxonomicDefinitionTypes[]
+ totalExtraCount: number
+ totalListCount: number
+ totalResultCount: number
+ trimmedSearchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infiniteListLogicActions {
+ infiniteListResultsReceived: (
+ groupType: TaxonomicFilterGroupType,
+ results: ListStorage
+ ) => {
+ groupType: TaxonomicFilterGroupType
+ results: ListStorage
+ } // taxonomicFilterLogic
+ selectItem: (
+ group: TaxonomicFilterGroup,
+ value: TaxonomicFilterValue,
+ item: any,
+ meta?: SelectItemMeta | undefined
+ ) => {
+ group: TaxonomicFilterGroup
+ item: any
+ meta: SelectItemMeta | undefined
+ value: TaxonomicFilterValue
+ } // taxonomicFilterLogic
+ setActiveTab: (activeTab: TaxonomicFilterGroupType) => {
+ activeTab: TaxonomicFilterGroupType
+ } // taxonomicFilterLogic
+ setIncludeStaleEvents: (includeStaleEvents: boolean) => {
+ includeStaleEvents: boolean
+ } // taxonomicFilterLogic
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ } // taxonomicFilterLogic
+ abortAnyRunningQuery: () => {
+ value: true
+ }
+ applyInitialPinnedRow: (rowIndex: number) => {
+ rowIndex: number
+ }
+ expand: () => {
+ value: true
+ }
+ loadRemoteItems: (options: LoaderOptions) => LoaderOptions
+ loadRemoteItemsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRemoteItemsSuccess: (
+ remoteItems:
+ | ListStorage
+ | {
+ count: any
+ expandedCount: any
+ loadDurationMs: number | undefined
+ queryChanged: boolean
+ results: TaxonomicDefinitionTypes[]
+ searchQuery: string
+ },
+ payload?: LoaderOptions
+ ) => {
+ remoteItems:
+ | ListStorage
+ | {
+ count: any
+ expandedCount: any
+ loadDurationMs: number | undefined
+ queryChanged: boolean
+ results: TaxonomicDefinitionTypes[]
+ searchQuery: string
+ }
+ payload?: LoaderOptions
+ }
+ moveDown: () => {
+ value: true
+ }
+ moveUp: () => {
+ value: true
+ }
+ onRowsRendered: (rowInfo: RowInfo) => {
+ rowInfo: RowInfo
+ }
+ reconcilePinnedRowState: () => {
+ value: true
+ }
+ remoteItemsFetchFailedForQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+ resetPinnedRowState: () => {
+ value: true
+ }
+ selectSelected: () => {
+ value: true
+ }
+ setHasMore: (hasMore: boolean) => {
+ hasMore: boolean
+ }
+ setIndex: (index: number) => {
+ index: number
+ }
+ setLimit: (limit: number) => {
+ limit: number
+ }
+ setPinnedRowIndex: (pinnedRowIndex: number | null) => {
+ pinnedRowIndex: number | null
+ }
+ togglePinnedRow: (rowIndex: number) => {
+ rowIndex: number
+ }
+ updateRemoteItem: (item: TaxonomicDefinitionTypes) => {
+ item: TaxonomicDefinitionTypes
+ }
+ updateRemoteItemFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateRemoteItemSuccess: (
+ remoteItems: {
+ count: number
+ expandedCount?: number | undefined
+ first?: boolean | undefined
+ loadDurationMs?: number | undefined
+ queryChanged?: boolean | undefined
+ results: TaxonomicDefinitionTypes[]
+ searchQuery?: string | undefined
+ },
+ payload?: {
+ item: TaxonomicDefinitionTypes
+ }
+ ) => {
+ remoteItems: {
+ count: number
+ expandedCount?: number | undefined
+ first?: boolean | undefined
+ loadDurationMs?: number | undefined
+ queryChanged?: boolean | undefined
+ results: TaxonomicDefinitionTypes[]
+ searchQuery?: string | undefined
+ }
+ payload?: {
+ item: TaxonomicDefinitionTypes
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infiniteListLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ listGroupType: (listGroupType: TaxonomicFilterGroupType) => TaxonomicFilterGroupType
+ isSuggestedFilters: (listGroupType: TaxonomicFilterGroupType) => boolean
+ trimmedSearchQuery: (searchQuery: string) => string
+ isActiveTab: (listGroupType: TaxonomicFilterGroupType, activeTab: TaxonomicFilterGroupType) => boolean
+ contextFilteredRecentItems: (
+ recentFilterItems: TaxonomicDefinitionTypes[],
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ arg: ExcludedOperators | undefined,
+ arg2: import('lib/components/TaxonomicFilter/types').SelectingKeyOnly | undefined,
+ arg3: import('lib/components/TaxonomicFilter/types').TaxonomicFilterGroupValueMap | undefined
+ ) => TaxonomicDefinitionTypes[]
+ contextFilteredPinnedItems: (
+ pinnedFilterItems: TaxonomicDefinitionTypes[],
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ ) => TaxonomicDefinitionTypes[]
+ isSoleSubstantiveGroup: (
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ ) => boolean
+ soleGroupHasGetValue: (
+ isSoleSubstantiveGroup: boolean,
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => boolean
+ allowNonCapturedEvents: (arg: any) => boolean
+ isLocalDataLoading: (arg: any) => boolean
+ isLoading: (remoteItemsLoading: boolean) => boolean
+ group: (
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => TaxonomicFilterGroup | undefined
+ remoteEndpoint: (group: TaxonomicFilterGroup | undefined) => string | null
+ minSearchQueryLength: (group: TaxonomicFilterGroup | undefined, arg: any) => any
+ needsMoreSearchCharacters: (minSearchQueryLength: any, searchQuery: string) => boolean
+ excludedProperties: (group: TaxonomicFilterGroup | undefined) => string[] | undefined
+ propertyAllowList: (group: TaxonomicFilterGroup | undefined) => string[] | undefined
+ scopedRemoteEndpoint: (group: TaxonomicFilterGroup | undefined) => string | null
+ hasRenderFunction: (group: TaxonomicFilterGroup | undefined) => boolean
+ isExpandable: (
+ remoteEndpoint: string | null,
+ scopedRemoteEndpoint: string | null,
+ remoteItems: ListStorage
+ ) => boolean
+ isExpandableButtonSelected: (isExpandable: boolean, index: number, totalListCount: number) => boolean
+ hasRemoteDataSource: (remoteEndpoint: string | null) => boolean
+ remoteResultsAreFresh: (
+ hasRemoteDataSource: boolean,
+ remoteItems: ListStorage,
+ searchQuery: string,
+ remoteFetchFailed: string | null
+ ) => boolean
+ showNonCapturedEventOption: (
+ allowNonCapturedEvents: boolean,
+ listGroupType: TaxonomicFilterGroupType,
+ searchQuery: string,
+ isLoading: boolean,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[]
+ ) => boolean
+ suggestedFiltersSettling: (
+ isSuggestedFilters: boolean,
+ anyGroupLoading: boolean,
+ anyGroupStale: boolean,
+ searchQuery: string
+ ) => boolean
+ showEmptyState: (
+ totalListCount: number,
+ isLoading: boolean,
+ suggestedFiltersSettling: boolean,
+ searchQuery: string,
+ hasRemoteDataSource: boolean,
+ showNonCapturedEventOption: boolean,
+ needsMoreSearchCharacters: boolean,
+ remoteResultsAreFresh: boolean
+ ) => boolean
+ showLoadingState: (
+ isLoading: boolean,
+ suggestedFiltersSettling: boolean,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[],
+ searchQuery: string,
+ hasRemoteDataSource: boolean,
+ remoteResultsAreFresh: boolean
+ ) => boolean
+ rawLocalItems: (
+ arg: any,
+ arg2: TaxonomicFilterGroupType,
+ arg3: boolean | undefined
+ ) => (CohortType | EventDefinition)[]
+ fuse: (
+ rawLocalItems: (CohortType | EventDefinition)[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ group: TaxonomicFilterGroup | undefined
+ ) => ListFuse
+ localItems: (
+ rawLocalItems: (CohortType | EventDefinition)[],
+ searchQuery: string,
+ fuse: ListFuse,
+ group: TaxonomicFilterGroup | undefined
+ ) => ListStorage
+ topMatchesForQuery: (
+ localItems: ListStorage,
+ remoteItems: ListStorage,
+ searchQuery: string,
+ hasRemoteDataSource: boolean,
+ keywordShortcutItems: QuickFilterItem[],
+ listGroupType: TaxonomicFilterGroupType,
+ arg: boolean | undefined
+ ) => TaxonomicDefinitionTypes[]
+ suggestedPinnedMatches: (
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[],
+ searchQuery: string,
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => TaxonomicDefinitionTypes[]
+ suggestedRecentMatches: (
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[],
+ searchQuery: string,
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => TaxonomicDefinitionTypes[]
+ keywordShortcutItems: (
+ group: TaxonomicFilterGroup | undefined,
+ searchQuery: string,
+ arg: any
+ ) => QuickFilterItem[]
+ dedupedTopMatches: (
+ topMatchItemsWithSkeletons: (SkeletonItem | TopMatchItem)[],
+ listGroupType: TaxonomicFilterGroupType,
+ searchQuery: string,
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[],
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[],
+ suggestedRecentMatches: TaxonomicDefinitionTypes[],
+ suggestedPinnedMatches: TaxonomicDefinitionTypes[],
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => (SkeletonItem | TaxonomicDefinitionTypes)[]
+ selectionPromotionContext: (
+ group: TaxonomicFilterGroup | undefined,
+ groupType: any,
+ value: any
+ ) => {
+ group: TaxonomicFilterGroup | undefined
+ groupType: TaxonomicFilterGroupType | undefined
+ value: TaxonomicFilterValue | undefined
+ }
+ items: (
+ remoteItems: ListStorage,
+ localItems: ListStorage,
+ listGroupType: TaxonomicFilterGroupType,
+ dedupedTopMatches: (SkeletonItem | TaxonomicDefinitionTypes)[],
+ searchQuery: string,
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[],
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[],
+ suggestedPinnedMatches: TaxonomicDefinitionTypes[],
+ suggestedRecentMatches: TaxonomicDefinitionTypes[],
+ keywordShortcutItems: QuickFilterItem[],
+ isSoleSubstantiveGroup: boolean,
+ soleGroupHasGetValue: boolean,
+ taxonomicGroups: TaxonomicFilterGroup[],
+ selectionPromotionContext: {
+ group: TaxonomicFilterGroup | undefined
+ groupType: TaxonomicFilterGroupType | undefined
+ value: TaxonomicFilterValue | undefined
+ },
+ arg: boolean | undefined
+ ) =>
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ totalResultCount: (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => number
+ totalExtraCount: (isExpandable: boolean, hasRenderFunction: boolean) => number
+ totalListCount: (totalResultCount: number, totalExtraCount: number) => number
+ expandedCount: (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => number
+ results: (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[]
+ showSuggestedFiltersEmptyState: (
+ isSuggestedFilters: boolean,
+ trimmedSearchQuery: string,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[]
+ ) => boolean
+ rowCount: (
+ showNonCapturedEventOption: boolean,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[],
+ isLoading: boolean,
+ totalListCount: number,
+ showSuggestedFiltersEmptyState: boolean
+ ) => number
+ initialPinnedRowIndex: (
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ group: TaxonomicFilterGroup | undefined,
+ listGroupType: TaxonomicFilterGroupType,
+ groupType: any,
+ value: any,
+ isActiveTab: boolean
+ ) => number | null
+ selectedItem: (
+ index: number,
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => TaxonomicDefinitionTypes | undefined
+ selectedItemValue: (
+ selectedItem: TaxonomicDefinitionTypes | undefined,
+ group: TaxonomicFilterGroup | undefined
+ ) => number | string | null
+ selectedItemInView: (index: number, startIndex: number, stopIndex: number) => boolean
+ }
+}
+
+export type infiniteListLogicType = MakeLogicType<
+ infiniteListLogicValues,
+ infiniteListLogicActions,
+ InfiniteListLogicProps,
+ infiniteListLogicMeta
+>
+
export const infiniteListLogic = kea<infiniteListLogicType>([
props({ showNumericalPropsOnly: false, minSearchQueryLength: undefined } as InfiniteListLogicProps),
key((props) => `${props.taxonomicFilterLogicKey}-${props.listGroupType}`),
@@ -473,16 +1040,17 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
})),
selectors({
- listGroupType: [(_, p) => [p.listGroupType], (listGroupType) => listGroupType],
+ listGroupType: [(_, p) => [p.listGroupType], (listGroupType: TaxonomicFilterGroupType) => listGroupType],
isSuggestedFilters: [
(s) => [s.listGroupType],
(listGroupType: TaxonomicFilterGroupType): boolean =>
listGroupType === TaxonomicFilterGroupType.SuggestedFilters,
],
- trimmedSearchQuery: [(s) => [s.searchQuery], (searchQuery) => searchQuery.trim()],
+ trimmedSearchQuery: [(s) => [s.searchQuery], (searchQuery: string) => searchQuery.trim()],
isActiveTab: [
(s) => [s.listGroupType, s.activeTab],
- (listGroupType, activeTab): boolean => listGroupType === activeTab,
+ (listGroupType: TaxonomicFilterGroupType, activeTab: TaxonomicFilterGroupType): boolean =>
+ listGroupType === activeTab,
],
contextFilteredRecentItems: [
(s) => [
@@ -548,7 +1116,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
// the top of its own results instead (see `items`).
isSoleSubstantiveGroup: [
(s) => [s.listGroupType, s.taxonomicGroupTypes],
- (listGroupType, taxonomicGroupTypes: TaxonomicFilterGroupType[]): boolean => {
+ (listGroupType: TaxonomicFilterGroupType, taxonomicGroupTypes: TaxonomicFilterGroupType[]): boolean => {
const substantive = taxonomicGroupTypes.filter((t) => !META_GROUP_TYPES.has(t))
return substantive.length === 1 && substantive[0] === listGroupType
},
@@ -592,20 +1160,23 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
(isLocalDataLoading: boolean) => isLocalDataLoading,
],
- isLoading: [(s) => [s.remoteItemsLoading], (remoteItemsLoading) => remoteItemsLoading],
+ isLoading: [(s) => [s.remoteItemsLoading], (remoteItemsLoading: boolean) => remoteItemsLoading],
group: [
(s) => [s.listGroupType, s.taxonomicGroups],
- (listGroupType, taxonomicGroups): TaxonomicFilterGroup | undefined =>
- taxonomicGroups.find((g) => g.type === listGroupType),
+ (
+ listGroupType: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ): TaxonomicFilterGroup | undefined => taxonomicGroups.find((g) => g.type === listGroupType),
],
- remoteEndpoint: [(s) => [s.group], (group) => group?.endpoint || null],
+ remoteEndpoint: [(s) => [s.group], (group: TaxonomicFilterGroup | undefined) => group?.endpoint || null],
minSearchQueryLength: [
(s) => [s.group, (_, props) => props.minSearchQueryLength],
- (group, propsMinSearchQueryLength) => propsMinSearchQueryLength ?? group?.minSearchQueryLength ?? 0,
+ (group: TaxonomicFilterGroup | undefined, propsMinSearchQueryLength) =>
+ propsMinSearchQueryLength ?? group?.minSearchQueryLength ?? 0,
],
needsMoreSearchCharacters: [
(s) => [s.minSearchQueryLength, s.searchQuery],
- (minSearchQueryLength, searchQuery) => {
+ (minSearchQueryLength, searchQuery: string) => {
if (minSearchQueryLength <= 0) {
return false
}
@@ -613,13 +1184,16 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
return searchQuery.trim().length < minSearchQueryLength
},
],
- excludedProperties: [(s) => [s.group], (group) => group?.excludedProperties],
- propertyAllowList: [(s) => [s.group], (group) => group?.propertyAllowList],
- scopedRemoteEndpoint: [(s) => [s.group], (group) => group?.scopedEndpoint || null],
- hasRenderFunction: [(s) => [s.group], (group) => !!group?.render],
+ excludedProperties: [(s) => [s.group], (group: TaxonomicFilterGroup | undefined) => group?.excludedProperties],
+ propertyAllowList: [(s) => [s.group], (group: TaxonomicFilterGroup | undefined) => group?.propertyAllowList],
+ scopedRemoteEndpoint: [
+ (s) => [s.group],
+ (group: TaxonomicFilterGroup | undefined) => group?.scopedEndpoint || null,
+ ],
+ hasRenderFunction: [(s) => [s.group], (group: TaxonomicFilterGroup | undefined) => !!group?.render],
isExpandable: [
(s) => [s.remoteEndpoint, s.scopedRemoteEndpoint, s.remoteItems],
- (remoteEndpoint, scopedRemoteEndpoint, remoteItems) =>
+ (remoteEndpoint: string | null, scopedRemoteEndpoint: string | null, remoteItems: ListStorage) =>
!!(
remoteEndpoint &&
scopedRemoteEndpoint &&
@@ -629,9 +1203,10 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
isExpandableButtonSelected: [
(s) => [s.isExpandable, s.index, s.totalListCount],
- (isExpandable, index, totalListCount) => isExpandable && index === totalListCount - 1,
+ (isExpandable: boolean, index: number, totalListCount: number) =>
+ isExpandable && index === totalListCount - 1,
],
- hasRemoteDataSource: [(s) => [s.remoteEndpoint], (remoteEndpoint) => !!remoteEndpoint],
+ hasRemoteDataSource: [(s) => [s.remoteEndpoint], (remoteEndpoint: string | null) => !!remoteEndpoint],
remoteResultsAreFresh: [
(s) => [s.hasRemoteDataSource, s.remoteItems, s.searchQuery, s.remoteFetchFailed],
(
@@ -805,7 +1380,11 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
fuse: [
(s) => [s.rawLocalItems, s.taxonomicGroups, s.group],
- (rawLocalItems, taxonomicGroups, group): ListFuse => {
+ (
+ rawLocalItems: (CohortType | EventDefinition)[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ group: TaxonomicFilterGroup | undefined
+ ): ListFuse => {
// maps e.g. "selector" to its display value "CSS Selector"
// so a search of "css" matches something
function asPostHogName(
@@ -837,7 +1416,12 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
localItems: [
(s) => [s.rawLocalItems, s.searchQuery, s.fuse, s.group],
- (rawLocalItems, searchQuery, fuse, group): ListStorage => {
+ (
+ rawLocalItems: (CohortType | EventDefinition)[],
+ searchQuery: string,
+ fuse: ListFuse,
+ group: TaxonomicFilterGroup | undefined
+ ): ListStorage => {
if (!group) {
return createEmptyListStorage()
}
@@ -875,13 +1459,13 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
(_, props: InfiniteListLogicProps) => props.collapseUrlsToContainsRow,
],
(
- localItems,
- remoteItems,
- searchQuery,
- hasRemoteDataSource,
- keywordShortcutItems,
- listGroupType,
- collapseUrlsToContainsRow
+ localItems: ListStorage,
+ remoteItems: ListStorage,
+ searchQuery: string,
+ hasRemoteDataSource: boolean,
+ keywordShortcutItems: QuickFilterItem[],
+ listGroupType: TaxonomicFilterGroupType,
+ collapseUrlsToContainsRow: boolean | undefined
): TaxonomicDefinitionTypes[] => {
if (!searchQuery) {
return []
@@ -963,14 +1547,17 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
s.taxonomicGroups,
],
(
- topMatchItemsWithSkeletons,
- listGroupType,
- searchQuery,
- contextFilteredRecentItems,
- contextFilteredPinnedItems,
- suggestedRecentMatches,
- suggestedPinnedMatches,
- taxonomicGroups
+ topMatchItemsWithSkeletons: (
+ | SkeletonItem
+ | import('lib/components/TaxonomicFilter/taxonomicFilterLogic').TopMatchItem
+ )[],
+ listGroupType: TaxonomicFilterGroupType,
+ searchQuery: string,
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[],
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[],
+ suggestedRecentMatches: TaxonomicDefinitionTypes[],
+ suggestedPinnedMatches: TaxonomicDefinitionTypes[],
+ taxonomicGroups: TaxonomicFilterGroup[]
): (TaxonomicDefinitionTypes | SkeletonItem)[] => {
const isSuggested = listGroupType === TaxonomicFilterGroupType.SuggestedFilters
if (!isSuggested) {
@@ -1026,7 +1613,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
selectionPromotionContext: [
(s) => [s.group, s.groupType, s.value],
(
- group,
+ group: TaxonomicFilterGroup | undefined,
groupType,
value
): {
@@ -1054,21 +1641,25 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
(_, props: InfiniteListLogicProps) => props.collapseUrlsToContainsRow,
],
(
- remoteItems,
- localItems,
- listGroupType,
- dedupedTopMatches,
- searchQuery,
- contextFilteredRecentItems,
- contextFilteredPinnedItems,
- suggestedPinnedMatches,
- suggestedRecentMatches,
- keywordShortcutItems,
- isSoleSubstantiveGroup,
- soleGroupHasGetValue,
- taxonomicGroups,
- selectionPromotionContext,
- collapseUrlsToContainsRow
+ remoteItems: ListStorage,
+ localItems: ListStorage,
+ listGroupType: TaxonomicFilterGroupType,
+ dedupedTopMatches: (SkeletonItem | TaxonomicDefinitionTypes)[],
+ searchQuery: string,
+ contextFilteredRecentItems: TaxonomicDefinitionTypes[],
+ contextFilteredPinnedItems: TaxonomicDefinitionTypes[],
+ suggestedPinnedMatches: TaxonomicDefinitionTypes[],
+ suggestedRecentMatches: TaxonomicDefinitionTypes[],
+ keywordShortcutItems: QuickFilterItem[],
+ isSoleSubstantiveGroup: boolean,
+ soleGroupHasGetValue: boolean,
+ taxonomicGroups: TaxonomicFilterGroup[],
+ selectionPromotionContext: {
+ group: TaxonomicFilterGroup | undefined
+ groupType: TaxonomicFilterGroupType | undefined
+ value: TaxonomicFilterValue | undefined
+ },
+ collapseUrlsToContainsRow: boolean | undefined
) => {
const { group, groupType, value } = selectionPromotionContext
// Collapse URL groups to a single "URL contains <query>" shortcut row
@@ -1288,21 +1879,93 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
}
},
],
- totalResultCount: [(s) => [s.items], (items) => items.count || 0],
+ totalResultCount: [
+ (s) => [s.items],
+ (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => items.count || 0,
+ ],
totalExtraCount: [
(s) => [s.isExpandable, s.hasRenderFunction],
- (isExpandable, hasRenderFunction) => (isExpandable ? 1 : 0) + (hasRenderFunction ? 1 : 0),
+ (isExpandable: boolean, hasRenderFunction: boolean) => (isExpandable ? 1 : 0) + (hasRenderFunction ? 1 : 0),
],
totalListCount: [
(s) => [s.totalResultCount, s.totalExtraCount],
- (totalResultCount, totalExtraCount) => totalResultCount + totalExtraCount,
+ (totalResultCount: number, totalExtraCount: number) => totalResultCount + totalExtraCount,
+ ],
+ expandedCount: [
+ (s) => [s.items],
+ (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => items.expandedCount || 0,
+ ],
+ results: [
+ (s) => [s.items],
+ (
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ) => items.results,
],
- expandedCount: [(s) => [s.items], (items) => items.expandedCount || 0],
- results: [(s) => [s.items], (items) => items.results],
showSuggestedFiltersEmptyState: [
(s) => [s.isSuggestedFilters, s.trimmedSearchQuery, s.results],
- (isSuggestedFilters, trimmedSearchQuery, results): boolean =>
- isSuggestedFilters && !trimmedSearchQuery && results.length > 0,
+ (
+ isSuggestedFilters: boolean,
+ trimmedSearchQuery: string,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[]
+ ): boolean => isSuggestedFilters && !trimmedSearchQuery && results.length > 0,
],
rowCount: [
(s) => [
@@ -1312,7 +1975,13 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
s.totalListCount,
s.showSuggestedFiltersEmptyState,
],
- (showNonCapturedEventOption, results, isLoading, totalListCount, showSuggestedFiltersEmptyState): number =>
+ (
+ showNonCapturedEventOption: boolean,
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[],
+ isLoading: boolean,
+ totalListCount: number,
+ showSuggestedFiltersEmptyState: boolean
+ ): number =>
showNonCapturedEventOption
? 1
: Math.max(results.length || (isLoading ? 7 : 0), totalListCount || 0) +
@@ -1320,7 +1989,15 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
initialPinnedRowIndex: [
(s) => [s.results, s.taxonomicGroups, s.group, s.listGroupType, s.groupType, s.value, s.isActiveTab],
- (results, taxonomicGroups, group, listGroupType, groupType, value, isActiveTab): number | null =>
+ (
+ results: QuickFilterItem[] | (SkeletonItem | TaxonomicDefinitionTypes)[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ group: TaxonomicFilterGroup | undefined,
+ listGroupType: TaxonomicFilterGroupType,
+ groupType,
+ value,
+ isActiveTab: boolean
+ ): number | null =>
getInitialPinnedRowIndex({
results,
taxonomicGroups,
@@ -1333,7 +2010,28 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
selectedItem: [
(s) => [s.index, s.items],
- (index, items): TaxonomicDefinitionTypes | undefined => {
+ (
+ index: number,
+ items:
+ | {
+ count: number
+ expandedCount: number | undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: (SkeletonItem | TaxonomicDefinitionTypes)[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ | {
+ count: number
+ expandedCount?: undefined
+ first: boolean | undefined
+ queryChanged: boolean | undefined
+ results: QuickFilterItem[]
+ searchQuery: string | undefined
+ syntheticSelectedCount: number
+ }
+ ): TaxonomicDefinitionTypes | undefined => {
if (index < 0) {
return undefined
}
@@ -1346,11 +2044,13 @@ export const infiniteListLogic = kea<infiniteListLogicType>([
],
selectedItemValue: [
(s) => [s.selectedItem, s.group],
- (selectedItem, group) => (selectedItem ? group?.getValue?.(selectedItem) || null : null),
+ (selectedItem: TaxonomicDefinitionTypes | undefined, group: TaxonomicFilterGroup | undefined) =>
+ selectedItem ? group?.getValue?.(selectedItem) || null : null,
],
selectedItemInView: [
(s) => [s.index, s.startIndex, s.stopIndex],
- (index, startIndex, stopIndex) => typeof index === 'number' && index >= startIndex && index <= stopIndex,
+ (index: number, startIndex: number, stopIndex: number) =>
+ typeof index === 'number' && index >= startIndex && index <= stopIndex,
],
}),
listeners(({ values, actions, props, cache }) => ({
diff --git a/frontend/src/lib/components/TaxonomicFilter/recentTaxonomicFiltersLogic.ts b/frontend/src/lib/components/TaxonomicFilter/recentTaxonomicFiltersLogic.ts
index 617f907b8b74..d6edb43f97aa 100644
--- a/frontend/src/lib/components/TaxonomicFilter/recentTaxonomicFiltersLogic.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/recentTaxonomicFiltersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'
import { now } from 'lib/dayjs'
import { permanentlyMount } from 'lib/utils/kea-logic-builders'
@@ -6,7 +6,6 @@ import { isOperatorFlag } from 'lib/utils/operators'
import { AnyPropertyFilter } from '~/types'
-import type { recentTaxonomicFiltersLogicType } from './recentTaxonomicFiltersLogicType'
import {
isKeyOnlyForGroup,
META_GROUP_TYPES,
@@ -152,6 +151,50 @@ function isDuplicateRecentFilter(
const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.id
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentTaxonomicFiltersLogicValues {
+ recentFilterItems: TaxonomicDefinitionTypes[]
+ recentFilters: RecentTaxonomicFilter[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentTaxonomicFiltersLogicActions {
+ clearRecentFilters: () => {
+ value: true
+ }
+ recordRecentFilter: (payload: {
+ groupName: string
+ groupType: TaxonomicFilterGroupType
+ item: any
+ propertyFilter?: AnyPropertyFilter
+ selectingKeyOnly?: boolean
+ teamId?: number
+ value: TaxonomicFilterValue
+ }) => {
+ groupName: string
+ groupType: TaxonomicFilterGroupType
+ item: any
+ propertyFilter?: AnyPropertyFilter | undefined
+ selectingKeyOnly?: boolean | undefined
+ teamId?: number | undefined
+ value: TaxonomicFilterValue
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentTaxonomicFiltersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ recentFilterItems: (recentFilters: RecentTaxonomicFilter[]) => TaxonomicDefinitionTypes[]
+ }
+}
+
+export type recentTaxonomicFiltersLogicType = MakeLogicType<
+ recentTaxonomicFiltersLogicValues,
+ recentTaxonomicFiltersLogicActions,
+ Record<string, any>,
+ recentTaxonomicFiltersLogicMeta
+>
+
export const recentTaxonomicFiltersLogic = kea<recentTaxonomicFiltersLogicType>([
path(['lib', 'components', 'TaxonomicFilter', 'recentTaxonomicFiltersLogic']),
actions({
diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts
index 79f6c19ffde0..b92eca325093 100644
--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts
@@ -223,8 +223,14 @@ describe('taxonomicFilterLogic', () => {
// react-window new rowProps every render, which drives its layout-effect setState past React's
// update limit (error #185). This locks the reference in so that cascade cannot start.
const state = getContext().store.getState()
- const propsA = { ...logic.props, metadataSource: { kind: NodeKind.HogQLQuery, query: 'select 1' } }
- const propsB = { ...logic.props, metadataSource: { kind: NodeKind.HogQLQuery, query: 'select 1' } }
+ const propsA: TaxonomicFilterLogicProps = {
+ ...logic.props,
+ metadataSource: { kind: NodeKind.HogQLQuery, query: 'select 1' },
+ }
+ const propsB: TaxonomicFilterLogicProps = {
+ ...logic.props,
+ metadataSource: { kind: NodeKind.HogQLQuery, query: 'select 1' },
+ }
expect(propsA.metadataSource).not.toBe(propsB.metadataSource)
diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx
index 2acd6b7840f2..3f5cf9591f2b 100644
--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx
+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx
@@ -1,5 +1,6 @@
import clsx from 'clsx'
import {
+ MakeLogicType,
BuiltLogic,
actions,
afterMount,
@@ -24,7 +25,7 @@ import {
buildEventTypeFilterShortcuts,
} from 'lib/components/TaxonomicFilter/eventTypeShortcuts'
import { infiniteListLogic } from 'lib/components/TaxonomicFilter/infiniteListLogic'
-import { infiniteListLogicType } from 'lib/components/TaxonomicFilter/infiniteListLogicType'
+import type { infiniteListLogicType } from 'lib/components/TaxonomicFilter/infiniteListLogic'
import {
hasRecentContext,
recentTaxonomicFiltersLogic,
@@ -118,10 +119,14 @@ import {
import { joinsLogic } from 'products/data_warehouse/frontend/shared/logics/joinsLogic'
import { HogFlowTaxonomicFilters } from 'products/workflows/frontend/Workflows/hogflows/filters/HogFlowTaxonomicFilters'
+import type { Noun } from '../../../models/groupsModel'
+import type { DatabaseSchemaDataWarehouseTable } from '../../../queries/schema/schema-general'
+import type { GroupType, GroupTypeIndex, TeamPublicType } from '../../../types'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import { PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE } from '../PropertyFilters/utils'
import { InlineHogQLEditor } from './InlineHogQLEditor'
import { RECENT_PINNED_TAB_DEFINITIONS } from './recentPinnedTabDefinitions'
-import type { taxonomicFilterLogicType } from './taxonomicFilterLogicType'
+import type { TaxonomicFilterGroupValueMap } from './types'
const PROPERTY_TAXONOMIC_GROUP_TYPES = new Set(Object.values(PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE))
@@ -333,6 +338,311 @@ export const defaultDataWarehousePopoverFields: DataWarehousePopoverField[] = [
},
]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterLogicValues {
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[] // dataWarehouseSettingsSceneLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel
+ columnsJoinedToPersons: PropertyDefinition[] // joinsLogic
+ primaryProperties: Record<string, string> // primaryEventPropertiesModel
+ currentProjectId: number | null // projectLogic
+ eventMetadataPropertyDefinitions: PropertyDefinition[] // propertyDefinitionsModel
+ personMetadataPropertyDefinitions: PropertyDefinition[] // propertyDefinitionsModel
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ currentTeamId: number | null // teamLogic
+ activeTab: TaxonomicFilterGroupType
+ activeTaxonomicGroup: TaxonomicFilterGroup | undefined
+ allowNonCapturedEvents: boolean
+ anyGroupLoading: boolean
+ anyGroupStale: boolean
+ currentTabIndex: number
+ dataWarehousePopoverFields: any
+ endpointFilters: Record<string, any>
+ eventNames: any
+ eventNamesWithPrimaryProperties: {
+ eventNames: string[]
+ mcpExcludedEventProperties: string[]
+ primaryPropertiesForContextEvents: string[]
+ }
+ excludedProperties: TaxonomicFilterGroupValueMap
+ explicitActiveTab: TaxonomicFilterGroupType | null
+ groupAnalyticsTaxonomicGroupNames: TaxonomicFilterGroup[]
+ groupAnalyticsTaxonomicGroups: TaxonomicFilterGroup[]
+ groupType: any
+ hadInteraction: boolean
+ hideBehavioralCohorts: boolean
+ hogQLExpressionComponentProps: {
+ globals?: Record<string, any>
+ showBreakdownLabelHint: boolean
+ }
+ includeStaleEvents: boolean
+ infiniteListCounts: {
+ [k: string]: number
+ }
+ infiniteListLogics: Record<string, BuiltLogic<infiniteListLogicType>>
+ infiniteListResultCounts: {
+ [k: string]: number
+ }
+ loadingGroupTypes: TaxonomicFilterGroupType[]
+ maxContextOptions: any
+ metaGroupTypes: Set<string>
+ metadataPropertyDefinitionsByType: {
+ event: PropertyDefinition[]
+ person: PropertyDefinition[]
+ }
+ metadataSource: AnyDataNode
+ mouseInteractionsEnabled: boolean
+ propertyAllowList: TaxonomicFilterGroupValueMap | undefined
+ propertyFilters: {
+ excludedProperties: TaxonomicFilterGroupValueMap
+ propertyAllowList: TaxonomicFilterGroupValueMap | undefined
+ }
+ redistributedTopMatchItems: TopMatchItem[]
+ revealBarrierOpen: boolean
+ schemaColumns: any
+ searchPlaceholder: string
+ searchQuery: string
+ selectedItemMeta: any
+ selectedProperties: TaxonomicFilterGroupValueMap
+ showNumericalPropsOnly: any
+ suggestedFiltersLabel: any
+ taxonomicFilterLogicKey: string
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ taxonomicGroups: TaxonomicFilterGroup[]
+ topMatchItems: (TaxonomicDefinitionTypes & {
+ group: TaxonomicFilterGroupType
+ })[]
+ topMatchItemsWithSkeletons: (SkeletonItem | TopMatchItem)[]
+ value: any
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterLogicActions {
+ ensureLoadedForEvents: (eventNames: string[]) => {
+ eventNames: string[]
+ } // primaryEventPropertiesModel
+ appendTopMatches: (
+ items: (TaxonomicDefinitionTypes & {
+ group: TaxonomicFilterGroupType
+ })[]
+ ) => {
+ items: (TaxonomicDefinitionTypes & {
+ group: TaxonomicFilterGroupType
+ })[]
+ }
+ enableMouseInteractions: () => {
+ value: true
+ }
+ infiniteListResultsReceived: (
+ groupType: TaxonomicFilterGroupType,
+ results: ListStorage
+ ) => {
+ groupType: TaxonomicFilterGroupType
+ results: ListStorage
+ }
+ markUserInteraction: () => {
+ value: true
+ }
+ moveDown: () => {
+ value: true
+ }
+ moveUp: () => {
+ value: true
+ }
+ openRevealBarrier: () => {
+ value: true
+ }
+ recordPaste: (pastedLength: number) => {
+ pastedLength: number
+ }
+ selectItem: (
+ group: TaxonomicFilterGroup,
+ value: TaxonomicFilterValue | null,
+ item: any,
+ meta?: SelectItemMeta
+ ) => {
+ group: TaxonomicFilterGroup
+ item: any
+ meta: SelectItemMeta | undefined
+ value: TaxonomicFilterValue
+ }
+ selectSelected: () => {
+ value: true
+ }
+ setActiveTab: (activeTab: TaxonomicFilterGroupType) => {
+ activeTab: TaxonomicFilterGroupType
+ }
+ setIncludeStaleEvents: (includeStaleEvents: boolean) => {
+ includeStaleEvents: boolean
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+ tabLeft: () => {
+ value: true
+ }
+ tabRight: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ selectedItemMeta: (arg: any) => any
+ showNumericalPropsOnly: (arg: any) => any
+ taxonomicFilterLogicKey: (taxonomicFilterLogicKey: string) => string
+ eventNames: (arg: any) => any
+ eventNamesWithPrimaryProperties: (
+ eventNames: any,
+ primaryProperties: Record<string, string>,
+ arg: any
+ ) => {
+ eventNames: string[]
+ mcpExcludedEventProperties: string[]
+ primaryPropertiesForContextEvents: string[]
+ }
+ schemaColumns: (arg: any) => any
+ maxContextOptions: (arg: any) => any
+ dataWarehousePopoverFields: (arg: any) => any
+ suggestedFiltersLabel: (arg: any) => any
+ metadataSource: (arg: any) => AnyDataNode
+ excludedProperties: (arg: any) => TaxonomicFilterGroupValueMap
+ selectedProperties: (arg: any) => TaxonomicFilterGroupValueMap
+ propertyAllowList: (arg: any) => TaxonomicFilterGroupValueMap | undefined
+ propertyFilters: (
+ excludedProperties: TaxonomicFilterGroupValueMap,
+ propertyAllowList: TaxonomicFilterGroupValueMap | undefined
+ ) => {
+ excludedProperties: TaxonomicFilterGroupValueMap
+ propertyAllowList: TaxonomicFilterGroupValueMap | undefined
+ }
+ allowNonCapturedEvents: (arg: any) => boolean
+ hideBehavioralCohorts: (arg: any) => boolean
+ hogQLExpressionComponentProps: (
+ arg: any,
+ arg2: any
+ ) => {
+ globals?: Record<string, any>
+ showBreakdownLabelHint: boolean
+ }
+ endpointFilters: (arg: any) => Record<string, any>
+ metadataPropertyDefinitionsByType: (
+ eventMetadataPropertyDefinitions: PropertyDefinition[],
+ personMetadataPropertyDefinitions: PropertyDefinition[]
+ ) => {
+ event: PropertyDefinition[]
+ person: PropertyDefinition[]
+ }
+ taxonomicGroups: (
+ currentTeam: TeamPublicType | TeamType | null,
+ currentProjectId: number | null,
+ groupAnalyticsTaxonomicGroups: TaxonomicFilterGroup[],
+ groupAnalyticsTaxonomicGroupNames: TaxonomicFilterGroup[],
+ eventNamesWithPrimaryProperties: {
+ eventNames: string[]
+ mcpExcludedEventProperties: string[]
+ primaryPropertiesForContextEvents: string[]
+ },
+ schemaColumns: any,
+ arg: any,
+ metadataSource: AnyDataNode,
+ suggestedFiltersLabel: any,
+ propertyFilters: {
+ excludedProperties: TaxonomicFilterGroupValueMap
+ propertyAllowList: TaxonomicFilterGroupValueMap | undefined
+ },
+ metadataPropertyDefinitionsByType: {
+ event: PropertyDefinition[]
+ person: PropertyDefinition[]
+ },
+ maxContextOptions: any,
+ hideBehavioralCohorts: boolean,
+ endpointFilters: Record<string, any>,
+ hogQLExpressionComponentProps: {
+ globals?: Record<string, any>
+ showBreakdownLabelHint: boolean
+ },
+ featureFlags: FeatureFlagsSet
+ ) => TaxonomicFilterGroup[]
+ activeTaxonomicGroup: (
+ activeTab: TaxonomicFilterGroupType,
+ taxonomicGroups: TaxonomicFilterGroup[]
+ ) => TaxonomicFilterGroup | undefined
+ metaGroupTypes: (taxonomicGroups: TaxonomicFilterGroup[]) => Set<string>
+ taxonomicGroupTypes: (
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ eventNames: any,
+ featureFlags: FeatureFlagsSet
+ ) => TaxonomicFilterGroupType[]
+ groupAnalyticsTaxonomicGroupNames: (
+ groupTypes: Map<GroupTypeIndex, GroupType>,
+ currentTeamId: number | null,
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun
+ ) => TaxonomicFilterGroup[]
+ groupAnalyticsTaxonomicGroups: (
+ groupTypes: Map<GroupTypeIndex, GroupType>,
+ currentProjectId: number | null,
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun
+ ) => TaxonomicFilterGroup[]
+ infiniteListLogics: (
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ arg: any
+ ) => Record<string, BuiltLogic<infiniteListLogicType>>
+ anyGroupLoading: (arg: boolean) => boolean
+ anyGroupStale: (arg: boolean) => boolean
+ loadingGroupTypes: (arg: string) => TaxonomicFilterGroupType[]
+ infiniteListCounts: (arg: { [k: string]: number }) => {
+ [k: string]: number
+ }
+ infiniteListResultCounts: (arg: { [k: string]: number }) => {
+ [k: string]: number
+ }
+ value: (arg: any) => any
+ groupType: (arg: any) => any
+ activeTab: (
+ explicitActiveTab: TaxonomicFilterGroupType | null,
+ groupType: any,
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ metaGroupTypes: Set<string>
+ ) => TaxonomicFilterGroupType
+ currentTabIndex: (
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ activeTab: TaxonomicFilterGroupType
+ ) => number
+ searchPlaceholder: (
+ taxonomicGroups: TaxonomicFilterGroup[],
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ ) => string
+ redistributedTopMatchItems: (
+ topMatchItems: (TaxonomicDefinitionTypes & {
+ group: TaxonomicFilterGroupType
+ })[],
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ metaGroupTypes: Set<string>
+ ) => TopMatchItem[]
+ topMatchItemsWithSkeletons: (
+ redistributedTopMatchItems: TopMatchItem[],
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ loadingGroupTypes: TaxonomicFilterGroupType[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ searchQuery: string,
+ metaGroupTypes: Set<string>,
+ revealBarrierOpen: boolean
+ ) => (SkeletonItem | TopMatchItem)[]
+ }
+}
+
+export type taxonomicFilterLogicType = MakeLogicType<
+ taxonomicFilterLogicValues,
+ taxonomicFilterLogicActions,
+ TaxonomicFilterLogicProps,
+ taxonomicFilterLogicMeta
+>
+
export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
props({} as TaxonomicFilterLogicProps),
key((props) => `${props.taxonomicFilterLogicKey}`),
@@ -482,7 +792,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
taxonomicFilterLogicKey: [
(_, p) => [p.taxonomicFilterLogicKey],
- (taxonomicFilterLogicKey) => taxonomicFilterLogicKey,
+ (taxonomicFilterLogicKey: string) => taxonomicFilterLogicKey,
],
// Prop-derived reference selectors below carry `resultEqualityCheck: objectsEqual` so that a
// consumer passing an equal-but-freshly-allocated object/array prop on every render does not
@@ -564,7 +874,12 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
propertyFilters: [
(s) => [s.excludedProperties, s.propertyAllowList],
- (excludedProperties, propertyAllowList) => ({ excludedProperties, propertyAllowList }),
+ (
+ excludedProperties: import('lib/components/TaxonomicFilter/types').TaxonomicFilterGroupValueMap,
+ propertyAllowList:
+ | import('lib/components/TaxonomicFilter/types').TaxonomicFilterGroupValueMap
+ | undefined
+ ) => ({ excludedProperties, propertyAllowList }),
{ resultEqualityCheck: objectsEqual },
],
allowNonCapturedEvents: [
@@ -633,7 +948,12 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
schemaColumnsLoading: boolean | undefined,
metadataSource: AnyDataNode,
suggestedFiltersLabel: string | undefined,
- propertyFilters,
+ propertyFilters: {
+ excludedProperties: import('lib/components/TaxonomicFilter/types').TaxonomicFilterGroupValueMap
+ propertyAllowList:
+ | import('lib/components/TaxonomicFilter/types').TaxonomicFilterGroupValueMap
+ | undefined
+ },
{
event: eventMetadataPropertyDefinitions,
person: personMetadataPropertyDefinitions,
@@ -1607,7 +1927,8 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
activeTaxonomicGroup: [
(s) => [s.activeTab, s.taxonomicGroups],
- (activeTab, taxonomicGroups) => taxonomicGroups.find((g) => g.type === activeTab),
+ (activeTab: TaxonomicFilterGroupType, taxonomicGroups: TaxonomicFilterGroup[]) =>
+ taxonomicGroups.find((g) => g.type === activeTab),
],
metaGroupTypes: [
(s) => [s.taxonomicGroups],
@@ -1616,7 +1937,12 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
taxonomicGroupTypes: [
(s, p) => [p.taxonomicGroupTypes, s.taxonomicGroups, s.eventNames, s.featureFlags],
- (groupTypes, taxonomicGroups, eventNames, featureFlags): TaxonomicFilterGroupType[] => {
+ (
+ groupTypes: TaxonomicFilterGroupType[],
+ taxonomicGroups: TaxonomicFilterGroup[],
+ eventNames,
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): TaxonomicFilterGroupType[] => {
const availableGroupTypes = new Set(taxonomicGroups.map((group) => group.type))
const resolvedGroupTypes: TaxonomicFilterGroupType[] =
groupTypes || taxonomicGroups.map((group) => group.type)
@@ -1721,7 +2047,14 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
groupAnalyticsTaxonomicGroupNames: [
(s) => [s.groupTypes, s.currentTeamId, s.aggregationLabel],
- (groupTypes, teamId, aggregationLabel): TaxonomicFilterGroup[] =>
+ (
+ groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,
+ teamId: number | null,
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun
+ ): TaxonomicFilterGroup[] =>
Array.from(groupTypes.values()).map((type) => ({
name: `${capitalizeFirstLetter(aggregationLabel(type.group_type_index).plural)}`,
searchPlaceholder: `${aggregationLabel(type.group_type_index).plural}`,
@@ -1737,7 +2070,14 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
groupAnalyticsTaxonomicGroups: [
(s) => [s.groupTypes, s.currentProjectId, s.aggregationLabel],
- (groupTypes, projectId, aggregationLabel): TaxonomicFilterGroup[] =>
+ (
+ groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,
+ projectId: number | null,
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun
+ ): TaxonomicFilterGroup[] =>
Array.from(groupTypes.values()).map((type) => ({
name: `${capitalizeFirstLetter(aggregationLabel(type.group_type_index).singular)} properties`,
searchPlaceholder: `${aggregationLabel(type.group_type_index).singular} properties`,
@@ -1762,7 +2102,10 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
infiniteListLogics: [
(s) => [s.taxonomicGroupTypes, (_, props) => props],
- (taxonomicGroupTypes, props): Record<string, BuiltLogic<infiniteListLogicType>> =>
+ (
+ taxonomicGroupTypes: TaxonomicFilterGroupType[],
+ props
+ ): Record<string, BuiltLogic<infiniteListLogicType>> =>
Object.fromEntries(
taxonomicGroupTypes.map((groupType) => [
groupType,
@@ -1835,7 +2178,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
])
),
],
- (infiniteListCounts) => infiniteListCounts,
+ (infiniteListCounts: { [k: string]: number }) => infiniteListCounts,
{ resultEqualityCheck: objectsEqual },
],
// Like `infiniteListCounts` but counts only genuine search results (`totalResultCount`),
@@ -1852,14 +2195,19 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
])
),
],
- (infiniteListResultCounts) => infiniteListResultCounts,
+ (infiniteListResultCounts: { [k: string]: number }) => infiniteListResultCounts,
{ resultEqualityCheck: objectsEqual },
],
value: [() => [(_, props) => props.value], (value) => value],
groupType: [() => [(_, props) => props.groupType], (groupType) => groupType],
activeTab: [
(s) => [s.explicitActiveTab, s.groupType, s.taxonomicGroupTypes, s.metaGroupTypes],
- (explicitActiveTab, propsGroupType, groupTypes, metaGroupTypes): TaxonomicFilterGroupType => {
+ (
+ explicitActiveTab: TaxonomicFilterGroupType | null,
+ propsGroupType,
+ groupTypes: TaxonomicFilterGroupType[],
+ metaGroupTypes: Set<string>
+ ): TaxonomicFilterGroupType => {
if (explicitActiveTab && groupTypes.includes(explicitActiveTab)) {
return explicitActiveTab
}
@@ -1887,11 +2235,12 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
],
currentTabIndex: [
(s) => [s.taxonomicGroupTypes, s.activeTab],
- (groupTypes, activeTab) => Math.max(groupTypes.indexOf(activeTab || ''), 0),
+ (groupTypes: TaxonomicFilterGroupType[], activeTab: TaxonomicFilterGroupType) =>
+ Math.max(groupTypes.indexOf(activeTab || ''), 0),
],
searchPlaceholder: [
(s) => [s.taxonomicGroups, s.taxonomicGroupTypes],
- (allTaxonomicGroups, searchGroupTypes) => {
+ (allTaxonomicGroups: TaxonomicFilterGroup[], searchGroupTypes: TaxonomicFilterGroupType[]) => {
if (searchGroupTypes.length > 1) {
searchGroupTypes = searchGroupTypes.filter(
(type) =>
diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterPinnedPropertiesLogic.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterPinnedPropertiesLogic.ts
index b3dd509f9bff..c1bb41b73cef 100644
--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterPinnedPropertiesLogic.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterPinnedPropertiesLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import posthog from 'posthog-js'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -6,7 +6,7 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { getAppContext } from 'lib/utils/getAppContext'
import { permanentlyMount } from 'lib/utils/kea-logic-builders'
-import type { taxonomicFilterPinnedPropertiesLogicType } from './taxonomicFilterPinnedPropertiesLogicType'
+import type { FeatureFlagsSet } from '../../logic/featureFlagLogic'
import { META_GROUP_TYPES, TaxonomicDefinitionTypes, TaxonomicFilterGroupType, TaxonomicFilterValue } from './types'
export interface PinnedTaxonomicFilter {
@@ -130,6 +130,52 @@ function writeSeededDefaultsState(state: SeededDefaultsState): void {
localStorage.setItem(DEFAULTS_SEEDED_KEY, JSON.stringify(state))
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterPinnedPropertiesLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ isPinned: (groupType: TaxonomicFilterGroupType, value: TaxonomicFilterValue) => boolean
+ pinnedFilterItems: TaxonomicDefinitionTypes[]
+ pinnedFilters: PinnedTaxonomicFilter[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterPinnedPropertiesLogicActions {
+ clearPinnedFilters: () => {
+ value: true
+ }
+ setPinnedFilters: (filters: PinnedTaxonomicFilter[]) => {
+ filters: PinnedTaxonomicFilter[]
+ }
+ togglePin: (
+ groupType: TaxonomicFilterGroupType,
+ groupName: string,
+ value: TaxonomicFilterValue,
+ item: any
+ ) => {
+ groupName: string
+ groupType: TaxonomicFilterGroupType
+ item: any
+ value: TaxonomicFilterValue
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicFilterPinnedPropertiesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ pinnedFilterItems: (pinnedFilters: PinnedTaxonomicFilter[]) => TaxonomicDefinitionTypes[]
+ isPinned: (
+ pinnedFilters: PinnedTaxonomicFilter[]
+ ) => (groupType: TaxonomicFilterGroupType, value: TaxonomicFilterValue) => boolean
+ }
+}
+
+export type taxonomicFilterPinnedPropertiesLogicType = MakeLogicType<
+ taxonomicFilterPinnedPropertiesLogicValues,
+ taxonomicFilterPinnedPropertiesLogicActions,
+ Record<string, any>,
+ taxonomicFilterPinnedPropertiesLogicMeta
+>
+
export const taxonomicFilterPinnedPropertiesLogic = kea<taxonomicFilterPinnedPropertiesLogicType>([
path(['lib', 'components', 'TaxonomicFilter', 'taxonomicFilterPinnedPropertiesLogic']),
connect(() => ({
diff --git a/frontend/src/lib/components/TaxonomicPopover/taxonomicMenuPreferenceLogic.ts b/frontend/src/lib/components/TaxonomicPopover/taxonomicMenuPreferenceLogic.ts
index bc2e898b23d9..80aad75337f9 100644
--- a/frontend/src/lib/components/TaxonomicPopover/taxonomicMenuPreferenceLogic.ts
+++ b/frontend/src/lib/components/TaxonomicPopover/taxonomicMenuPreferenceLogic.ts
@@ -1,7 +1,22 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import posthog from 'posthog-js'
-import type { taxonomicMenuPreferenceLogicType } from './taxonomicMenuPreferenceLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicMenuPreferenceLogicValues {
+ useNewMenu: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taxonomicMenuPreferenceLogicActions {
+ setUseNewMenu: (useNewMenu: boolean) => {
+ useNewMenu: boolean
+ }
+}
+
+export type taxonomicMenuPreferenceLogicType = MakeLogicType<
+ taxonomicMenuPreferenceLogicValues,
+ taxonomicMenuPreferenceLogicActions
+>
/**
* Global, persisted preference for which taxonomic filter UI to render
diff --git a/frontend/src/lib/components/TimeSensitiveAuthentication/modalInterruptionTrackingLogic.ts b/frontend/src/lib/components/TimeSensitiveAuthentication/modalInterruptionTrackingLogic.ts
index 416bd82e4ca9..c1aa81734634 100644
--- a/frontend/src/lib/components/TimeSensitiveAuthentication/modalInterruptionTrackingLogic.ts
+++ b/frontend/src/lib/components/TimeSensitiveAuthentication/modalInterruptionTrackingLogic.ts
@@ -1,10 +1,31 @@
-import { actions, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers } from 'kea'
import { globalModalsLogic } from '~/layout/globalModalsLogic'
import { organizationLogic } from '~/scenes/organizationLogic'
import { projectLogic } from '~/scenes/projectLogic'
-import type { modalInterruptionTrackingLogicType } from './modalInterruptionTrackingLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface modalInterruptionTrackingLogicValues {
+ isCreateOrganizationModalShown: boolean // globalModalsLogic
+ isCreateProjectModalShown: boolean // globalModalsLogic
+ interruptedForm: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface modalInterruptionTrackingLogicActions {
+ createOrganization: (name: string) => string // organizationLogic
+ createProject: ({ name }: { name: string }) => {
+ name: string
+ } // projectLogic
+ setInterruptedForm: (form: string | null) => {
+ form: string | null
+ }
+}
+
+export type modalInterruptionTrackingLogicType = MakeLogicType<
+ modalInterruptionTrackingLogicValues,
+ modalInterruptionTrackingLogicActions
+>
export const modalInterruptionTrackingLogic = kea<modalInterruptionTrackingLogicType>([
path(['lib', 'components', 'TimeSensitiveAuthentication', 'modalInterruptionTrackingLogic']),
diff --git a/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts b/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
index 637e9a6a5dfa..aada91e2504d 100644
--- a/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
+++ b/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
@@ -3,8 +3,9 @@ import {
type UserVerificationRequirement,
startAuthentication,
} from '@simplewebauthn/browser'
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -15,8 +16,8 @@ import { apiStatusLogic } from 'lib/logic/apiStatusLogic'
import { PrecheckResponseType } from 'scenes/authentication/login/loginLogic'
import { userLogic } from 'scenes/userLogic'
+import type { UserType } from '../../../types'
import { modalInterruptionTrackingLogic } from './modalInterruptionTrackingLogic'
-import type { timeSensitiveAuthenticationLogicType } from './timeSensitiveAuthenticationLogicType'
export interface ReauthenticationForm {
password: string
@@ -30,6 +31,168 @@ export interface TwoFAMethodsResponse {
const LOOKAHEAD_EXPIRY_SECONDS = 60 * 5
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface timeSensitiveAuthenticationLogicValues {
+ timeSensitiveAuthenticationRequired: boolean | [onSuccess: () => void, onFailure: () => void] // apiStatusLogic
+ interruptedForm: string | null // modalInterruptionTrackingLogic
+ user: UserType | null // userLogic
+ dismissedReauthentication: boolean
+ isReauthenticationSubmitting: boolean
+ isReauthenticationValid: boolean
+ passkey2FA: null
+ passkey2FALoading: boolean
+ passkeysAvailable: boolean
+ passkeysAvailableLoading: boolean
+ precheckResponse: PrecheckResponseType | null
+ precheckResponseLoading: boolean
+ reauthentication: ReauthenticationForm
+ reauthenticationAllErrors: Record<string, any>
+ reauthenticationChanged: boolean
+ reauthenticationErrors: DeepPartialMap<ReauthenticationForm, ValidationErrorType>
+ reauthenticationHasErrors: boolean
+ reauthenticationManualErrors: Record<string, any>
+ reauthenticationTouched: boolean
+ reauthenticationTouches: Record<string, boolean>
+ reauthenticationValidationErrors: DeepPartialMap<ReauthenticationForm, ValidationErrorType>
+ sensitiveSessionExpiresAt: Dayjs
+ showAuthenticationModal: boolean
+ showReauthenticationErrors: boolean
+ totpAvailable: boolean
+ twoFactorRequired: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface timeSensitiveAuthenticationLogicActions {
+ setTimeSensitiveAuthenticationRequired: (required: boolean | [onSuccess: () => void, onFailure: () => void]) => {
+ required: boolean | [onSuccess: () => void, onFailure: () => void]
+ } // apiStatusLogic
+ loadUser: (resetOnFailure?: boolean) => {
+ resetOnFailure: boolean | undefined
+ } // userLogic
+ beginPasskey2FA: () => {
+ value: true
+ }
+ beginPasskey2FAFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ beginPasskey2FASuccess: (
+ passkey2FA: null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ passkey2FA: null
+ payload?: {
+ value: true
+ }
+ }
+ checkPasskeysAvailable: () => {
+ value: true
+ }
+ checkPasskeysAvailableFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ checkPasskeysAvailableSuccess: (
+ passkeysAvailable: boolean,
+ payload?: {
+ value: true
+ }
+ ) => {
+ passkeysAvailable: boolean
+ payload?: {
+ value: true
+ }
+ }
+ checkReauthentication: () => {
+ value: true
+ }
+ precheck: () => any
+ precheckFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ precheckSuccess: (
+ precheckResponse: PrecheckResponseType | null,
+ payload?: any
+ ) => {
+ precheckResponse: PrecheckResponseType | null
+ payload?: any
+ }
+ resetReauthentication: (values?: ReauthenticationForm) => {
+ values?: ReauthenticationForm
+ }
+ setDismissedReauthentication: (value: boolean) => {
+ value: boolean
+ }
+ setReauthenticationManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setReauthenticationValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setReauthenticationValues: (values: DeepPartial<ReauthenticationForm>) => {
+ values: DeepPartial<ReauthenticationForm>
+ }
+ setRequiresTwoFactor: (value: boolean) => {
+ value: boolean
+ }
+ setTotpAvailable: (available: boolean) => {
+ available: boolean
+ }
+ submitReauthentication: () => {
+ value: boolean
+ }
+ submitReauthenticationFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitReauthenticationRequest: (reauthentication: ReauthenticationForm) => {
+ reauthentication: ReauthenticationForm
+ }
+ submitReauthenticationSuccess: (reauthentication: ReauthenticationForm) => {
+ reauthentication: ReauthenticationForm
+ }
+ touchReauthenticationField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface timeSensitiveAuthenticationLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ showAuthenticationModal: (
+ timeSensitiveAuthenticationRequired: boolean | [onSuccess: () => void, onFailure: () => void],
+ dismissedReauthentication: boolean
+ ) => boolean
+ sensitiveSessionExpiresAt: (user: UserType | null) => Dayjs
+ }
+}
+
+export type timeSensitiveAuthenticationLogicType = MakeLogicType<
+ timeSensitiveAuthenticationLogicValues,
+ timeSensitiveAuthenticationLogicActions,
+ Record<string, any>,
+ timeSensitiveAuthenticationLogicMeta
+>
+
export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationLogicType>([
path(['lib', 'components', 'timeSensitiveAuthenticationLogic']),
connect(() => ({
@@ -174,14 +337,17 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
selectors({
showAuthenticationModal: [
(s) => [s.timeSensitiveAuthenticationRequired, s.dismissedReauthentication],
- (timeSensitiveAuthenticationRequired, dismissedReauthentication): boolean => {
+ (
+ timeSensitiveAuthenticationRequired: boolean | [onSuccess: () => void, onFailure: () => void],
+ dismissedReauthentication: boolean
+ ): boolean => {
return !!timeSensitiveAuthenticationRequired && !dismissedReauthentication
},
],
sensitiveSessionExpiresAt: [
(s) => [s.user],
- (user): Dayjs => {
+ (user: null | import('../../../types').UserType): Dayjs => {
return dayjs(user?.sensitive_session_expires_at)
},
],
diff --git a/frontend/src/lib/components/UnitPicker/unitPickerModalLogic.ts b/frontend/src/lib/components/UnitPicker/unitPickerModalLogic.ts
index 0f5c34d7342f..917406d9fb2a 100644
--- a/frontend/src/lib/components/UnitPicker/unitPickerModalLogic.ts
+++ b/frontend/src/lib/components/UnitPicker/unitPickerModalLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
-
-import type { unitPickerModalLogicType } from './unitPickerModalLogicType'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
export interface CustomUnitModalData {
type: 'prefix' | 'postfix'
@@ -20,6 +18,27 @@ export interface UnitPickerModalLogicType {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface unitPickerModalLogicValues {
+ customUnitModalData: CustomUnitModalData | null
+ isCustomUnitModalOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface unitPickerModalLogicActions {
+ applyCustomUnit: (value: string) => {
+ value: string
+ }
+ hideCustomUnitModal: () => {
+ value: true
+ }
+ showCustomUnitModal: (data: CustomUnitModalData) => {
+ data: CustomUnitModalData
+ }
+}
+
+export type unitPickerModalLogicType = MakeLogicType<unitPickerModalLogicValues, unitPickerModalLogicActions>
+
export const unitPickerModalLogic = kea<unitPickerModalLogicType>([
path(['lib', 'components', 'UnitPicker', 'unitPickerModalLogic']),
actions({
diff --git a/frontend/src/lib/components/UniversalFilters/universalFiltersLogic.ts b/frontend/src/lib/components/UniversalFilters/universalFiltersLogic.ts
index e333eddc1850..1330d0d1da35 100644
--- a/frontend/src/lib/components/UniversalFilters/universalFiltersLogic.ts
+++ b/frontend/src/lib/components/UniversalFilters/universalFiltersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import {
createDefaultPropertyFilter,
@@ -29,6 +29,7 @@ import {
UniversalFiltersGroupValue,
} from '~/types'
+import type { PropertyDefinitionType, PropertyType } from '../../../types'
import {
TaxonomicFilterGroup,
TaxonomicFilterGroupType,
@@ -37,7 +38,6 @@ import {
quickFilterToPropertyFilters,
} from '../TaxonomicFilter/types'
import { DEFAULT_UNIVERSAL_GROUP_FILTER } from './constants'
-import type { universalFiltersLogicType } from './universalFiltersLogicType'
function isApplicableSavedFilter(
item: unknown
@@ -91,6 +91,84 @@ export type UniversalFiltersLogicProps = {
endpointFilters?: Record<string, any>
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface universalFiltersLogicValues {
+ describeProperty: (
+ s: TaxonomicFilterValue,
+ type: PropertyDefinitionType,
+ groupTypeIndex?: number
+ ) => PropertyType | null // propertyDefinitionsModel
+ endpointFilters: Record<string, any> | undefined
+ filterGroup: UniversalFiltersGroup
+ rootKey: string
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ taxonomicPropertyFilterGroupTypes: TaxonomicFilterGroupType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface universalFiltersLogicActions {
+ addFilterGroup: () => {
+ value: true
+ }
+ addGroupFilter: (
+ taxonomicGroup: TaxonomicFilterGroup,
+ propertyKey: TaxonomicFilterValue,
+ item: {
+ key?: string
+ matchedOn?: string
+ matchedValue?: string
+ name?: string
+ propertyFilterType?: PropertyFilterType
+ }
+ ) => {
+ item: {
+ key?: string | undefined
+ matchedOn?: string | undefined
+ matchedValue?: string | undefined
+ name?: string | undefined
+ propertyFilterType?: PropertyFilterType | undefined
+ }
+ propertyKey: TaxonomicFilterValue
+ taxonomicGroup: TaxonomicFilterGroup
+ }
+ removeGroupValue: (index: number) => {
+ index: number
+ }
+ replaceGroupValue: (
+ index: number,
+ value: UniversalFiltersGroupValue
+ ) => {
+ index: number
+ value: UniversalFiltersGroupValue
+ }
+ setGroupType: (type: FilterLogicalOperator) => {
+ type: FilterLogicalOperator
+ }
+ setGroupValues: (newValues: UniversalFiltersGroupValue[]) => {
+ newValues: UniversalFiltersGroupValue[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface universalFiltersLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ rootKey: (rootKey: string) => string
+ taxonomicGroupTypes: (taxonomicGroupTypes: TaxonomicFilterGroupType[]) => TaxonomicFilterGroupType[]
+ endpointFilters: (arg: Record<string, any> | undefined) => Record<string, any> | undefined
+ taxonomicPropertyFilterGroupTypes: (
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+ ) => TaxonomicFilterGroupType[]
+ }
+}
+
+export type universalFiltersLogicType = MakeLogicType<
+ universalFiltersLogicValues,
+ universalFiltersLogicActions,
+ UniversalFiltersLogicProps,
+ universalFiltersLogicMeta
+>
+
export const universalFiltersLogic = kea<universalFiltersLogicType>([
path((key) => ['lib', 'components', 'UniversalFilters', 'universalFiltersLogic', key]),
props({ endpointFilters: {} } as UniversalFiltersLogicProps),
@@ -155,15 +233,15 @@ export const universalFiltersLogic = kea<universalFiltersLogicType>([
})),
selectors({
- rootKey: [(_, p) => [p.rootKey], (rootKey) => rootKey],
- taxonomicGroupTypes: [(_, p) => [p.taxonomicGroupTypes], (types) => types],
+ rootKey: [(_, p) => [p.rootKey], (rootKey: string) => rootKey],
+ taxonomicGroupTypes: [(_, p) => [p.taxonomicGroupTypes], (types: TaxonomicFilterGroupType[]) => types],
endpointFilters: [
(_, p) => [p.endpointFilters || (() => undefined)],
(endpointFilters?: Record<string, any>) => endpointFilters,
],
taxonomicPropertyFilterGroupTypes: [
(_, p) => [p.taxonomicGroupTypes],
- (types) => types.filter(isPropertyEditableTaxonomicGroupType),
+ (types: TaxonomicFilterGroupType[]) => types.filter(isPropertyEditableTaxonomicGroupType),
],
}),
diff --git a/frontend/src/lib/components/UpgradeModal/upgradeModalLogic.ts b/frontend/src/lib/components/UpgradeModal/upgradeModalLogic.ts
index b46806db446a..90a98c29fc94 100644
--- a/frontend/src/lib/components/UpgradeModal/upgradeModalLogic.ts
+++ b/frontend/src/lib/components/UpgradeModal/upgradeModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { preflightLogic } from 'lib/logic/preflightLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
@@ -7,7 +7,7 @@ import { userLogic } from 'scenes/userLogic'
import { AvailableFeature } from '~/types'
-import type { upgradeModalLogicType } from './upgradeModalLogicType'
+import type { BillingFeatureType, BillingType, PreflightStatus } from '../../../types'
export type GuardAvailableFeatureFn = (
featureKey?: AvailableFeature,
@@ -20,6 +20,58 @@ export type GuardAvailableFeatureFn = (
}
) => boolean
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface upgradeModalLogicValues {
+ billing: BillingType | null // billingLogic
+ preflight: PreflightStatus | null // preflightLogic
+ availableFeature: (feature: AvailableFeature) => BillingFeatureType | null | undefined // userLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ guardAvailableFeature: GuardAvailableFeatureFn
+ projectLimit: number
+ shouldShowPlatformAddonMessage: boolean
+ upgradeModalFeatureKey: AvailableFeature | null
+ upgradeModalFeatureUsage: number | null
+ upgradeModalIsGrandfathered: boolean | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface upgradeModalLogicActions {
+ hideUpgradeModal: () => {
+ value: true
+ }
+ showUpgradeModal: (
+ featureKey: AvailableFeature,
+ currentUsage?: number,
+ isGrandfathered?: boolean
+ ) => {
+ currentUsage: number | undefined
+ featureKey: AvailableFeature
+ isGrandfathered: boolean | undefined
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface upgradeModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ projectLimit: (availableFeature: (feature: AvailableFeature) => BillingFeatureType | null | undefined) => number
+ shouldShowPlatformAddonMessage: (
+ upgradeModalFeatureKey: AvailableFeature | null,
+ billing: BillingType | null
+ ) => boolean
+ guardAvailableFeature: (
+ preflight: PreflightStatus | null,
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => GuardAvailableFeatureFn
+ }
+}
+
+export type upgradeModalLogicType = MakeLogicType<
+ upgradeModalLogicValues,
+ upgradeModalLogicActions,
+ Record<string, any>,
+ upgradeModalLogicMeta
+>
+
export const upgradeModalLogic = kea<upgradeModalLogicType>([
path(['lib', 'components', 'UpgradeModal', 'upgradeModalLogic']),
connect(() => ({
@@ -66,11 +118,13 @@ export const upgradeModalLogic = kea<upgradeModalLogicType>([
selectors(({ actions }) => ({
projectLimit: [
(s) => [s.availableFeature],
- (availableFeature) => availableFeature(AvailableFeature.ORGANIZATIONS_PROJECTS)?.limit ?? 6,
+ (
+ availableFeature: (feature: AvailableFeature) => null | import('~/types').BillingFeatureType | undefined
+ ) => availableFeature(AvailableFeature.ORGANIZATIONS_PROJECTS)?.limit ?? 6,
],
shouldShowPlatformAddonMessage: [
(s) => [s.upgradeModalFeatureKey, s.billing],
- (upgradeModalFeatureKey, billing) => {
+ (upgradeModalFeatureKey: AvailableFeature | null, billing: null | import('~/types').BillingType) => {
if (upgradeModalFeatureKey !== AvailableFeature.ORGANIZATIONS_PROJECTS) {
return false
}
@@ -85,7 +139,10 @@ export const upgradeModalLogic = kea<upgradeModalLogicType>([
],
guardAvailableFeature: [
(s) => [s.preflight, s.hasAvailableFeature],
- (preflight, hasAvailableFeature): GuardAvailableFeatureFn => {
+ (
+ preflight: null | import('~/types').PreflightStatus,
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ): GuardAvailableFeatureFn => {
return (featureKey, featureAvailableCallback, options): boolean => {
if (!featureKey) {
featureAvailableCallback?.()
diff --git a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingInfoLogic.ts b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingInfoLogic.ts
index fe89549b86c2..c87cedd26782 100644
--- a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingInfoLogic.ts
+++ b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingInfoLogic.ts
@@ -1,10 +1,8 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { permanentlyMount } from 'lib/utils/kea-logic-builders'
-import type { sessionRecordingInfoLogicType } from './sessionRecordingInfoLogicType'
-
export enum RecordingExistsState {
Loading = 'loading',
Exists = 'exists',
@@ -40,6 +38,71 @@ export function selectOutcome<T extends { description?: string | null }>(
const BATCH_SIZE = 100
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingInfoLogicValues {
+ getRecordingExists: (sessionId: string) => boolean | undefined
+ getSummaryOutcome: (sessionId: string) => SummaryOutcome | null
+ isRecordingExistsLoading: (sessionId: string) => boolean
+ outcomeBySessionId: Record<string, StoredOutcome>
+ pendingFetches: Record<string, PendingFetch>
+ recordingExistsStorage: RecordingExistsStorage
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingInfoLogicActions {
+ checkRecordingInfo: (
+ sessionId: string,
+ options?: {
+ includeOutcome?: boolean
+ }
+ ) => {
+ includeOutcome: boolean
+ sessionId: string
+ }
+ enqueuePending: (
+ sessionId: string,
+ want: keyof PendingFetch
+ ) => {
+ sessionId: string
+ want: keyof PendingFetch
+ }
+ flushPending: () => {
+ value: true
+ }
+ recordExistence: (updates: RecordingExistsStorage) => {
+ updates: RecordingExistsStorage
+ }
+ recordOutcomes: (outcomes: Record<string, StoredOutcome>) => {
+ outcomes: Record<string, StoredOutcome>
+ }
+ removePending: (sessionIds: string[]) => {
+ sessionIds: string[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingInfoLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ getRecordingExists: (
+ recordingExistsStorage: RecordingExistsStorage
+ ) => (sessionId: string) => boolean | undefined
+ isRecordingExistsLoading: (
+ recordingExistsStorage: RecordingExistsStorage,
+ pendingFetches: Record<string, PendingFetch>
+ ) => (sessionId: string) => boolean
+ getSummaryOutcome: (
+ outcomeBySessionId: Record<string, StoredOutcome>
+ ) => (sessionId: string) => SummaryOutcome | null
+ }
+}
+
+export type sessionRecordingInfoLogicType = MakeLogicType<
+ sessionRecordingInfoLogicValues,
+ sessionRecordingInfoLogicActions,
+ Record<string, any>,
+ sessionRecordingInfoLogicMeta
+>
+
export const sessionRecordingInfoLogic = kea<sessionRecordingInfoLogicType>([
path(['lib', 'components', 'ViewRecordingButton', 'sessionRecordingInfoLogic']),
actions({
diff --git a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
index 9079b4e8c65c..da60d62c60a4 100644
--- a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
+++ b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
@@ -1,11 +1,9 @@
-import { connect, kea, key, path, props } from 'kea'
+import { MakeLogicType, connect, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { teamLogic } from 'scenes/teamLogic'
-import type { sessionRecordingViewedLogicType } from './sessionRecordingViewedLogicType'
-
export interface SessionRecordingViewedResult {
viewed: boolean
otherViewers: number
@@ -15,6 +13,71 @@ export type SessionRecordingViewedProps = {
sessionRecordingId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingViewedLogicValues {
+ currentTeamId: number | null // teamLogic
+ recordingViewed: any
+ recordingViewedLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingViewedLogicActions {
+ loadRecordingViewed: () => any
+ loadRecordingViewedFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRecordingViewedSuccess: (
+ recordingViewed: {
+ otherViewers: number
+ viewed: boolean
+ },
+ payload?: any
+ ) => {
+ recordingViewed: {
+ otherViewers: number
+ viewed: boolean
+ }
+ payload?: any
+ }
+ userClickedThrough: () => any
+ userClickedThroughFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ userClickedThroughSuccess: (
+ recordingViewed: {
+ otherViewers: any
+ viewed: boolean
+ },
+ payload?: any
+ ) => {
+ recordingViewed: {
+ otherViewers: any
+ viewed: boolean
+ }
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionRecordingViewedLogicMeta {
+ key: string
+}
+
+export type sessionRecordingViewedLogicType = MakeLogicType<
+ sessionRecordingViewedLogicValues,
+ sessionRecordingViewedLogicActions,
+ SessionRecordingViewedProps,
+ sessionRecordingViewedLogicMeta
+>
+
export const sessionRecordingViewedLogic = kea<sessionRecordingViewedLogicType>([
path(['lib', 'components', 'ViewRecordingButton', 'sessionRecordingViewedLogic']),
key((props: Record<string, unknown>) => props.sessionRecordingId as string),
diff --git a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx
index aa66b1c4bd3f..aa78f3c72473 100644
--- a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx
+++ b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx
@@ -1,7 +1,43 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { windowValues } from 'kea-window-values'
-import type { visibilitySensorLogicType } from './visibilitySensorLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface visibilitySensorLogicValues {
+ checkIsVisible: (element: HTMLElement) => boolean
+ innerHeight: number
+ visible: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface visibilitySensorLogicActions {
+ scrolling: (element: HTMLElement) => {
+ element: HTMLElement
+ }
+ setVisible: (visible: boolean) => {
+ visible: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface visibilitySensorLogicProps {
+ id: string
+ offset?: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface visibilitySensorLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ checkIsVisible: (innerHeight: number, arg: any) => (element: HTMLElement) => boolean
+ }
+}
+
+export type visibilitySensorLogicType = MakeLogicType<
+ visibilitySensorLogicValues,
+ visibilitySensorLogicActions,
+ visibilitySensorLogicProps,
+ visibilitySensorLogicMeta
+>
export const visibilitySensorLogic = kea<visibilitySensorLogicType>([
props(
@@ -30,7 +66,7 @@ export const visibilitySensorLogic = kea<visibilitySensorLogicType>([
selectors(() => ({
checkIsVisible: [
(selectors) => [selectors.innerHeight, (_, props) => props.offset || 0],
- (windowHeight, offset) => (element: HTMLElement) => {
+ (windowHeight: number, offset) => (element: HTMLElement) => {
if (!element) {
return false
}
diff --git a/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts b/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts
index facf01af4cf0..85b38be9d225 100644
--- a/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts
+++ b/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { encodeParams } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -31,8 +31,6 @@ import { ToolbarRequestError } from '~/toolbar/toolbarRequestError'
import { HeatmapElement, HeatmapResponseType } from '~/toolbar/types'
import { FilterType } from '~/types'
-import type { heatmapDataLogicType } from './heatmapDataLogicType'
-
// The endpoint defaults to a bounded page for API callers; the overlay renders every point.
const UNBOUNDED_HEATMAP_LIMIT = 0
@@ -143,6 +141,192 @@ export function isWithinBounds(
return point.x >= bounds.left && point.x <= bounds.right && point.y >= bounds.top && point.y <= bounds.bottom
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapDataLogicValues {
+ areaEvents: HeatmapEventsResponse | null
+ areaEventsLoading: boolean
+ areaEventsLoadingMore: boolean
+ commonFilters: CommonFilters
+ dateRange: string | null
+ filteredHeatmapElements: HeatmapElement[]
+ heatmapBoundsFilter: HeatmapBoundsFilter | null
+ heatmapColorPalette: string | null
+ heatmapElements: HeatmapElement[]
+ heatmapEmpty: boolean
+ heatmapFilters: HeatmapFilters
+ heatmapFixedPositionMode: HeatmapFixedPositionMode
+ heatmapJsData: HeatmapJsData
+ heatmapTooltipLabel: string
+ heatmapTooltipSuppressed: boolean
+ heightOverride: number
+ href: string | null
+ hrefMatchType: HrefMatchType
+ isHeightCapped: boolean
+ isReady: boolean
+ maxYFromEvents: number
+ rawHeatmap: HeatmapResponseType | null
+ rawHeatmapLoading: boolean
+ selectedArea: HeatmapArea | null
+ showEventsPanel: boolean
+ viewportRange: {
+ max: number
+ min: number
+ }
+ widthOverride: number
+ windowHeight: number
+ windowWidth: number
+ windowWidthOverride: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapDataLogicActions {
+ clearSelectedArea: () => {
+ value: true
+ }
+ loadAreaEvents: (_: any) => any
+ loadAreaEventsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAreaEventsSuccess: (
+ areaEvents: HeatmapEventsResponse | null,
+ payload?: any
+ ) => {
+ areaEvents: HeatmapEventsResponse | null
+ payload?: any
+ }
+ loadHeatmap: () => {
+ value: true
+ }
+ loadHeatmapFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHeatmapSuccess: (
+ rawHeatmap: HeatmapResponseType | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ rawHeatmap: HeatmapResponseType | null
+ payload?: {
+ value: true
+ }
+ }
+ loadMoreAreaEvents: () => {
+ value: true
+ }
+ loadMoreAreaEventsSuccess: (payload: HeatmapEventsResponse) => {
+ payload: HeatmapEventsResponse
+ }
+ patchHeatmapFilters: (filters: Partial<HeatmapFilters>) => {
+ filters: Partial<HeatmapFilters>
+ }
+ resetHeatmapData: () => any
+ resetHeatmapDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetHeatmapDataSuccess: (
+ rawHeatmap: {
+ results: never[]
+ },
+ payload?: any
+ ) => {
+ rawHeatmap: {
+ results: never[]
+ }
+ payload?: any
+ }
+ setCommonFilters: (filters: CommonFilters) => {
+ filters: CommonFilters
+ }
+ setHeatmapBoundsFilter: (boundsFilter: HeatmapBoundsFilter | null) => {
+ boundsFilter: HeatmapBoundsFilter | null
+ }
+ setHeatmapColorPalette: (palette: string | null) => {
+ palette: string | null
+ }
+ setHeatmapFilters: (filters: HeatmapFilters) => {
+ filters: HeatmapFilters
+ }
+ setHeatmapFixedPositionMode: (mode: HeatmapFixedPositionMode) => {
+ mode: HeatmapFixedPositionMode
+ }
+ setHeatmapTooltipSuppressed: (suppressed: boolean) => {
+ suppressed: boolean
+ }
+ setHref: (href: string) => {
+ href: string
+ }
+ setHrefMatchType: (matchType: HrefMatchType) => {
+ matchType: HrefMatchType
+ }
+ setIsReady: (isReady: boolean) => {
+ isReady: boolean
+ }
+ setSelectedArea: (area: HeatmapArea | null) => {
+ area: HeatmapArea | null
+ }
+ setShowEventsPanel: (show: boolean) => {
+ show: boolean
+ }
+ setWindowWidthOverride: (widthOverride: number | null) => {
+ widthOverride: number | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapDataLogicMeta {
+ key: 'in-app' | 'toolbar'
+ __keaTypeGenInternalSelectorTypes: {
+ dateRange: (commonFilters: CommonFilters) => string | null
+ heatmapElements: (rawHeatmap: HeatmapResponseType | null) => HeatmapElement[]
+ viewportRange: (
+ heatmapFilters: HeatmapFilters,
+ windowWidth: number,
+ windowWidthOverride: number | null
+ ) => {
+ max: number
+ min: number
+ }
+ widthOverride: (windowWidthOverride: number | null) => number
+ heatmapTooltipLabel: (heatmapFilters: HeatmapFilters) => string
+ heatmapEmpty: (rawHeatmap: HeatmapResponseType | null, rawHeatmapLoading: boolean) => boolean
+ maxYFromEvents: (heatmapElements: HeatmapElement[]) => number
+ heightOverride: (maxYFromEvents: number, windowHeight: number) => number
+ isHeightCapped: (maxYFromEvents: number) => boolean
+ filteredHeatmapElements: (
+ heatmapElements: HeatmapElement[],
+ windowWidth: number,
+ windowWidthOverride: number | null,
+ heatmapBoundsFilter: HeatmapBoundsFilter | null
+ ) => HeatmapElement[]
+ heatmapJsData: (
+ filteredHeatmapElements: HeatmapElement[],
+ windowWidth: number,
+ windowWidthOverride: number | null,
+ heatmapFixedPositionMode: HeatmapFixedPositionMode
+ ) => HeatmapJsData
+ }
+}
+
+export type heatmapDataLogicType = MakeLogicType<
+ heatmapDataLogicValues,
+ heatmapDataLogicActions,
+ HeatmapDataLogicProps,
+ heatmapDataLogicMeta
+>
+
export const heatmapDataLogic = kea<heatmapDataLogicType>([
path((key) => ['lib', 'components', 'heatmap', 'heatmapDataLogic', key]),
props({ context: 'toolbar', exportToken: null } as HeatmapDataLogicProps),
@@ -369,7 +553,7 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
heatmapElements: [
(s) => [s.rawHeatmap],
- (rawHeatmap): HeatmapElement[] => {
+ (rawHeatmap: HeatmapResponseType | null): HeatmapElement[] => {
if (!rawHeatmap) {
return []
}
@@ -400,7 +584,7 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
viewportRange: [
(s) => [s.heatmapFilters, s.windowWidth, s.windowWidthOverride],
- (heatmapFilters, windowWidth, windowWidthOverride) =>
+ (heatmapFilters: HeatmapFilters, windowWidth: number, windowWidthOverride: number | null) =>
calculateViewportRange(heatmapFilters, windowWidthOverride ?? windowWidth),
],
@@ -412,7 +596,7 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
heatmapTooltipLabel: [
(s) => [s.heatmapFilters],
- (heatmapFilters) => {
+ (heatmapFilters: HeatmapFilters) => {
if (heatmapFilters.aggregation === 'unique_visitors') {
return 'visitors'
}
@@ -422,7 +606,7 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
heatmapEmpty: [
(s) => [s.rawHeatmap, s.rawHeatmapLoading],
- (rawHeatmap, rawHeatmapLoading) => {
+ (rawHeatmap: HeatmapResponseType | null, rawHeatmapLoading: boolean) => {
return rawHeatmap?.results.length === 0 && !rawHeatmapLoading
},
],
@@ -465,7 +649,12 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
// click-to-view-events hit testing can't disagree about which points exist
filteredHeatmapElements: [
(s) => [s.heatmapElements, s.windowWidth, s.windowWidthOverride, s.heatmapBoundsFilter],
- (heatmapElements, windowWidth, windowWidthOverride, heatmapBoundsFilter): HeatmapElement[] => {
+ (
+ heatmapElements: HeatmapElement[],
+ windowWidth: number,
+ windowWidthOverride: number | null,
+ heatmapBoundsFilter: HeatmapBoundsFilter | null
+ ): HeatmapElement[] => {
if (!heatmapBoundsFilter) {
return heatmapElements
}
@@ -485,7 +674,12 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([
heatmapJsData: [
(s) => [s.filteredHeatmapElements, s.windowWidth, s.windowWidthOverride, s.heatmapFixedPositionMode],
- (filteredHeatmapElements, windowWidth, windowWidthOverride, heatmapFixedPositionMode): HeatmapJsData => {
+ (
+ filteredHeatmapElements: HeatmapElement[],
+ windowWidth: number,
+ windowWidthOverride: number | null,
+ heatmapFixedPositionMode: HeatmapFixedPositionMode
+ ): HeatmapJsData => {
const width = windowWidthOverride ?? windowWidth
const data = filteredHeatmapElements.reduce((acc, element) => {
if (heatmapFixedPositionMode === 'hidden' && element.targetFixed) {
diff --git a/frontend/src/lib/components/tagSelectLogic.ts b/frontend/src/lib/components/tagSelectLogic.ts
index 33c7d01b923e..7bc575365213 100644
--- a/frontend/src/lib/components/tagSelectLogic.ts
+++ b/frontend/src/lib/components/tagSelectLogic.ts
@@ -1,13 +1,44 @@
-import { actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { tagsModel } from '~/models/tagsModel'
-import type { tagSelectLogicType } from './tagSelectLogicType'
-
export interface TagSelectLogicProps {
logicKey: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagSelectLogicValues {
+ tags: string[] // tagsModel
+ filteredTags: string[]
+ search: string
+ showPopover: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagSelectLogicActions {
+ setSearch: (search: string) => {
+ search: string
+ }
+ setShowPopover: (visible: boolean) => {
+ visible: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagSelectLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ filteredTags: (tags: string[], search: string) => string[]
+ }
+}
+
+export type tagSelectLogicType = MakeLogicType<
+ tagSelectLogicValues,
+ tagSelectLogicActions,
+ TagSelectLogicProps,
+ tagSelectLogicMeta
+>
+
export const tagSelectLogic = kea<tagSelectLogicType>([
props({} as TagSelectLogicProps),
key((props) => props.logicKey),
@@ -37,7 +68,7 @@ export const tagSelectLogic = kea<tagSelectLogicType>([
selectors(() => ({
filteredTags: [
(s) => [s.tags, s.search],
- (tags, search) => {
+ (tags: string[], search: string) => {
if (!search) {
return tags || []
}
diff --git a/frontend/src/lib/integrations/clickupIntegrationLogic.ts b/frontend/src/lib/integrations/clickupIntegrationLogic.ts
index a5d15a4ae4fa..c585580cb3ed 100644
--- a/frontend/src/lib/integrations/clickupIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/clickupIntegrationLogic.ts
@@ -1,9 +1,134 @@
-import { actions, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
-import type { clickupIntegrationLogicType } from './clickupIntegrationLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clickupIntegrationLogicValues {
+ clickUpLists:
+ | {
+ id: string
+ name: string
+ }[]
+ | null
+ clickUpListsLoading: boolean
+ clickUpSpaces:
+ | {
+ id: string
+ name: string
+ }[]
+ | null
+ clickUpSpacesLoading: boolean
+ clickUpWorkspaces:
+ | {
+ id: string
+ name: string
+ }[]
+ | null
+ clickUpWorkspacesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clickupIntegrationLogicActions {
+ loadClickUpLists: (spaceId: string) => {
+ spaceId: string
+ }
+ loadClickUpListsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClickUpListsSuccess: (
+ clickUpLists: {
+ id: string
+ name: string
+ }[],
+ payload?: {
+ spaceId: string
+ }
+ ) => {
+ clickUpLists: {
+ id: string
+ name: string
+ }[]
+ payload?: {
+ spaceId: string
+ }
+ }
+ loadClickUpSpaces: (workspaceId: string) => {
+ workspaceId: string
+ }
+ loadClickUpSpacesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClickUpSpacesSuccess: (
+ clickUpSpaces: {
+ id: string
+ name: string
+ }[],
+ payload?: {
+ workspaceId: string
+ }
+ ) => {
+ clickUpSpaces: {
+ id: string
+ name: string
+ }[]
+ payload?: {
+ workspaceId: string
+ }
+ }
+ loadClickUpWorkspaces: () => {
+ value: true
+ }
+ loadClickUpWorkspacesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClickUpWorkspacesSuccess: (
+ clickUpWorkspaces: {
+ id: string
+ name: string
+ }[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ clickUpWorkspaces: {
+ id: string
+ name: string
+ }[]
+ payload?: {
+ value: true
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clickupIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clickupIntegrationLogicMeta {
+ key: number
+}
+
+export type clickupIntegrationLogicType = MakeLogicType<
+ clickupIntegrationLogicValues,
+ clickupIntegrationLogicActions,
+ clickupIntegrationLogicProps,
+ clickupIntegrationLogicMeta
+>
export const clickupIntegrationLogic = kea<clickupIntegrationLogicType>([
props({} as { id: number }),
diff --git a/frontend/src/lib/integrations/githubBranchSearchLogic.ts b/frontend/src/lib/integrations/githubBranchSearchLogic.ts
index 4b74fd9e731f..292f6154c92c 100644
--- a/frontend/src/lib/integrations/githubBranchSearchLogic.ts
+++ b/frontend/src/lib/integrations/githubBranchSearchLogic.ts
@@ -1,9 +1,7 @@
-import { actions, afterMount, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
import api from 'lib/api'
-import type { githubBranchSearchLogicType } from './githubBranchSearchLogicType'
-
const PAGE_SIZE = 50
const SEARCH_DEBOUNCE_MS = 300
@@ -13,6 +11,58 @@ export interface GithubBranchSearchLogicProps {
repo: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubBranchSearchLogicValues {
+ branches: string[]
+ currentOffset: number
+ defaultBranch: string | null
+ hasMore: boolean
+ loading: boolean
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubBranchSearchLogicActions {
+ loadMore: () => {
+ value: true
+ }
+ loadPage: (offset: number) => {
+ offset: number
+ }
+ loadPageFailure: () => {
+ value: true
+ }
+ loadPageSuccess: (
+ branches: string[],
+ defaultBranch: string | null,
+ hasMore: boolean,
+ offset: number
+ ) => {
+ branches: string[]
+ defaultBranch: string | null
+ hasMore: boolean
+ offset: number
+ }
+ refresh: () => {
+ value: true
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubBranchSearchLogicMeta {
+ key: string
+}
+
+export type githubBranchSearchLogicType = MakeLogicType<
+ githubBranchSearchLogicValues,
+ githubBranchSearchLogicActions,
+ GithubBranchSearchLogicProps,
+ githubBranchSearchLogicMeta
+>
+
/**
* Server-side searchable, paginated GitHub branch source for a single repository. Mirrors
* {@link githubRepositorySearchLogic} but for the `github_branches` endpoint (which is repo-scoped), and
diff --git a/frontend/src/lib/integrations/githubIntegrationLogic.ts b/frontend/src/lib/integrations/githubIntegrationLogic.ts
index 260b13f46519..9f8411e5e4af 100644
--- a/frontend/src/lib/integrations/githubIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/githubIntegrationLogic.ts
@@ -1,13 +1,55 @@
-import { actions, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
import api from 'lib/api'
import type { GitHubRepoApi } from 'products/integrations/frontend/generated/api.schemas'
-import type { githubIntegrationLogicType } from './githubIntegrationLogicType'
-
const PAGE_SIZE = 500
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubIntegrationLogicValues {
+ currentOffset: number
+ repositories: GitHubRepoApi[]
+ repositoriesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubIntegrationLogicActions {
+ loadRepositories: () => {
+ value: true
+ }
+ loadRepositoriesPage: (offset: number) => {
+ offset: number
+ }
+ loadRepositoriesPageFailure: () => {
+ value: true
+ }
+ loadRepositoriesPageSuccess: (
+ repositories: GitHubRepoApi[],
+ hasMore: boolean
+ ) => {
+ hasMore: boolean
+ repositories: GitHubRepoApi[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubIntegrationLogicMeta {
+ key: number
+}
+
+export type githubIntegrationLogicType = MakeLogicType<
+ githubIntegrationLogicValues,
+ githubIntegrationLogicActions,
+ githubIntegrationLogicProps,
+ githubIntegrationLogicMeta
+>
+
export const githubIntegrationLogic = kea<githubIntegrationLogicType>([
props({} as { id: number }),
key((props) => props.id),
diff --git a/frontend/src/lib/integrations/githubRepositorySearchLogic.ts b/frontend/src/lib/integrations/githubRepositorySearchLogic.ts
index 6c5e37072848..82f7e7c1e987 100644
--- a/frontend/src/lib/integrations/githubRepositorySearchLogic.ts
+++ b/frontend/src/lib/integrations/githubRepositorySearchLogic.ts
@@ -1,11 +1,21 @@
-import { actions, afterMount, isBreakpoint, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ isBreakpoint,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import api from 'lib/api'
import type { GitHubRepoApi } from 'products/integrations/frontend/generated/api.schemas'
-import type { githubRepositorySearchLogicType } from './githubRepositorySearchLogicType'
-
const PAGE_SIZE = 50
const SEARCH_DEBOUNCE_MS = 300
@@ -13,6 +23,60 @@ export interface GithubRepositorySearchLogicProps {
id: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubRepositorySearchLogicValues {
+ currentOffset: number
+ error: string | null
+ hasMore: boolean
+ loading: boolean
+ repositories: GitHubRepoApi[]
+ repositoryNames: string[]
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubRepositorySearchLogicActions {
+ loadMore: () => {
+ value: true
+ }
+ loadPage: (offset: number) => {
+ offset: number
+ }
+ loadPageFailure: (error: string) => {
+ error: string
+ }
+ loadPageSuccess: (
+ repositories: GitHubRepoApi[],
+ hasMore: boolean,
+ offset: number
+ ) => {
+ hasMore: boolean
+ offset: number
+ repositories: GitHubRepoApi[]
+ }
+ refresh: () => {
+ value: true
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface githubRepositorySearchLogicMeta {
+ key: number
+ __keaTypeGenInternalSelectorTypes: {
+ repositoryNames: (repositories: GitHubRepoApi[]) => string[]
+ }
+}
+
+export type githubRepositorySearchLogicType = MakeLogicType<
+ githubRepositorySearchLogicValues,
+ githubRepositorySearchLogicActions,
+ GithubRepositorySearchLogicProps,
+ githubRepositorySearchLogicMeta
+>
+
/**
* Server-side searchable, paginated GitHub repository source for a single integration. Unlike
* {@link githubIntegrationLogic} — which eagerly bulk-loads every repository in 500-row pages and ignores
diff --git a/frontend/src/lib/integrations/googleAdsIntegrationLogic.ts b/frontend/src/lib/integrations/googleAdsIntegrationLogic.ts
index 9eb8b703f616..bca3b48291a2 100644
--- a/frontend/src/lib/integrations/googleAdsIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/googleAdsIntegrationLogic.ts
@@ -1,11 +1,103 @@
-import { actions, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { GoogleAdsConversionActionType } from '~/types'
-import type { googleAdsIntegrationLogicType } from './googleAdsIntegrationLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface googleAdsIntegrationLogicValues {
+ googleAdsAccessibleAccounts:
+ | {
+ id: string
+ level: string
+ name: string
+ parent_id: string
+ }[]
+ | null
+ googleAdsAccessibleAccountsLoading: boolean
+ googleAdsConversionActions: GoogleAdsConversionActionType[] | null
+ googleAdsConversionActionsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface googleAdsIntegrationLogicActions {
+ loadGoogleAdsAccessibleAccounts: () => {
+ value: true
+ }
+ loadGoogleAdsAccessibleAccountsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGoogleAdsAccessibleAccountsSuccess: (
+ googleAdsAccessibleAccounts: {
+ id: string
+ level: string
+ name: string
+ parent_id: string
+ }[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ googleAdsAccessibleAccounts: {
+ id: string
+ level: string
+ name: string
+ parent_id: string
+ }[]
+ payload?: {
+ value: true
+ }
+ }
+ loadGoogleAdsConversionActions: (
+ customerId: string,
+ parentId: string
+ ) => {
+ customerId: string
+ parentId: string
+ }
+ loadGoogleAdsConversionActionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGoogleAdsConversionActionsSuccess: (
+ googleAdsConversionActions: GoogleAdsConversionActionType[],
+ payload?: {
+ customerId: string
+ parentId: string
+ }
+ ) => {
+ googleAdsConversionActions: GoogleAdsConversionActionType[]
+ payload?: {
+ customerId: string
+ parentId: string
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface googleAdsIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface googleAdsIntegrationLogicMeta {
+ key: number
+}
+
+export type googleAdsIntegrationLogicType = MakeLogicType<
+ googleAdsIntegrationLogicValues,
+ googleAdsIntegrationLogicActions,
+ googleAdsIntegrationLogicProps,
+ googleAdsIntegrationLogicMeta
+>
export const googleAdsIntegrationLogic = kea<googleAdsIntegrationLogicType>([
props({} as { id: number }),
diff --git a/frontend/src/lib/integrations/integrationAccountsLogic.ts b/frontend/src/lib/integrations/integrationAccountsLogic.ts
index 164a7b7c038e..482a39cf1ccf 100644
--- a/frontend/src/lib/integrations/integrationAccountsLogic.ts
+++ b/frontend/src/lib/integrations/integrationAccountsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { ApiConfig } from 'lib/api'
@@ -6,10 +6,56 @@ import { ApiConfig } from 'lib/api'
import { externalDataSourcesOauthAccountsRetrieve } from 'products/warehouse_sources/frontend/generated/api'
import type { IntegrationAccountApi } from 'products/warehouse_sources/frontend/generated/api.schemas'
-import type { integrationAccountsLogicType } from './integrationAccountsLogicType'
-
const SEARCH_DEBOUNCE_MS = 300
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationAccountsLogicValues {
+ accounts: IntegrationAccountApi[]
+ accountsError: string | null
+ accountsLoading: boolean
+ search: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationAccountsLogicActions {
+ loadAccounts: () => any
+ loadAccountsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAccountsSuccess: (
+ accounts: IntegrationAccountApi[],
+ payload?: any
+ ) => {
+ accounts: IntegrationAccountApi[]
+ payload?: any
+ }
+ setSearch: (search: string) => {
+ search: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationAccountsLogicProps {
+ id: number
+ sourceType: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationAccountsLogicMeta {
+ key: string
+}
+
+export type integrationAccountsLogicType = MakeLogicType<
+ integrationAccountsLogicValues,
+ integrationAccountsLogicActions,
+ integrationAccountsLogicProps,
+ integrationAccountsLogicMeta
+>
+
export const integrationAccountsLogic = kea<integrationAccountsLogicType>([
props({} as { id: number; sourceType: string }),
key((props) => `${props.sourceType}/${props.id}`),
diff --git a/frontend/src/lib/integrations/integrationsLogic.ts b/frontend/src/lib/integrations/integrationsLogic.ts
index 2b6a226946b7..a69ea201efab 100644
--- a/frontend/src/lib/integrations/integrationsLogic.ts
+++ b/frontend/src/lib/integrations/integrationsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -23,7 +23,8 @@ import {
import type { GitHubRepoApi, IntegrationKindEnumApi } from 'products/integrations/frontend/generated/api.schemas'
import { ChannelType } from 'products/workflows/frontend/Channels/MessageChannels'
-import type { integrationsLogicType } from './integrationsLogicType'
+import type { AvailableSetupTaskIdsEnumApi } from '../../generated/core/api.schemas'
+import type { PreflightStatus, UserBasicType } from '../../types'
import { ICONS } from './utils'
function toastApiError(e: unknown): void {
@@ -31,6 +32,620 @@ function toastApiError(e: unknown): void {
lemonToast.error(detail || 'Something went wrong. Please try again.')
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationsLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ siteUrlMisconfigured: boolean // preflightLogic
+ currentProjectId: number | string // teamLogic
+ accessRequest: IntegrationKind | null
+ accessRequestLoading: boolean
+ accessRequestReason: string
+ domainGroupedEmailIntegrations: EmailIntegrationDomainGroupedType[]
+ getGitHubRepositories: (integrationId: number) => string[]
+ getGitHubRepositoriesFull: (integrationId: number) => GitHubRepoApi[]
+ getIntegrationsByKind: (
+ kinds: (
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ )[]
+ ) => IntegrationType[]
+ githubRepositories: Record<number, GitHubRepoApi[]>
+ githubRepositoriesLoading: boolean
+ integrations: IntegrationType[] | null
+ integrationsLoading: boolean
+ linkedGithubInstallation: IntegrationType | null
+ linkedGithubInstallationLoading: boolean
+ newIntegrationModalKind: IntegrationKind | null
+ requestedAccessKinds: IntegrationKind[]
+ selectedIntegration: IntegrationType | null
+ setupModalOpen: boolean
+ setupModalType: ChannelType | null
+ slackAvailable: boolean | undefined
+ slackIntegrations: IntegrationType[] | undefined
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationsLogicActions {
+ markTaskAsCompleted: (taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]) => {
+ taskIdOrIds: AvailableSetupTaskIdsEnumApi | AvailableSetupTaskIdsEnumApi[]
+ } // globalSetupLogic
+ closeNewIntegrationModal: () => {
+ value: true
+ }
+ closeSetupModal: () => {
+ value: true
+ }
+ deleteIntegration: (id: number) => {
+ id: number
+ }
+ handleOauthCallback: (
+ kind: IntegrationKind,
+ searchParams: any
+ ) => {
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ searchParams: any
+ }
+ linkExistingGithubInstallation: () => any
+ linkExistingGithubInstallationFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ linkExistingGithubInstallationSuccess: (
+ linkedGithubInstallation: IntegrationType,
+ payload?: any
+ ) => {
+ linkedGithubInstallation: IntegrationType
+ payload?: any
+ }
+ loadGitHubRepositories: (integrationId: number) => {
+ integrationId: number
+ }
+ loadGitHubRepositoriesPage: (
+ integrationId: number,
+ offset: number
+ ) => {
+ integrationId: number
+ offset: number
+ }
+ loadGitHubRepositoriesPageFailure: (integrationId: number) => {
+ integrationId: number
+ }
+ loadGitHubRepositoriesPageSuccess: (
+ integrationId: number,
+ repositories: GitHubRepoApi[],
+ hasMore: boolean
+ ) => {
+ hasMore: boolean
+ integrationId: number
+ repositories: GitHubRepoApi[]
+ }
+ loadIntegrations: () => any
+ loadIntegrationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIntegrationsSuccess: (
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[],
+ payload?: any
+ ) => {
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[]
+ payload?: any
+ }
+ newGoogleCloudKey: (
+ kind: string,
+ key: File,
+ callback?: (integration: IntegrationType) => void
+ ) => {
+ callback: ((integration: IntegrationType) => void) | undefined
+ key: File
+ kind: string
+ }
+ newGoogleCloudKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ newGoogleCloudKeySuccess: (
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[],
+ payload?: {
+ callback: ((integration: IntegrationType) => void) | undefined
+ key: File
+ kind: string
+ }
+ ) => {
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[]
+ payload?: {
+ callback: ((integration: IntegrationType) => void) | undefined
+ key: File
+ kind: string
+ }
+ }
+ openNewIntegrationModal: (kind: IntegrationKind) => {
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }
+ openSetupModal: (
+ integration?: IntegrationType,
+ channelType?: ChannelType
+ ) => {
+ channelType: 'apns' | 'email' | 'firebase' | 'slack' | 'twilio' | undefined
+ integration: IntegrationType | undefined
+ }
+ requestIntegrationAccess: ({ kind }: { kind: IntegrationKind }) => {
+ kind: IntegrationKind
+ }
+ requestIntegrationAccessFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ requestIntegrationAccessSuccess: (
+ accessRequest:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel',
+ payload?: {
+ kind: IntegrationKind
+ }
+ ) => {
+ accessRequest:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ payload?: {
+ kind: IntegrationKind
+ }
+ }
+ setAccessRequestReason: (reason: string) => {
+ reason: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface integrationsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ slackIntegrations: (integrations: IntegrationType[] | null) => IntegrationType[] | undefined
+ getIntegrationsByKind: (
+ integrations: IntegrationType[] | null
+ ) => (
+ kinds: (
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ )[]
+ ) => IntegrationType[]
+ slackAvailable: (preflight: PreflightStatus | null) => boolean | undefined
+ getGitHubRepositories: (
+ githubRepositories: Record<number, GitHubRepoApi[]>
+ ) => (integrationId: number) => string[]
+ getGitHubRepositoriesFull: (
+ githubRepositories: Record<number, GitHubRepoApi[]>
+ ) => (integrationId: number) => GitHubRepoApi[]
+ domainGroupedEmailIntegrations: (integrations: IntegrationType[] | null) => EmailIntegrationDomainGroupedType[]
+ }
+}
+
+export type integrationsLogicType = MakeLogicType<
+ integrationsLogicValues,
+ integrationsLogicActions,
+ Record<string, any>,
+ integrationsLogicMeta
+>
+
export const integrationsLogic = kea<integrationsLogicType>([
path(['lib', 'integrations', 'integrationsLogic']),
connect(() => ({
@@ -357,40 +972,40 @@ export const integrationsLogic = kea<integrationsLogicType>([
selectors({
slackIntegrations: [
(s) => [s.integrations],
- (integrations) => {
+ (integrations: IntegrationType[] | null) => {
return integrations?.filter((x) => x.kind == 'slack')
},
],
getIntegrationsByKind: [
(s) => [s.integrations],
- (integrations) => {
+ (integrations: IntegrationType[] | null) => {
return (kinds: IntegrationKind[]) => integrations?.filter((i) => kinds.includes(i.kind)) || []
},
],
slackAvailable: [
(s) => [s.preflight],
- (preflight) => {
+ (preflight: null | import('~/types').PreflightStatus) => {
// TODO: Change this to be based on preflight or something
return preflight?.slack_service?.available
},
],
getGitHubRepositories: [
(s) => [s.githubRepositories],
- (githubRepositories) => {
+ (githubRepositories: Record<number, GitHubRepoApi[]>) => {
return (integrationId: number) => (githubRepositories[integrationId] || []).map((r) => r.name)
},
],
getGitHubRepositoriesFull: [
(s) => [s.githubRepositories],
- (githubRepositories) => {
+ (githubRepositories: Record<number, GitHubRepoApi[]>) => {
return (integrationId: number): GitHubRepoApi[] => githubRepositories[integrationId] || []
},
],
domainGroupedEmailIntegrations: [
(s) => [s.integrations],
- (integrations): EmailIntegrationDomainGroupedType[] => {
+ (integrations: IntegrationType[] | null): EmailIntegrationDomainGroupedType[] => {
const domainGroupedIntegrations: Record<string, EmailIntegrationDomainGroupedType> = {}
integrations
diff --git a/frontend/src/lib/integrations/jiraIntegrationLogic.ts b/frontend/src/lib/integrations/jiraIntegrationLogic.ts
index 7d23bfed689c..d48f48ceb34c 100644
--- a/frontend/src/lib/integrations/jiraIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/jiraIntegrationLogic.ts
@@ -1,11 +1,51 @@
-import { actions, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { JiraProjectType } from '~/types'
-import type { jiraIntegrationLogicType } from './jiraIntegrationLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface jiraIntegrationLogicValues {
+ jiraProjects: JiraProjectType[]
+ jiraProjectsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface jiraIntegrationLogicActions {
+ loadJiraProjects: () => {}
+ loadJiraProjectsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadJiraProjectsSuccess: (
+ jiraProjects: JiraProjectType[],
+ payload?: {}
+ ) => {
+ jiraProjects: JiraProjectType[]
+ payload?: {}
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface jiraIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface jiraIntegrationLogicMeta {
+ key: number
+}
+
+export type jiraIntegrationLogicType = MakeLogicType<
+ jiraIntegrationLogicValues,
+ jiraIntegrationLogicActions,
+ jiraIntegrationLogicProps,
+ jiraIntegrationLogicMeta
+>
export const jiraIntegrationLogic = kea<jiraIntegrationLogicType>([
props({} as { id: number }),
diff --git a/frontend/src/lib/integrations/linearIntegrationLogic.ts b/frontend/src/lib/integrations/linearIntegrationLogic.ts
index 20cd8b3e7e33..69cd525e1f57 100644
--- a/frontend/src/lib/integrations/linearIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/linearIntegrationLogic.ts
@@ -1,11 +1,51 @@
-import { actions, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { LinearTeamType } from '~/types'
-import type { linearIntegrationLogicType } from './linearIntegrationLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linearIntegrationLogicValues {
+ linearTeams: LinearTeamType[]
+ linearTeamsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linearIntegrationLogicActions {
+ loadAllLinearTeams: () => {}
+ loadAllLinearTeamsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAllLinearTeamsSuccess: (
+ linearTeams: LinearTeamType[],
+ payload?: {}
+ ) => {
+ linearTeams: LinearTeamType[]
+ payload?: {}
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linearIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linearIntegrationLogicMeta {
+ key: number
+}
+
+export type linearIntegrationLogicType = MakeLogicType<
+ linearIntegrationLogicValues,
+ linearIntegrationLogicActions,
+ linearIntegrationLogicProps,
+ linearIntegrationLogicMeta
+>
export const linearIntegrationLogic = kea<linearIntegrationLogicType>([
props({} as { id: number }),
diff --git a/frontend/src/lib/integrations/linkedInAdsIntegrationLogic.ts b/frontend/src/lib/integrations/linkedInAdsIntegrationLogic.ts
index d0f89534d6e5..c2a1e99cf12e 100644
--- a/frontend/src/lib/integrations/linkedInAdsIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/linkedInAdsIntegrationLogic.ts
@@ -1,11 +1,74 @@
-import { actions, kea, key, path, props } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { LinkedInAdsAccountType, LinkedInAdsConversionRuleType } from '~/types'
-import type { linkedInAdsIntegrationLogicType } from './linkedInAdsIntegrationLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkedInAdsIntegrationLogicValues {
+ linkedInAdsAccounts: LinkedInAdsAccountType[] | null
+ linkedInAdsAccountsLoading: boolean
+ linkedInAdsConversionRules: LinkedInAdsConversionRuleType[] | null
+ linkedInAdsConversionRulesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkedInAdsIntegrationLogicActions {
+ loadLinkedInAdsAccounts: () => {
+ value: true
+ }
+ loadLinkedInAdsAccountsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLinkedInAdsAccountsSuccess: (
+ linkedInAdsAccounts: LinkedInAdsAccountType[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ linkedInAdsAccounts: LinkedInAdsAccountType[]
+ payload?: {
+ value: true
+ }
+ }
+ loadLinkedInAdsConversionRules: (accountId: string) => string
+ loadLinkedInAdsConversionRulesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLinkedInAdsConversionRulesSuccess: (
+ linkedInAdsConversionRules: LinkedInAdsConversionRuleType[],
+ payload?: string
+ ) => {
+ linkedInAdsConversionRules: LinkedInAdsConversionRuleType[]
+ payload?: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkedInAdsIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkedInAdsIntegrationLogicMeta {
+ key: number
+}
+
+export type linkedInAdsIntegrationLogicType = MakeLogicType<
+ linkedInAdsIntegrationLogicValues,
+ linkedInAdsIntegrationLogicActions,
+ linkedInAdsIntegrationLogicProps,
+ linkedInAdsIntegrationLogicMeta
+>
export const linkedInAdsIntegrationLogic = kea<linkedInAdsIntegrationLogicType>([
props({} as { id: number }),
diff --git a/frontend/src/lib/integrations/slackIntegrationLogic.ts b/frontend/src/lib/integrations/slackIntegrationLogic.ts
index 8868a95c58f0..631a291b6ad0 100644
--- a/frontend/src/lib/integrations/slackIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/slackIntegrationLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,10 +8,131 @@ import { preflightLogic } from 'lib/logic/preflightLogic'
import { SlackChannelType } from '~/types'
-import type { slackIntegrationLogicType } from './slackIntegrationLogicType'
+import type { PreflightStatus } from '../../types'
export const SLACK_CHANNELS_MIN_REFRESH_INTERVAL_SECONDS = 30
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface slackIntegrationLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ siteUrlMisconfigured: boolean // preflightLogic
+ _fetchedSlackChannelById: SlackChannelType | null
+ _fetchedSlackChannels: SlackChannelType[]
+ allSlackChannels: {
+ channels: SlackChannelType[]
+ has_more?: boolean
+ lastRefreshedAt: string
+ } | null
+ allSlackChannelsLoading: boolean
+ getChannelRefreshButtonDisabledReason: () => string
+ isMemberOfSlackChannel: (channel: string) => boolean | null
+ isPrivateChannelWithoutAccess: (channel: string) => boolean
+ recentlySubscribedChannelIds: string[]
+ slackChannelById: SlackChannelType | null
+ slackChannelByIdLoading: boolean
+ slackChannels: SlackChannelType[]
+ slackChannelsForPicker: SlackChannelType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface slackIntegrationLogicActions {
+ loadAllSlackChannels: (
+ forceRefresh?: boolean,
+ search?: string
+ ) => {
+ forceRefresh: boolean
+ search: string
+ }
+ loadAllSlackChannelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAllSlackChannelsSuccess: (
+ allSlackChannels: {
+ channels: SlackChannelType[]
+ has_more?: boolean | undefined
+ lastRefreshedAt: string
+ },
+ payload?: {
+ forceRefresh: boolean
+ search: string
+ }
+ ) => {
+ allSlackChannels: {
+ channels: SlackChannelType[]
+ has_more?: boolean | undefined
+ lastRefreshedAt: string
+ }
+ payload?: {
+ forceRefresh: boolean
+ search: string
+ }
+ }
+ loadSlackChannelById: (channelId: string) => {
+ channelId: string
+ }
+ loadSlackChannelByIdFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSlackChannelByIdSuccess: (
+ slackChannelById: SlackChannelType,
+ payload?: {
+ channelId: string
+ }
+ ) => {
+ slackChannelById: SlackChannelType
+ payload?: {
+ channelId: string
+ }
+ }
+ setRecentlySubscribedChannelIds: (channelIds: string[]) => {
+ channelIds: string[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface slackIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface slackIntegrationLogicMeta {
+ key: number
+ __keaTypeGenInternalSelectorTypes: {
+ slackChannels: (
+ _fetchedSlackChannels: SlackChannelType[],
+ _fetchedSlackChannelById: SlackChannelType | null
+ ) => SlackChannelType[]
+ slackChannelsForPicker: (
+ slackChannels: SlackChannelType[],
+ recentlySubscribedChannelIds: string[]
+ ) => SlackChannelType[]
+ isMemberOfSlackChannel: (slackChannels: SlackChannelType[]) => (channel: string) => boolean | null
+ isPrivateChannelWithoutAccess: (slackChannels: SlackChannelType[]) => (channel: string) => boolean
+ getChannelRefreshButtonDisabledReason: (
+ allSlackChannels: {
+ channels: SlackChannelType[]
+ has_more?: boolean
+ lastRefreshedAt: string
+ } | null
+ ) => () => string
+ }
+}
+
+export type slackIntegrationLogicType = MakeLogicType<
+ slackIntegrationLogicValues,
+ slackIntegrationLogicActions,
+ slackIntegrationLogicProps,
+ slackIntegrationLogicMeta
+>
+
export const slackIntegrationLogic = kea<slackIntegrationLogicType>([
props({} as { id: number }),
key((props) => props.id),
@@ -79,7 +200,10 @@ export const slackIntegrationLogic = kea<slackIntegrationLogicType>([
selectors({
slackChannels: [
(s) => [s._fetchedSlackChannels, s._fetchedSlackChannelById],
- (_fetchedSlackChannels, _fetchedSlackChannelById): SlackChannelType[] => {
+ (
+ _fetchedSlackChannels: SlackChannelType[],
+ _fetchedSlackChannelById: SlackChannelType | null
+ ): SlackChannelType[] => {
const channels = [..._fetchedSlackChannels]
if (_fetchedSlackChannelById && !channels.find((x) => x.id === _fetchedSlackChannelById.id)) {
channels.push(_fetchedSlackChannelById)
@@ -89,7 +213,7 @@ export const slackIntegrationLogic = kea<slackIntegrationLogicType>([
],
slackChannelsForPicker: [
(s) => [s.slackChannels, s.recentlySubscribedChannelIds],
- (slackChannels, recentlySubscribedChannelIds): SlackChannelType[] => {
+ (slackChannels: SlackChannelType[], recentlySubscribedChannelIds: string[]): SlackChannelType[] => {
const recencyIndex = new Map(recentlySubscribedChannelIds.map((id, idx) => [id, idx]))
return [...slackChannels].sort((a, b) => {
const aRecency = recencyIndex.get(a.id) ?? Number.POSITIVE_INFINITY
diff --git a/frontend/src/lib/integrations/twilioIntegrationLogic.ts b/frontend/src/lib/integrations/twilioIntegrationLogic.ts
index 60c784c002a6..9ecc21c8a4ea 100644
--- a/frontend/src/lib/integrations/twilioIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/twilioIntegrationLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,10 +7,85 @@ import { preflightLogic } from 'lib/logic/preflightLogic'
import { TwilioPhoneNumberType } from '~/types'
-import type { twilioIntegrationLogicType } from './twilioIntegrationLogicType'
+import type { PreflightStatus } from '../../types'
export const TWILIO_CHANNELS_MIN_REFRESH_INTERVAL_MINUTES = 5
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface twilioIntegrationLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ siteUrlMisconfigured: boolean // preflightLogic
+ allTwilioPhoneNumbers: {
+ lastRefreshedAt: string
+ phone_numbers: TwilioPhoneNumberType[]
+ } | null
+ allTwilioPhoneNumbersLoading: boolean
+ getPhoneNumberRefreshButtonDisabledReason: () => string
+ twilioPhoneNumbers: TwilioPhoneNumberType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface twilioIntegrationLogicActions {
+ loadAllTwilioPhoneNumbers: (forceRefresh?: boolean) => {
+ forceRefresh: boolean
+ }
+ loadAllTwilioPhoneNumbersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAllTwilioPhoneNumbersSuccess: (
+ allTwilioPhoneNumbers: {
+ lastRefreshedAt: string
+ phone_numbers: TwilioPhoneNumberType[]
+ },
+ payload?: {
+ forceRefresh: boolean
+ }
+ ) => {
+ allTwilioPhoneNumbers: {
+ lastRefreshedAt: string
+ phone_numbers: TwilioPhoneNumberType[]
+ }
+ payload?: {
+ forceRefresh: boolean
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface twilioIntegrationLogicProps {
+ id: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface twilioIntegrationLogicMeta {
+ key: number
+ __keaTypeGenInternalSelectorTypes: {
+ twilioPhoneNumbers: (
+ allTwilioPhoneNumbers: {
+ lastRefreshedAt: string
+ phone_numbers: TwilioPhoneNumberType[]
+ } | null
+ ) => TwilioPhoneNumberType[]
+ getPhoneNumberRefreshButtonDisabledReason: (
+ allTwilioPhoneNumbers: {
+ lastRefreshedAt: string
+ phone_numbers: TwilioPhoneNumberType[]
+ } | null
+ ) => () => string
+ }
+}
+
+export type twilioIntegrationLogicType = MakeLogicType<
+ twilioIntegrationLogicValues,
+ twilioIntegrationLogicActions,
+ twilioIntegrationLogicProps,
+ twilioIntegrationLogicMeta
+>
+
export const twilioIntegrationLogic = kea<twilioIntegrationLogicType>([
props({} as { id: number }),
key((props) => props.id),
diff --git a/frontend/src/lib/integrations/userGithubIntegrationLogic.ts b/frontend/src/lib/integrations/userGithubIntegrationLogic.ts
index 1d80870fa9ed..98e6a6601240 100644
--- a/frontend/src/lib/integrations/userGithubIntegrationLogic.ts
+++ b/frontend/src/lib/integrations/userGithubIntegrationLogic.ts
@@ -1,17 +1,54 @@
-import { actions, events, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, events, isBreakpoint, kea, key, listeners, path, props, reducers } from 'kea'
import api from 'lib/api'
import type { GitHubRepoApi } from 'products/integrations/frontend/generated/api.schemas'
-import type { userGithubIntegrationLogicType } from './userGithubIntegrationLogicType'
-
const PAGE_SIZE = 500
export interface UserGitHubIntegrationLogicProps {
installationId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userGithubIntegrationLogicValues {
+ currentOffset: number
+ repositories: GitHubRepoApi[]
+ repositoriesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userGithubIntegrationLogicActions {
+ loadRepositories: () => {
+ value: true
+ }
+ loadRepositoriesPage: (offset: number) => {
+ offset: number
+ }
+ loadRepositoriesPageFailure: () => {
+ value: true
+ }
+ loadRepositoriesPageSuccess: (
+ repositories: GitHubRepoApi[],
+ hasMore: boolean
+ ) => {
+ hasMore: boolean
+ repositories: GitHubRepoApi[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userGithubIntegrationLogicMeta {
+ key: string
+}
+
+export type userGithubIntegrationLogicType = MakeLogicType<
+ userGithubIntegrationLogicValues,
+ userGithubIntegrationLogicActions,
+ UserGitHubIntegrationLogicProps,
+ userGithubIntegrationLogicMeta
+>
+
export const userGithubIntegrationLogic = kea<userGithubIntegrationLogicType>([
path(['lib', 'integrations', 'userGithubIntegrationLogic']),
props({} as UserGitHubIntegrationLogicProps),
diff --git a/frontend/src/lib/introductions/groupsAccessLogic.ts b/frontend/src/lib/introductions/groupsAccessLogic.ts
index 90944fa8b431..093a83061ab9 100644
--- a/frontend/src/lib/introductions/groupsAccessLogic.ts
+++ b/frontend/src/lib/introductions/groupsAccessLogic.ts
@@ -1,4 +1,4 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { preflightLogic } from 'lib/logic/preflightLogic'
import { teamLogic } from 'scenes/teamLogic'
@@ -6,7 +6,7 @@ import { userLogic } from 'scenes/userLogic'
import { AvailableFeature } from '~/types'
-import type { groupsAccessLogicType } from './groupsAccessLogicType'
+import type { PreflightStatus, TeamPublicType, TeamType } from '../../types'
export enum GroupsAccessStatus {
AlreadyUsing,
@@ -16,6 +16,42 @@ export enum GroupsAccessStatus {
Hidden,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsAccessLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ canStartUsingGroups: boolean
+ groupsAccessStatus: GroupsAccessStatus
+ groupsEnabled: boolean
+ needsUpgradeForGroups: boolean
+ shouldShowGroupsIntroduction: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsAccessLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ groupsEnabled: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ groupsAccessStatus: (
+ groupsEnabled: boolean,
+ currentTeam: TeamPublicType | TeamType | null,
+ preflight: PreflightStatus | null
+ ) => GroupsAccessStatus
+ needsUpgradeForGroups: (groupsAccessStatus: GroupsAccessStatus) => boolean
+ canStartUsingGroups: (groupsAccessStatus: GroupsAccessStatus) => boolean
+ shouldShowGroupsIntroduction: (groupsAccessStatus: GroupsAccessStatus) => boolean
+ }
+}
+
+export type groupsAccessLogicType = MakeLogicType<
+ groupsAccessLogicValues,
+ {},
+ Record<string, any>,
+ groupsAccessLogicMeta
+>
+
export const groupsAccessLogic = kea<groupsAccessLogicType>([
path(['lib', 'introductions', 'groupsAccessLogic']),
connect(() => ({
@@ -24,12 +60,17 @@ export const groupsAccessLogic = kea<groupsAccessLogicType>([
selectors({
groupsEnabled: [
(s) => [s.hasAvailableFeature],
- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.GROUP_ANALYTICS),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>
+ hasAvailableFeature(AvailableFeature.GROUP_ANALYTICS),
],
// Used to toggle various introduction views related to groups
groupsAccessStatus: [
(s) => [s.groupsEnabled, s.currentTeam, s.preflight],
- (groupsEnabled, currentTeam, preflight): GroupsAccessStatus => {
+ (
+ groupsEnabled: boolean,
+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,
+ preflight: null | import('~/types').PreflightStatus
+ ): GroupsAccessStatus => {
const hasGroups = currentTeam?.has_group_types
if (preflight?.instance_preferences?.disable_paid_fs) {
return GroupsAccessStatus.Hidden
@@ -45,16 +86,16 @@ export const groupsAccessLogic = kea<groupsAccessLogicType>([
],
needsUpgradeForGroups: [
(s) => [s.groupsAccessStatus],
- (groupsAccessStatus) =>
+ (groupsAccessStatus: GroupsAccessStatus) =>
[GroupsAccessStatus.NoAccess, GroupsAccessStatus.HasGroupTypes].includes(groupsAccessStatus),
],
canStartUsingGroups: [
(s) => [s.groupsAccessStatus],
- (groupsAccessStatus) => groupsAccessStatus === GroupsAccessStatus.HasAccess,
+ (groupsAccessStatus: GroupsAccessStatus) => groupsAccessStatus === GroupsAccessStatus.HasAccess,
],
shouldShowGroupsIntroduction: [
(s) => [s.groupsAccessStatus],
- (groupsAccessStatus) =>
+ (groupsAccessStatus: GroupsAccessStatus) =>
[GroupsAccessStatus.HasAccess, GroupsAccessStatus.HasGroupTypes, GroupsAccessStatus.NoAccess].includes(
groupsAccessStatus
),
diff --git a/frontend/src/lib/lemon-ui/LemonBanner/lemonBannerLogic.ts b/frontend/src/lib/lemon-ui/LemonBanner/lemonBannerLogic.ts
index 1fdf39095636..7305508b8e56 100644
--- a/frontend/src/lib/lemon-ui/LemonBanner/lemonBannerLogic.ts
+++ b/frontend/src/lib/lemon-ui/LemonBanner/lemonBannerLogic.ts
@@ -1,12 +1,37 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
-
-import type { lemonBannerLogicType } from './lemonBannerLogicType'
+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'
export type LemonBannerLogicProps = {
/** The key to be used for persisting the fact this modal is dismissed */
dismissKey: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonBannerLogicValues {
+ isDismissed: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonBannerLogicActions {
+ dismiss: () => {
+ value: true
+ }
+ resetDismissKey: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonBannerLogicMeta {
+ key: string
+}
+
+export type lemonBannerLogicType = MakeLogicType<
+ lemonBannerLogicValues,
+ lemonBannerLogicActions,
+ LemonBannerLogicProps,
+ lemonBannerLogicMeta
+>
+
export const lemonBannerLogic = kea<lemonBannerLogicType>([
path((key) => ['components', 'lemon-banner', 'lemonBannerLogic', key]),
key(({ dismissKey }) => dismissKey),
diff --git a/frontend/src/lib/lemon-ui/LemonDialog/lemonDialogLogic.ts b/frontend/src/lib/lemon-ui/LemonDialog/lemonDialogLogic.ts
index 28a77bf58d81..3861ef83f547 100644
--- a/frontend/src/lib/lemon-ui/LemonDialog/lemonDialogLogic.ts
+++ b/frontend/src/lib/lemon-ui/LemonDialog/lemonDialogLogic.ts
@@ -1,7 +1,6 @@
-import { kea, key, path, props } from 'kea'
+import { MakeLogicType, kea, key, path, props } from 'kea'
import { forms } from 'kea-forms'
-
-import type { lemonDialogLogicType } from './lemonDialogLogicType'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
export type LemonDialogFormPropsType = {
errors?: Record<string, (value: string) => string | undefined>
@@ -11,6 +10,73 @@ export type LemonDialogFormPropsType = {
showErrorsOnTouch?: boolean
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonDialogLogicValues {
+ form: Record<string, string>
+ formAllErrors: Record<string, any>
+ formChanged: boolean
+ formErrors: DeepPartialMap<Record<string, string>, ValidationErrorType>
+ formHasErrors: boolean
+ formManualErrors: Record<string, any>
+ formTouched: boolean
+ formTouches: Record<string, boolean>
+ formValidationErrors: DeepPartialMap<Record<string, string>, ValidationErrorType>
+ isFormSubmitting: boolean
+ isFormValid: boolean
+ showFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonDialogLogicActions {
+ resetForm: (values?: Record<string, string>) => {
+ values?: Record<string, string>
+ }
+ setFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFormValues: (values: DeepPartial<Record<string, string>>) => {
+ values: DeepPartial<Record<string, string>>
+ }
+ submitForm: () => {
+ value: boolean
+ }
+ submitFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFormRequest: (form: Record<string, string>) => {
+ form: Record<string, string>
+ }
+ submitFormSuccess: (form: Record<string, string>) => {
+ form: Record<string, string>
+ }
+ touchFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonDialogLogicMeta {
+ key: string
+}
+
+export type lemonDialogLogicType = MakeLogicType<
+ lemonDialogLogicValues,
+ lemonDialogLogicActions,
+ LemonDialogFormPropsType,
+ lemonDialogLogicMeta
+>
+
export const lemonDialogLogic = kea<lemonDialogLogicType>([
props({} as LemonDialogFormPropsType),
key(({ dialogKey }) => dialogKey ?? 'default'),
diff --git a/frontend/src/lib/lemon-ui/LemonField/LemonField.stories.tsx b/frontend/src/lib/lemon-ui/LemonField/LemonField.stories.tsx
index 71d07bb30375..877f5cd499e3 100644
--- a/frontend/src/lib/lemon-ui/LemonField/LemonField.stories.tsx
+++ b/frontend/src/lib/lemon-ui/LemonField/LemonField.stories.tsx
@@ -1,11 +1,11 @@
import type { Meta, StoryObj } from '@storybook/react'
-import { kea, path, useAllValues } from 'kea'
+import { MakeLogicType, kea, path, useAllValues } from 'kea'
import { Form, forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { LemonButton, LemonCheckbox, LemonInput, LemonSelect, LemonTextArea } from '@posthog/lemon-ui'
import { LemonField, LemonFieldProps } from './LemonField'
-import type { formLogicType } from './LemonField.storiesType'
type Story = StoryObj<LemonFieldProps>
const meta: Meta<LemonFieldProps> = {
@@ -68,6 +68,174 @@ export const _PureFields: Story = {
},
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface formLogicValues {
+ isMyFormSubmitting: boolean
+ isMyFormValid: boolean
+ isSimpleFormSubmitting: boolean
+ isSimpleFormValid: boolean
+ myForm: {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }
+ myFormAllErrors: Record<string, any>
+ myFormChanged: boolean
+ myFormErrors: DeepPartialMap<
+ {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ },
+ ValidationErrorType
+ >
+ myFormHasErrors: boolean
+ myFormManualErrors: Record<string, any>
+ myFormTouched: boolean
+ myFormTouches: Record<string, boolean>
+ myFormValidationErrors: DeepPartialMap<
+ {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ },
+ ValidationErrorType
+ >
+ showMyFormErrors: boolean
+ showSimpleFormErrors: boolean
+ simpleForm: {
+ name: string
+ }
+ simpleFormAllErrors: Record<string, any>
+ simpleFormChanged: boolean
+ simpleFormErrors: DeepPartialMap<
+ {
+ name: string
+ },
+ ValidationErrorType
+ >
+ simpleFormHasErrors: boolean
+ simpleFormManualErrors: Record<string, any>
+ simpleFormTouched: boolean
+ simpleFormTouches: Record<string, boolean>
+ simpleFormValidationErrors: DeepPartialMap<
+ {
+ name: string
+ },
+ ValidationErrorType
+ >
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface formLogicActions {
+ resetMyForm: (values?: { email: string; name: string; pineappleOnPizza: false }) => {
+ values?: {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }
+ }
+ resetSimpleForm: (values?: { name: string }) => {
+ values?: {
+ name: string
+ }
+ }
+ setMyFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setMyFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setMyFormValues: (
+ values: DeepPartial<{
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }>
+ ) => {
+ values: DeepPartial<{
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }>
+ }
+ setSimpleFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSimpleFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSimpleFormValues: (
+ values: DeepPartial<{
+ name: string
+ }>
+ ) => {
+ values: DeepPartial<{
+ name: string
+ }>
+ }
+ submitMyForm: () => {
+ value: boolean
+ }
+ submitMyFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitMyFormRequest: (myForm: { email: string; name: string; pineappleOnPizza: false }) => {
+ myForm: {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }
+ }
+ submitMyFormSuccess: (myForm: { email: string; name: string; pineappleOnPizza: false }) => {
+ myForm: {
+ email: string
+ name: string
+ pineappleOnPizza: false
+ }
+ }
+ submitSimpleForm: () => {
+ value: boolean
+ }
+ submitSimpleFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSimpleFormRequest: (simpleForm: { name: string }) => {
+ simpleForm: {
+ name: string
+ }
+ }
+ submitSimpleFormSuccess: (simpleForm: { name: string }) => {
+ simpleForm: {
+ name: string
+ }
+ }
+ touchMyFormField: (key: string) => {
+ key: string
+ }
+ touchSimpleFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type formLogicType = MakeLogicType<formLogicValues, formLogicActions>
+
const formLogic = kea<formLogicType>([
path(['lib', 'forms', 'Field', 'stories']),
forms(({ actions }) => ({
diff --git a/frontend/src/lib/lemon-ui/LemonField/LemonField.test.tsx b/frontend/src/lib/lemon-ui/LemonField/LemonField.test.tsx
index bf9ad1578734..0be809e68b89 100644
--- a/frontend/src/lib/lemon-ui/LemonField/LemonField.test.tsx
+++ b/frontend/src/lib/lemon-ui/LemonField/LemonField.test.tsx
@@ -1,15 +1,104 @@
import '@testing-library/jest-dom'
import { cleanup, render, screen } from '@testing-library/react'
-import { kea, path } from 'kea'
+import { MakeLogicType, kea, path } from 'kea'
import { Form, forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
import { initKeaTests } from '~/test/init'
import { LemonField } from './LemonField'
-import type { lemonFieldTestLogicType } from './LemonField.testType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonFieldTestLogicValues {
+ isMyFormSubmitting: boolean
+ isMyFormValid: boolean
+ myForm: {
+ email: string
+ referral_source: string
+ }
+ myFormAllErrors: Record<string, any>
+ myFormChanged: boolean
+ myFormErrors: DeepPartialMap<
+ {
+ email: string
+ referral_source: string
+ },
+ ValidationErrorType
+ >
+ myFormHasErrors: boolean
+ myFormManualErrors: Record<string, any>
+ myFormTouched: boolean
+ myFormTouches: Record<string, boolean>
+ myFormValidationErrors: DeepPartialMap<
+ {
+ email: string
+ referral_source: string
+ },
+ ValidationErrorType
+ >
+ showMyFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface lemonFieldTestLogicActions {
+ resetMyForm: (values?: { email: string; referral_source: string }) => {
+ values?: {
+ email: string
+ referral_source: string
+ }
+ }
+ setMyFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setMyFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setMyFormValues: (
+ values: DeepPartial<{
+ email: string
+ referral_source: string
+ }>
+ ) => {
+ values: DeepPartial<{
+ email: string
+ referral_source: string
+ }>
+ }
+ submitMyForm: () => {
+ value: boolean
+ }
+ submitMyFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitMyFormRequest: (myForm: { email: string; referral_source: string }) => {
+ myForm: {
+ email: string
+ referral_source: string
+ }
+ }
+ submitMyFormSuccess: (myForm: { email: string; referral_source: string }) => {
+ myForm: {
+ email: string
+ referral_source: string
+ }
+ }
+ touchMyFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type lemonFieldTestLogicType = MakeLogicType<lemonFieldTestLogicValues, lemonFieldTestLogicActions>
const lemonFieldTestLogic = kea<lemonFieldTestLogicType>([
path(['lib', 'lemon-ui', 'LemonField', 'test']),
diff --git a/frontend/src/lib/lemon-ui/LemonTextArea/emojiUsageLogic.ts b/frontend/src/lib/lemon-ui/LemonTextArea/emojiUsageLogic.ts
index 8411a50157b6..a24ca4e40a57 100644
--- a/frontend/src/lib/lemon-ui/LemonTextArea/emojiUsageLogic.ts
+++ b/frontend/src/lib/lemon-ui/LemonTextArea/emojiUsageLogic.ts
@@ -1,12 +1,37 @@
-import { actions, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'
import { now } from 'lib/dayjs'
import { permanentlyMount } from 'lib/utils/kea-logic-builders'
-import type { emojiUsageLogicType } from './emojiUsageLogicType'
-
export const defaultQuickEmojis = ['💖', '👍', '🤔', '👎', '🌶️']
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface emojiUsageLogicValues {
+ favouriteEmojis: string[]
+ usedEmojis: Record<string, number[]>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface emojiUsageLogicActions {
+ emojiUsed: (emoji: string) => {
+ emoji: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface emojiUsageLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ favouriteEmojis: (usedEmojis: Record<string, number[]>) => string[]
+ }
+}
+
+export type emojiUsageLogicType = MakeLogicType<
+ emojiUsageLogicValues,
+ emojiUsageLogicActions,
+ Record<string, any>,
+ emojiUsageLogicMeta
+>
+
export const emojiUsageLogic = kea<emojiUsageLogicType>([
path(['lib', 'lemon-ui', 'LemonTextArea', 'emojiUsage', 'logic']),
actions({
@@ -43,7 +68,7 @@ export const emojiUsageLogic = kea<emojiUsageLogicType>([
selectors({
favouriteEmojis: [
(s) => [s.usedEmojis],
- (usedEmojis): string[] => {
+ (usedEmojis: Record<string, number[]>): string[] => {
// Get user's favorite emojis sorted by usage count
const userFavorites = Object.entries(usedEmojis)
.map(([emoji, timestamps]) => ({
diff --git a/frontend/src/lib/logic/apiStatusLogic.ts b/frontend/src/lib/logic/apiStatusLogic.ts
index 2aec00c05b6e..c0bc3193da3e 100644
--- a/frontend/src/lib/logic/apiStatusLogic.ts
+++ b/frontend/src/lib/logic/apiStatusLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,7 +6,34 @@ import api from 'lib/api'
import { twoFactorLogic } from 'scenes/authentication/two-factor-setup/twoFactorLogic'
import { userLogic } from 'scenes/userLogic'
-import type { apiStatusLogicType } from './apiStatusLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface apiStatusLogicValues {
+ internetConnectionIssue: boolean
+ timeSensitiveAuthenticationRequired: boolean | [onSuccess: () => void, onFailure: () => void]
+ twoFactorVerificationExpiredToastShown: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface apiStatusLogicActions {
+ onApiResponse: (
+ response?: Response,
+ error?: any
+ ) => {
+ error: any
+ response: Response | undefined
+ }
+ setInternetConnectionIssue: (issue: boolean) => {
+ issue: boolean
+ }
+ setTimeSensitiveAuthenticationRequired: (required: boolean | [onSuccess: () => void, onFailure: () => void]) => {
+ required: boolean | [onSuccess: () => void, onFailure: () => void]
+ }
+ setTwoFactorVerificationExpiredToastShown: (shown: boolean) => {
+ shown: boolean
+ }
+}
+
+export type apiStatusLogicType = MakeLogicType<apiStatusLogicValues, apiStatusLogicActions>
export const apiStatusLogic = kea<apiStatusLogicType>([
path(['lib', 'apiStatusLogic']),
diff --git a/frontend/src/lib/logic/bindModalToUrl.test.ts b/frontend/src/lib/logic/bindModalToUrl.test.ts
index 448d734c9f94..9687ac4f83cd 100644
--- a/frontend/src/lib/logic/bindModalToUrl.test.ts
+++ b/frontend/src/lib/logic/bindModalToUrl.test.ts
@@ -1,11 +1,27 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { router } from 'kea-router'
import { expectLogic } from 'kea-test-utils'
import { initKeaTests } from '~/test/init'
import { bindModalToUrl } from './bindModalToUrl'
-import type { testModalLogicType } from './bindModalToUrl.testType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface testModalLogicValues {
+ isOpen: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface testModalLogicActions {
+ hideModal: () => {
+ value: true
+ }
+ showModal: () => {
+ value: true
+ }
+}
+
+export type testModalLogicType = MakeLogicType<testModalLogicValues, testModalLogicActions>
// Minimal logic wired to `?modal=test-modal` for exercising bindModalToUrl
const testModalLogic = kea<testModalLogicType>([
diff --git a/frontend/src/lib/logic/dataThemeLogic.tsx b/frontend/src/lib/logic/dataThemeLogic.tsx
index 8518df5805ab..e0b790234beb 100644
--- a/frontend/src/lib/logic/dataThemeLogic.tsx
+++ b/frontend/src/lib/logic/dataThemeLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, path, props, reducers, selectors, useValues } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, path, props, reducers, selectors, useValues } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,7 @@ import { teamLogic } from 'scenes/teamLogic'
import { DataColorThemeModel } from '~/types'
-import type { dataThemeLogicType } from './dataThemeLogicType'
+import type { TeamPublicType, TeamType } from '../../types'
export function getColorFromToken(theme: DataColorTheme, colorToken: string): string {
const colorNo = parseInt(colorToken.replace('preset-', ''))
@@ -29,6 +29,69 @@ export type DataThemeLogicProps = {
themes?: DataColorThemeModel[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataThemeLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ defaultTheme: DataColorThemeModel | null
+ getAvailableColorTokens: (themeId: number | string | null | undefined) => DataColorToken[] | null
+ getColorFromToken: (themeId: number | string | null | undefined, colorToken: string) => string | null
+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null
+ posthogTheme: DataColorThemeModel | null | undefined
+ themes: DataColorThemeModel[] | null
+ themesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataThemeLogicActions {
+ loadThemes: () => any
+ loadThemesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadThemesSuccess: (
+ themes: DataColorThemeModel[],
+ payload?: any
+ ) => {
+ themes: DataColorThemeModel[]
+ payload?: any
+ }
+ setThemes: (themes: any) => {
+ themes: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataThemeLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ posthogTheme: (themes: DataColorThemeModel[] | null) => DataColorThemeModel | null | undefined
+ defaultTheme: (
+ currentTeam: TeamPublicType | TeamType | null,
+ themes: DataColorThemeModel[] | null,
+ posthogTheme: DataColorThemeModel | null | undefined
+ ) => DataColorThemeModel | null
+ getTheme: (
+ themes: DataColorThemeModel[] | null,
+ defaultTheme: DataColorThemeModel | null
+ ) => (themeId: number | string | null | undefined) => DataColorTheme | null
+ getColorFromToken: (
+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null
+ ) => (themeId: number | string | null | undefined, colorToken: string) => string | null
+ getAvailableColorTokens: (
+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null
+ ) => (themeId: number | string | null | undefined) => DataColorToken[] | null
+ }
+}
+
+export type dataThemeLogicType = MakeLogicType<
+ dataThemeLogicValues,
+ dataThemeLogicActions,
+ DataThemeLogicProps,
+ dataThemeLogicMeta
+>
+
export const dataThemeLogic = kea<dataThemeLogicType>([
props({} as DataThemeLogicProps),
path(['scenes', 'dataThemeLogic']),
@@ -50,7 +113,7 @@ export const dataThemeLogic = kea<dataThemeLogicType>([
selectors({
posthogTheme: [
(s) => [s.themes],
- (themes) => {
+ (themes: DataColorThemeModel[] | null) => {
if (!themes) {
return null
}
@@ -60,7 +123,11 @@ export const dataThemeLogic = kea<dataThemeLogicType>([
],
defaultTheme: [
(s) => [s.currentTeam, s.themes, s.posthogTheme],
- (currentTeam, themes, posthogTheme): DataColorThemeModel | null => {
+ (
+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,
+ themes: DataColorThemeModel[] | null,
+ posthogTheme: DataColorThemeModel | null | undefined
+ ): DataColorThemeModel | null => {
if (!themes) {
return null
}
@@ -74,7 +141,7 @@ export const dataThemeLogic = kea<dataThemeLogicType>([
],
getTheme: [
(s) => [s.themes, s.defaultTheme],
- (themes, defaultTheme) =>
+ (themes: DataColorThemeModel[] | null, defaultTheme: DataColorThemeModel | null) =>
(themeId: string | number | null | undefined): DataColorTheme | null => {
let customTheme
diff --git a/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts b/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
index caf94154ed58..74a7e1246ec7 100644
--- a/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
+++ b/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
@@ -1,11 +1,9 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { lazyLoaders } from 'kea-loaders'
import api from 'lib/api'
import { teamLogic } from 'scenes/teamLogic'
-import type { eventIngestionRestrictionLogicType } from './eventIngestionRestrictionLogicType'
-
export enum RestrictionType {
DROP_EVENT_FROM_INGESTION = 'drop_event_from_ingestion',
SKIP_PERSON_PROCESSING = 'skip_person_processing',
@@ -17,6 +15,47 @@ export interface EventIngestionRestriction {
distinct_ids: string[] | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventIngestionRestrictionLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ eventIngestionRestrictions: EventIngestionRestriction[]
+ eventIngestionRestrictionsLoading: boolean
+ hasProjectNoticeRestriction: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventIngestionRestrictionLogicActions {
+ loadEventIngestionRestrictions: () => any
+ loadEventIngestionRestrictionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEventIngestionRestrictionsSuccess: (
+ eventIngestionRestrictions: any[],
+ payload?: any
+ ) => {
+ eventIngestionRestrictions: any[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventIngestionRestrictionLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasProjectNoticeRestriction: (eventIngestionRestrictions: EventIngestionRestriction[]) => boolean
+ }
+}
+
+export type eventIngestionRestrictionLogicType = MakeLogicType<
+ eventIngestionRestrictionLogicValues,
+ eventIngestionRestrictionLogicActions,
+ Record<string, any>,
+ eventIngestionRestrictionLogicMeta
+>
+
export const eventIngestionRestrictionLogic = kea<eventIngestionRestrictionLogicType>([
path(['lib', 'logic', 'eventIngestionRestrictionLogic']),
diff --git a/frontend/src/lib/logic/featureFlagLogic.ts b/frontend/src/lib/logic/featureFlagLogic.ts
index 41917cb9a914..03495606530e 100644
--- a/frontend/src/lib/logic/featureFlagLogic.ts
+++ b/frontend/src/lib/logic/featureFlagLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, path, reducers } from 'kea'
import posthog from 'posthog-js'
import { FeatureFlagKey } from 'lib/constants'
@@ -6,8 +6,6 @@ import { getAppContext } from 'lib/utils/getAppContext'
import { AppContext } from '~/types'
-import type { featureFlagLogicType } from './featureFlagLogicType'
-
export type FeatureFlagsSet = {
[flag in FeatureFlagKey]?: boolean | string
}
@@ -90,6 +88,25 @@ export function getFeatureFlagPayload(flag: FeatureFlagKey): any {
return posthog.getFeatureFlagResult(flag, { send_event: false })?.payload
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface featureFlagLogicValues {
+ featureFlags: FeatureFlagsSet
+ receivedFeatureFlags: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface featureFlagLogicActions {
+ setFeatureFlags: (
+ flags: string[],
+ variants: Record<string, boolean | string>
+ ) => {
+ flags: string[]
+ variants: Record<string, boolean | string>
+ }
+}
+
+export type featureFlagLogicType = MakeLogicType<featureFlagLogicValues, featureFlagLogicActions>
+
export const featureFlagLogic = kea<featureFlagLogicType>([
path(['lib', 'logic', 'featureFlagLogic']),
actions({
diff --git a/frontend/src/lib/logic/preflightLogic.tsx b/frontend/src/lib/logic/preflightLogic.tsx
index 07118062f373..3c9730c2ecff 100644
--- a/frontend/src/lib/logic/preflightLogic.tsx
+++ b/frontend/src/lib/logic/preflightLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -9,8 +9,6 @@ import { urls } from 'scenes/urls'
import { PreflightStatus, Realm } from '~/types'
-import type { preflightLogicType } from './preflightLogicType'
-
export type PreflightMode = 'experimentation' | 'live'
export type PreflightCheckStatus = 'validated' | 'error' | 'warning' | 'optional'
@@ -33,6 +31,93 @@ export interface EnvironmentConfigOption {
value: string | undefined
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface preflightLogicValues {
+ areChecksExpanded: boolean
+ areChecksManuallyExpanded: boolean | null
+ checks: PreflightItem[]
+ checksSummary: PreflightCheckSummary
+ configOptions: EnvironmentConfigOption[]
+ disableNavigationHooks: boolean | undefined
+ isCloud: boolean | undefined
+ isCloudOrDev: boolean | undefined
+ isDev: boolean | undefined
+ isHobby: boolean
+ isTest: boolean
+ objectStorageAvailable: boolean
+ preflight: PreflightStatus | null
+ preflightLoading: boolean
+ preflightMode: PreflightMode | null
+ realm: Realm | null
+ siteUrlMisconfigured: boolean
+ socialAuthAvailable: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface preflightLogicActions {
+ handlePreflightFinished: () => {
+ value: true
+ }
+ loadPreflight: () => any
+ loadPreflightFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPreflightSuccess: (
+ preflight: PreflightStatus,
+ payload?: any
+ ) => {
+ preflight: PreflightStatus
+ payload?: any
+ }
+ registerInstrumentationProps: () => {
+ value: true
+ }
+ revalidatePreflight: () => {
+ value: true
+ }
+ setChecksManuallyExpanded: (expanded: boolean | null) => {
+ expanded: boolean | null
+ }
+ setPreflightMode: (
+ mode: PreflightMode | null,
+ noReload?: boolean
+ ) => {
+ mode: PreflightMode | null
+ noReload: boolean | undefined
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface preflightLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ checks: (preflight: PreflightStatus | null, preflightMode: PreflightMode | null) => PreflightItem[]
+ checksSummary: (checks: PreflightItem[]) => PreflightCheckSummary
+ areChecksExpanded: (checksSummary: PreflightCheckSummary, areChecksManuallyExpanded: boolean | null) => boolean
+ socialAuthAvailable: (preflight: PreflightStatus | null) => boolean
+ objectStorageAvailable: (preflight: PreflightStatus | null) => boolean
+ realm: (preflight: PreflightStatus | null) => Realm | null
+ siteUrlMisconfigured: (preflight: PreflightStatus | null) => boolean
+ configOptions: (preflight: PreflightStatus | null) => EnvironmentConfigOption[]
+ isCloudOrDev: (preflight: PreflightStatus | null) => boolean | undefined
+ isTest: (preflight: PreflightStatus | null) => boolean
+ isHobby: (isCloudOrDev: boolean | undefined, isTest: boolean) => boolean
+ isCloud: (preflight: PreflightStatus | null) => boolean | undefined
+ isDev: (preflight: PreflightStatus | null) => boolean | undefined
+ disableNavigationHooks: (preflight: PreflightStatus | null) => boolean | undefined
+ }
+}
+
+export type preflightLogicType = MakeLogicType<
+ preflightLogicValues,
+ preflightLogicActions,
+ Record<string, any>,
+ preflightLogicMeta
+>
+
export const preflightLogic = kea<preflightLogicType>([
path(['scenes', 'PreflightCheck', 'preflightLogic']),
loaders({
@@ -70,7 +155,7 @@ export const preflightLogic = kea<preflightLogicType>([
selectors({
checks: [
(s) => [s.preflight, s.preflightMode],
- (preflight, preflightMode) => {
+ (preflight: PreflightStatus | null, preflightMode: PreflightMode | null) => {
const preflightItems = [
{
id: 'database',
@@ -169,7 +254,7 @@ export const preflightLogic = kea<preflightLogicType>([
],
checksSummary: [
(s) => [s.checks],
- (checks): PreflightCheckSummary => {
+ (checks: PreflightItem[]): PreflightCheckSummary => {
const statusCounts = {} as Record<PreflightCheckStatus, number>
if (checks.length > 0) {
for (const check of checks) {
@@ -200,22 +285,22 @@ export const preflightLogic = kea<preflightLogicType>([
],
areChecksExpanded: [
(s) => [s.checksSummary, s.areChecksManuallyExpanded],
- (checksSummary, areChecksManuallyExpanded) => {
+ (checksSummary: PreflightCheckSummary, areChecksManuallyExpanded: boolean | null) => {
return areChecksManuallyExpanded ?? checksSummary?.summaryStatus !== 'validated'
},
],
socialAuthAvailable: [
(s) => [s.preflight],
- (preflight): boolean =>
+ (preflight: PreflightStatus | null): boolean =>
Boolean(preflight && Object.values(preflight.available_social_auth_providers).filter((i) => i).length),
],
objectStorageAvailable: [
(s) => [s.preflight],
- (preflight): boolean => Boolean(preflight && preflight.object_storage),
+ (preflight: PreflightStatus | null): boolean => Boolean(preflight && preflight.object_storage),
],
realm: [
(s) => [s.preflight],
- (preflight): Realm | null => {
+ (preflight: PreflightStatus | null): Realm | null => {
if (!preflight) {
return null
}
@@ -224,7 +309,7 @@ export const preflightLogic = kea<preflightLogicType>([
],
siteUrlMisconfigured: [
(s) => [s.preflight],
- (preflight): boolean => {
+ (preflight: PreflightStatus | null): boolean => {
if (process?.env.STORYBOOK) {
// Disable the "site URL misconfigured" warning in Storybook. This is for consistent snapshots
// - when opening Storybook in the browser or when updating the snapshots in CI, the origin is
@@ -246,7 +331,7 @@ export const preflightLogic = kea<preflightLogicType>([
],
configOptions: [
(s) => [s.preflight],
- (preflight): EnvironmentConfigOption[] => {
+ (preflight: PreflightStatus | null): EnvironmentConfigOption[] => {
// Returns the preflight config options to display in the /instance/status page
const RELEVANT_CONFIGS = [
@@ -268,27 +353,30 @@ export const preflightLogic = kea<preflightLogicType>([
],
isCloudOrDev: [
(s) => [s.preflight],
- (preflight): boolean | undefined => {
+ (preflight: PreflightStatus | null): boolean | undefined => {
return preflight?.cloud || preflight?.is_debug
},
],
- isTest: [(s) => [s.preflight], (preflight) => !!preflight?.is_test],
- isHobby: [(s) => [s.isCloudOrDev, s.isTest], (isCloudOrDev, isTest) => !isCloudOrDev && !isTest],
+ isTest: [(s) => [s.preflight], (preflight: PreflightStatus | null) => !!preflight?.is_test],
+ isHobby: [
+ (s) => [s.isCloudOrDev, s.isTest],
+ (isCloudOrDev: boolean | undefined, isTest: boolean) => !isCloudOrDev && !isTest,
+ ],
isCloud: [
(s) => [s.preflight],
- (preflight): boolean | undefined => {
+ (preflight: PreflightStatus | null): boolean | undefined => {
return preflight?.cloud
},
],
isDev: [
(s) => [s.preflight],
- (preflight): boolean | undefined => {
+ (preflight: PreflightStatus | null): boolean | undefined => {
return preflight?.is_debug
},
],
disableNavigationHooks: [
(s) => [s.preflight],
- (preflight): boolean | undefined => {
+ (preflight: PreflightStatus | null): boolean | undefined => {
return preflight?.dev_disable_navigation_hooks
},
],
diff --git a/frontend/src/lib/logic/scenes/useAttachedLogic.test.tsx b/frontend/src/lib/logic/scenes/useAttachedLogic.test.tsx
index 552b96586bd4..51f81f7f8582 100644
--- a/frontend/src/lib/logic/scenes/useAttachedLogic.test.tsx
+++ b/frontend/src/lib/logic/scenes/useAttachedLogic.test.tsx
@@ -1,10 +1,12 @@
import { cleanup, renderHook } from '@testing-library/react'
-import { BuiltLogic, Logic, kea, path } from 'kea'
+import { MakeLogicType, BuiltLogic, Logic, kea, path } from 'kea'
import { initKeaTests } from '~/test/init'
import { useAttachedLogic } from './useAttachedLogic'
-import type { parentLogicType } from './useAttachedLogic.testType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export type parentLogicType = MakeLogicType<{}, {}>
const parentLogic = kea<parentLogicType>([path(['lib', 'logic', 'scenes', 'useAttachedLogicTestParentLogic'])])
diff --git a/frontend/src/lib/logic/tabUiStateLogic.ts b/frontend/src/lib/logic/tabUiStateLogic.ts
index a67c4ba8a6f3..0d6f72e14a6d 100644
--- a/frontend/src/lib/logic/tabUiStateLogic.ts
+++ b/frontend/src/lib/logic/tabUiStateLogic.ts
@@ -1,15 +1,75 @@
-import { actions, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'
import type { Node } from '~/queries/schema/schema-general'
-import type { tabUiStateLogicType } from './tabUiStateLogicType'
-
const NO_TAB = '__no_tab__'
export type ExpandedRowsByTabAndVizKey = Record<string, Record<string, number[]>>
export type SavedQueriesByTabAndScene = Record<string, Record<string, Node>>
export type ChatDraftsByTab = Record<string, string>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tabUiStateLogicValues {
+ chatDraftFor: (tabId: string | undefined) => string
+ chatDraftsByTab: ChatDraftsByTab
+ expandedRowsByTabAndVizKey: ExpandedRowsByTabAndVizKey
+ expandedRowsFor: (tabId: string | undefined, vizKey: string) => number[]
+ savedQueriesByTabAndScene: SavedQueriesByTabAndScene
+ savedQueryFor: (tabId: string | undefined, sceneKey: string) => Node | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tabUiStateLogicActions {
+ clearTabUiState: (tabId: string) => {
+ tabId: string
+ }
+ setChatDraftForTab: (
+ tabId: string | undefined,
+ draft: string
+ ) => {
+ draft: string
+ tabId: string
+ }
+ setSavedQueryForTab: (
+ tabId: string | undefined,
+ sceneKey: string,
+ query: Node | null
+ ) => {
+ query: Node<Record<string, any>> | null
+ sceneKey: string
+ tabId: string
+ }
+ toggleExpandedRow: (
+ tabId: string | undefined,
+ vizKey: string,
+ rowIndex: number
+ ) => {
+ rowIndex: number
+ tabId: string
+ vizKey: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tabUiStateLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ expandedRowsFor: (
+ expandedRowsByTabAndVizKey: ExpandedRowsByTabAndVizKey
+ ) => (tabId: string | undefined, vizKey: string) => number[]
+ savedQueryFor: (
+ savedQueriesByTabAndScene: SavedQueriesByTabAndScene
+ ) => (tabId: string | undefined, sceneKey: string) => Node | null
+ chatDraftFor: (chatDraftsByTab: ChatDraftsByTab) => (tabId: string | undefined) => string
+ }
+}
+
+export type tabUiStateLogicType = MakeLogicType<
+ tabUiStateLogicValues,
+ tabUiStateLogicActions,
+ Record<string, any>,
+ tabUiStateLogicMeta
+>
+
export const tabUiStateLogic = kea<tabUiStateLogicType>([
path(['lib', 'logic', 'tabUiStateLogic']),
actions({
@@ -113,19 +173,19 @@ export const tabUiStateLogic = kea<tabUiStateLogicType>([
selectors({
expandedRowsFor: [
(s) => [s.expandedRowsByTabAndVizKey],
- (state): ((tabId: string | undefined, vizKey: string) => number[]) =>
+ (state: ExpandedRowsByTabAndVizKey): ((tabId: string | undefined, vizKey: string) => number[]) =>
(tabId, vizKey) =>
state[tabId ?? NO_TAB]?.[vizKey] ?? [],
],
savedQueryFor: [
(s) => [s.savedQueriesByTabAndScene],
- (state): ((tabId: string | undefined, sceneKey: string) => Node | null) =>
+ (state: SavedQueriesByTabAndScene): ((tabId: string | undefined, sceneKey: string) => Node | null) =>
(tabId, sceneKey) =>
state[tabId ?? NO_TAB]?.[sceneKey] ?? null,
],
chatDraftFor: [
(s) => [s.chatDraftsByTab],
- (state): ((tabId: string | undefined) => string) =>
+ (state: ChatDraftsByTab): ((tabId: string | undefined) => string) =>
(tabId) =>
state[tabId ?? NO_TAB] ?? '',
],
diff --git a/frontend/src/lib/logic/themeLogic.ts b/frontend/src/lib/logic/themeLogic.ts
index 52d697061c08..f43db6dfbf7b 100644
--- a/frontend/src/lib/logic/themeLogic.ts
+++ b/frontend/src/lib/logic/themeLogic.ts
@@ -1,13 +1,74 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { sceneLogic } from 'scenes/sceneLogic'
import { userLogic } from 'scenes/userLogic'
-import type { themeLogicType } from './themeLogicType'
+import type { UserTheme, UserType } from '../../types'
+import type { FeatureFlagsSet } from './featureFlagLogic'
import { Theme, themes } from './themes'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface themeLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ themeMode: UserTheme // userLogic
+ customCss: string | null
+ customCssEnabled: boolean
+ darkModeSystemPreference: boolean
+ isDarkModeOn: boolean
+ persistedCustomCss: string | null
+ previewingCustomCss: string | null
+ selectedTheme: string | null
+ theme: Theme | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface themeLogicActions {
+ updateUser: (
+ user: Partial<UserType>,
+ successCallback?: () => void
+ ) => {
+ successCallback: (() => void) | undefined
+ user: Partial<UserType>
+ } // userLogic
+ saveCustomCss: () => {
+ value: true
+ }
+ setPersistedCustomCss: (css: string | null) => {
+ css: string | null
+ }
+ setPreviewingCustomCss: (css: string | null) => {
+ css: string | null
+ }
+ setTheme: (theme: string | null) => {
+ theme: string | null
+ }
+ syncDarkModePreference: (darkModePreference: boolean) => {
+ darkModePreference: boolean
+ }
+ toggleTheme: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface themeLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ theme: (selectedTheme: string | null, featureFlags: FeatureFlagsSet) => Theme | null
+ customCssEnabled: (featureFlags: FeatureFlagsSet) => boolean
+ customCss: (persistedCustomCss: string | null, previewingCustomCss: string | null) => string | null
+ isDarkModeOn: (
+ themeMode: UserTheme,
+ darkModeSystemPreference: boolean,
+ sceneConfig: null | import('../../scenes/sceneTypes').SceneConfig,
+ theme: Theme | null
+ ) => boolean
+ }
+}
+
+export type themeLogicType = MakeLogicType<themeLogicValues, themeLogicActions, Record<string, any>, themeLogicMeta>
+
export const themeLogic = kea<themeLogicType>([
path(['layout', 'navigation-3000', 'themeLogic']),
connect(() => ({
@@ -56,7 +117,10 @@ export const themeLogic = kea<themeLogicType>([
selectors({
theme: [
(s) => [s.selectedTheme, s.featureFlags],
- (selectedTheme, featureFlags): Theme | null => {
+ (
+ selectedTheme: string | null,
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): Theme | null => {
const flagVariant = featureFlags[FEATURE_FLAGS.THEME_OVERRIDE]
return (
(selectedTheme ? themes.find((theme) => theme.id === selectedTheme) : null) ??
@@ -67,15 +131,22 @@ export const themeLogic = kea<themeLogicType>([
],
customCssEnabled: [
(s) => [s.featureFlags],
- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.CUSTOM_CSS_THEMES],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.CUSTOM_CSS_THEMES],
],
customCss: [
(s) => [s.persistedCustomCss, s.previewingCustomCss],
- (persistedCustomCss, previewingCustomCss): string | null => previewingCustomCss || persistedCustomCss,
+ (persistedCustomCss: string | null, previewingCustomCss: string | null): string | null =>
+ previewingCustomCss || persistedCustomCss,
],
isDarkModeOn: [
(s) => [s.themeMode, s.darkModeSystemPreference, sceneLogic.selectors.sceneConfig, s.theme],
- (themeMode, darkModeSystemPreference, sceneConfig, theme) => {
+ (
+ themeMode: import('../../types').UserTheme,
+ darkModeSystemPreference: boolean,
+ sceneConfig: null | import('../../scenes/sceneTypes').SceneConfig,
+ theme: Theme | null
+ ) => {
if (
typeof window !== 'undefined' &&
window.document &&
diff --git a/frontend/src/lib/logic/userPreferencesLogic.ts b/frontend/src/lib/logic/userPreferencesLogic.ts
index 9a0dd7663e23..db73d6833f9c 100644
--- a/frontend/src/lib/logic/userPreferencesLogic.ts
+++ b/frontend/src/lib/logic/userPreferencesLogic.ts
@@ -1,9 +1,46 @@
-import { actions, connect, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers } from 'kea'
import { PERSON_DEFAULT_DISPLAY_NAME_PROPERTIES } from 'lib/constants'
import { teamLogic } from 'scenes/teamLogic'
-import type { userPreferencesLogicType } from './userPreferencesLogicType'
+import type { TeamPublicType, TeamType } from '../../types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userPreferencesLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ editorVimModeEnabled: boolean
+ hideNullValues: boolean
+ hidePostHogPropertiesInTable: boolean
+ pinnedGroupProperties: string[]
+ pinnedPersonProperties: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userPreferencesLogicActions {
+ pinGroupProperty: (prop: string) => {
+ prop: string
+ }
+ pinPersonProperty: (prop: string) => {
+ prop: string
+ }
+ setEditorVimModeEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setHideNullValues: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setHidePostHogPropertiesInTable: (enabled: boolean) => {
+ enabled: boolean
+ }
+ unpinGroupProperty: (prop: string) => {
+ prop: string
+ }
+ unpinPersonProperty: (prop: string) => {
+ prop: string
+ }
+}
+
+export type userPreferencesLogicType = MakeLogicType<userPreferencesLogicValues, userPreferencesLogicActions>
// This logic is for browser stored user preferences where it's not super important that it is persisted to the server
export const userPreferencesLogic = kea<userPreferencesLogicType>([
diff --git a/frontend/src/lib/memory/autofillReleaseLogic.ts b/frontend/src/lib/memory/autofillReleaseLogic.ts
index bd31ba405792..a78adab7944e 100644
--- a/frontend/src/lib/memory/autofillReleaseLogic.ts
+++ b/frontend/src/lib/memory/autofillReleaseLogic.ts
@@ -1,10 +1,36 @@
-import { afterMount, connect, kea, listeners, path } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'
import { router } from 'kea-router'
-
-import type { autofillReleaseLogicType } from './autofillReleaseLogicType'
+import type { LocationChangedPayload } from 'kea-router/lib/types'
const SINK_ID = 'autofill-release-sink'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface autofillReleaseLogicActions {
+ locationChanged: ({
+ method,
+ pathname,
+ search,
+ searchParams,
+ hash,
+ hashParams,
+ initial,
+ url,
+ routerState,
+ }: LocationChangedPayload) => {
+ hash: string
+ hashParams: Record<string, any>
+ initial: boolean
+ method: 'POP' | 'PUSH' | 'REPLACE'
+ pathname: string
+ routerState: Record<string, any>
+ search: string
+ searchParams: Record<string, any>
+ url: string
+ } // router
+}
+
+export type autofillReleaseLogicType = MakeLogicType<{}, autofillReleaseLogicActions>
+
/**
* Workaround for a Chromium AutofillAgent retention bug.
*
diff --git a/frontend/src/lib/monaco/CodeEditorImpl.tsx b/frontend/src/lib/monaco/CodeEditorImpl.tsx
index 146ee8bcd108..4920795221ad 100644
--- a/frontend/src/lib/monaco/CodeEditorImpl.tsx
+++ b/frontend/src/lib/monaco/CodeEditorImpl.tsx
@@ -12,7 +12,7 @@ import { usePageVisibility } from 'lib/hooks/usePageVisibility'
import { Spinner } from 'lib/lemon-ui/Spinner'
import { themeLogic } from 'lib/logic/themeLogic'
import { codeEditorLogic } from 'lib/monaco/codeEditorLogic'
-import { codeEditorLogicType } from 'lib/monaco/codeEditorLogicType'
+import type { codeEditorLogicType } from 'lib/monaco/codeEditorLogic'
import { findNextFocusableElement, findPreviousFocusableElement } from 'lib/monaco/domUtils'
import { trackFindWidgetVisibility } from 'lib/monaco/findWidgetBodyClass'
import { initCodeownersLanguage } from 'lib/monaco/languages/codeowners'
diff --git a/frontend/src/lib/monaco/codeEditorLogic.tsx b/frontend/src/lib/monaco/codeEditorLogic.tsx
index ac592f6e1588..48db75457556 100644
--- a/frontend/src/lib/monaco/codeEditorLogic.tsx
+++ b/frontend/src/lib/monaco/codeEditorLogic.tsx
@@ -1,5 +1,5 @@
import type { Monaco } from '@monaco-editor/react'
-import { actions, connect, kea, key, path, props, propsChanged, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, propsChanged, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
// Note: we can oly import types and not values from monaco-editor, because otherwise some Monaco code breaks
@@ -25,7 +25,7 @@ import {
} from '~/queries/schema/schema-general'
import { setLatestVersionsOnQuery } from '~/queries/utils'
-import type { codeEditorLogicType } from './codeEditorLogicType'
+import type { FeatureFlagsSet } from '../logic/featureFlagLogic'
import { getContextSourceQuery } from './sourceQueryUtils'
const METADATA_LANGUAGES = [HogLanguage.hog, HogLanguage.hogQL, HogLanguage.hogQLExpr, HogLanguage.hogTemplate]
@@ -56,6 +56,86 @@ export interface CodeEditorLogicProps {
onFixWithAI?: (prompt: string) => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeEditorLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ error: string | null
+ hasErrors: boolean
+ metadata: [string, HogQLMetadataResponse] | null
+ metadataLoading: boolean
+ modelMarkers: ModelMarker[]
+ modelMarkersLoading: boolean
+ vimCommandHistory: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeEditorLogicActions {
+ appendVimCommand: (command: string) => {
+ command: string
+ }
+ reloadMetadata: () => {
+ value: true
+ }
+ reloadMetadataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ reloadMetadataSuccess: (
+ metadata: [string, HogQLMetadataResponse] | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ metadata: [string, HogQLMetadataResponse] | null
+ payload?: {
+ value: true
+ }
+ }
+ reloadMetadataSuccessFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ reloadMetadataSuccessSuccess: (
+ modelMarkers: ModelMarker[],
+ payload?: {
+ metadata: [string, HogQLMetadataResponse] | null
+ payload?: {
+ value: true
+ }
+ }
+ ) => {
+ modelMarkers: ModelMarker[]
+ payload?: {
+ metadata: [string, HogQLMetadataResponse] | null
+ payload?: {
+ value: true
+ }
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeEditorLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ hasErrors: (modelMarkers: ModelMarker[]) => boolean
+ error: (hasErrors: boolean, modelMarkers: ModelMarker[]) => string | null
+ }
+}
+
+export type codeEditorLogicType = MakeLogicType<
+ codeEditorLogicValues,
+ codeEditorLogicActions,
+ CodeEditorLogicProps,
+ codeEditorLogicMeta
+>
+
export const codeEditorLogic = kea<codeEditorLogicType>([
path(['lib', 'monaco', 'hogQLMetadataProvider']),
props({} as CodeEditorLogicProps),
@@ -181,11 +261,12 @@ export const codeEditorLogic = kea<codeEditorLogicType>([
selectors({
hasErrors: [
(s) => [s.modelMarkers],
- (modelMarkers) => !!(modelMarkers ?? []).filter((e) => e.severity === 8 /* MarkerSeverity.Error */).length,
+ (modelMarkers: ModelMarker[]) =>
+ !!(modelMarkers ?? []).filter((e) => e.severity === 8 /* MarkerSeverity.Error */).length,
],
error: [
(s) => [s.hasErrors, s.modelMarkers],
- (hasErrors, modelMarkers) => {
+ (hasErrors: boolean, modelMarkers: ModelMarker[]) => {
const firstError = modelMarkers.find((e) => e.severity === 8 /* MarkerSeverity.Error */)
return hasErrors && firstError
? `Error on line ${firstError.startLineNumber}, column ${firstError.startColumn}`
diff --git a/frontend/src/lib/monaco/hogQLAutocompleteProvider.ts b/frontend/src/lib/monaco/hogQLAutocompleteProvider.ts
index 97ba525b6303..e4f5567a7c4e 100644
--- a/frontend/src/lib/monaco/hogQLAutocompleteProvider.ts
+++ b/frontend/src/lib/monaco/hogQLAutocompleteProvider.ts
@@ -1,7 +1,7 @@
import { BuiltLogic } from 'kea'
import { languages } from 'monaco-editor'
-import type { codeEditorLogicType } from 'lib/monaco/codeEditorLogicType'
+import type { codeEditorLogicType } from 'lib/monaco/codeEditorLogic'
import { performQuery } from '~/queries/query'
import {
diff --git a/frontend/src/lib/monaco/hogQLMetadataProvider.tsx b/frontend/src/lib/monaco/hogQLMetadataProvider.tsx
index 050aa0d70ee3..28e87a1747e4 100644
--- a/frontend/src/lib/monaco/hogQLMetadataProvider.tsx
+++ b/frontend/src/lib/monaco/hogQLMetadataProvider.tsx
@@ -1,7 +1,7 @@
import { BuiltLogic } from 'kea'
import { languages } from 'monaco-editor'
-import type { codeEditorLogicType } from './codeEditorLogicType'
+import type { codeEditorLogicType } from './codeEditorLogic'
export const hogQLMetadataProvider: () => languages.CodeActionProvider = () => ({
provideCodeActions: (model, _range, context) => {
diff --git a/frontend/src/lib/monaco/modelLogicReference.ts b/frontend/src/lib/monaco/modelLogicReference.ts
index 6042f6be3393..4ab8b8ce36d4 100644
--- a/frontend/src/lib/monaco/modelLogicReference.ts
+++ b/frontend/src/lib/monaco/modelLogicReference.ts
@@ -1,7 +1,7 @@
import type { BuiltLogic } from 'kea'
import type { editor } from 'monaco-editor'
-import type { codeEditorLogicType } from 'lib/monaco/codeEditorLogicType'
+import type { codeEditorLogicType } from 'lib/monaco/codeEditorLogic'
export function initModel(model: editor.ITextModel, builtCodeEditorLogic: BuiltLogic<codeEditorLogicType>): void {
;(model as any).codeEditorLogic = builtCodeEditorLogic
diff --git a/frontend/src/lib/oauth/oauthLogic.ts b/frontend/src/lib/oauth/oauthLogic.ts
index 89c1ebb9cf6f..bc42ff7ad7ca 100644
--- a/frontend/src/lib/oauth/oauthLogic.ts
+++ b/frontend/src/lib/oauth/oauthLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import { urlToAction } from 'kea-router'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -7,9 +7,43 @@ import { getRelativeNextPath } from 'lib/utils/url'
import { Region } from '~/types'
import { buildAuthorizeUrl, clearSession, exchangeCodeForToken, OAUTH_REGIONS, PendingAuth } from './oauthClient'
-import type { oauthLogicType } from './oauthLogicType'
import { generateCodeVerifier, generateState } from './pkce'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface oauthLogicValues {
+ loginError: string | null
+ loginInProgress: boolean
+ pendingAuth: PendingAuth | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface oauthLogicActions {
+ beginLogin: (region: Region.US | Region.EU) => {
+ region: Region.US | Region.EU
+ }
+ clearPendingAuth: () => {
+ value: true
+ }
+ handleCallback: (
+ code: string,
+ state: string
+ ) => {
+ code: string
+ state: string
+ }
+ logout: () => {
+ value: true
+ }
+ setLoginError: (error: string | null) => {
+ error: string | null
+ }
+ setPendingAuth: (pending: PendingAuth) => {
+ pending: PendingAuth
+ }
+}
+
+export type oauthLogicType = MakeLogicType<oauthLogicValues, oauthLogicActions>
+
export const oauthLogic = kea<oauthLogicType>([
path(['lib', 'oauth', 'oauthLogic']),
actions({
diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts
index bb1ace49bd55..7454bb02e881 100644
--- a/frontend/src/lib/utils/eventUsageLogic.ts
+++ b/frontend/src/lib/utils/eventUsageLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path } from 'kea'
import posthog from 'posthog-js'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
@@ -74,7 +74,8 @@ import {
SurveyQuestionType,
} from '~/types'
-import type { eventUsageLogicType } from './eventUsageLogicType'
+import type { ExperimentMetricUnion } from '../../queries/schema/schema-general'
+import type { FunnelCorrelationResultsType, Realm, UserType } from '../../types'
export enum DashboardEventSource {
LongPress = 'long_press',
@@ -347,6 +348,1611 @@ function sanitizeQuery(query: Node | null): Record<string, string | number | boo
return objectClean(payload)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventUsageLogicValues {
+ realm: Realm | null // preflightLogic
+ user: UserType | null // userLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventUsageLogicActions {
+ reportAIChatOnboardingMessageSent: (
+ stepKey: OnboardingStepKey,
+ messageType: 'button' | 'chat'
+ ) => {
+ messageType: 'button' | 'chat'
+ stepKey: OnboardingStepKey
+ }
+ reportAIChatOnboardingStarted: (variant: string) => {
+ variant: string
+ }
+ reportAIChatOnboardingStepTime: (
+ stepKey: OnboardingStepKey,
+ timeSeconds: number
+ ) => {
+ stepKey: OnboardingStepKey
+ timeSeconds: number
+ }
+ reportAccountOwnerClicked: ({ name, email }: { email: string; name: string }) => {
+ email: string
+ name: string
+ }
+ reportActivationSideBarTaskClicked: (key: string) => {
+ key: string
+ }
+ reportActivityLogSettingToggled: (receive_org_level_activity_logs: boolean | null) => {
+ receive_org_level_activity_logs: boolean | null
+ }
+ reportAutocaptureExceptionsToggled: (autocapture_opt_in: boolean) => {
+ autocapture_opt_in: boolean
+ }
+ reportAutocaptureToggled: (autocapture_opt_out: boolean) => {
+ autocapture_opt_out: boolean
+ }
+ reportAxisUnitsChanged: (properties: Record<string, any>) => {
+ [x: string]: any
+ }
+ reportBillingAddonPlanSwitchStarted: (
+ fromProduct: string,
+ toProduct: string,
+ reason: 'downgrade' | 'upgrade'
+ ) => {
+ fromProduct: string
+ reason: 'downgrade' | 'upgrade'
+ toProduct: string
+ }
+ reportBillingCTAShown: () => {
+ value: true
+ }
+ reportBillingDowngradeClicked: (plan: string) => {
+ plan: string
+ }
+ reportBillingSpendInteraction: (properties: BillingUsageInteractionProps) => {
+ properties: BillingUsageInteractionProps
+ }
+ reportBillingUpgradeClicked: (plan: string) => {
+ plan: string
+ }
+ reportBillingUsageInteraction: (properties: BillingUsageInteractionProps) => {
+ properties: BillingUsageInteractionProps
+ }
+ reportBounceRatePageViewModeUpdated: (mode: string) => {
+ mode: string
+ }
+ reportChangeInnerPropertyGroupFiltersType: (
+ type: FilterLogicalOperator,
+ filtersLength: number
+ ) => {
+ filtersLength: number
+ type: FilterLogicalOperator
+ }
+ reportChangeOuterPropertyGroupFiltersType: (
+ type: FilterLogicalOperator,
+ groupsLength: number
+ ) => {
+ groupsLength: number
+ type: FilterLogicalOperator
+ }
+ reportCopiedDashboardTileToDashboard: (
+ fromDashboardId: number,
+ toDashboardId: number,
+ tileType: DashboardWidgetType
+ ) => {
+ fromDashboardId: number
+ tileType: DashboardWidgetType
+ toDashboardId: number
+ }
+ reportCorrelationInteraction: (
+ correlationType: FunnelCorrelation['result_type'],
+ action: string,
+ props?: Record<string, any>
+ ) => {
+ action: string
+ correlationType: FunnelCorrelationResultsType
+ props: Record<string, any> | undefined
+ }
+ reportCorrelationViewed: (
+ query: Node | null,
+ delay?: number,
+ propertiesTable?: boolean
+ ) => {
+ delay: number | undefined
+ propertiesTable: boolean | undefined
+ query: Node<Record<string, any>> | null
+ }
+ reportCreatedDashboardFromModal: () => {
+ value: true
+ }
+ reportCustomChannelTypeRulesUpdated: (numRules: number) => {
+ numRules: number
+ }
+ reportCustomerAnalyticsAddJoinButtonClicked: ({ table }: any) => {
+ table: any
+ }
+ reportCustomerAnalyticsDashboardBusinessModeChanged: ({ business_mode }: any) => {
+ business_mode: any
+ }
+ reportCustomerAnalyticsDashboardConfigurationButtonClicked: () => boolean
+ reportCustomerAnalyticsDashboardConfigurationViewed: () => boolean
+ reportCustomerAnalyticsDashboardConfigureEventWithAIClicked: ({ event }: any) => {
+ event: any
+ }
+ reportCustomerAnalyticsDashboardDateFilterApplied: ({ filter }: any) => {
+ filter: any
+ }
+ reportCustomerAnalyticsDashboardEventPickerClicked: ({ event }: any) => {
+ event: any
+ }
+ reportCustomerAnalyticsDashboardEventsSaved: () => boolean
+ reportCustomerAnalyticsViewed: (delay?: number) => {
+ delay: number | undefined
+ }
+ reportCustomerJourneyBuilderStepAdded: (
+ stepIndex: number,
+ stepCount: number
+ ) => {
+ stepCount: number
+ stepIndex: number
+ }
+ reportCustomerJourneyBuilderStepRemoved: (
+ stepIndex: number,
+ stepCount: number
+ ) => {
+ stepCount: number
+ stepIndex: number
+ }
+ reportCustomerJourneyCreated: (
+ journeyName: string,
+ stepCount: number,
+ creationSource: string | null
+ ) => {
+ creationSource: string | null
+ journeyName: string
+ stepCount: number
+ }
+ reportCustomerJourneyDeleted: (journeyId: string) => {
+ journeyId: string
+ }
+ reportCustomerJourneyExistingFunnelSelected: (insightId: number) => {
+ insightId: number
+ }
+ reportCustomerJourneyPathExpanded: (
+ pathType: string,
+ dropOff: boolean,
+ stepIndex: number
+ ) => {
+ dropOff: boolean
+ pathType: string
+ stepIndex: number
+ }
+ reportCustomerJourneyStepAddedFromPath: (
+ eventName: string,
+ pathType: string,
+ stepIndex: number
+ ) => {
+ eventName: string
+ pathType: string
+ stepIndex: number
+ }
+ reportCustomerJourneyStepsSavedFromEditor: (
+ stepsAdded: number,
+ journeyId: string | null
+ ) => {
+ journeyId: string | null
+ stepsAdded: number
+ }
+ reportCustomerJourneyTemplateSelected: (templateKey: string) => {
+ templateKey: string
+ }
+ reportCustomerJourneyUpdated: (
+ journeyId: string,
+ journeyName: string,
+ stepCount: number
+ ) => {
+ journeyId: string
+ journeyName: string
+ stepCount: number
+ }
+ reportCustomerJourneyViewed: (
+ journeyId: string,
+ journeyName: string,
+ stepCount: number,
+ delay?: number
+ ) => {
+ delay: number | undefined
+ journeyId: string
+ journeyName: string
+ stepCount: number
+ }
+ reportDashboardDateRangeChanged: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ dateFrom?: string | Dayjs | null,
+ dateTo?: string | Dayjs | null
+ ) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ dateFrom: string | Dayjs | null | undefined
+ dateTo: string | Dayjs | null | undefined
+ }
+ reportDashboardEditModeDiscardPrompt: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ action: 'discarded' | 'kept_editing' | 'shown'
+ ) => {
+ action: 'discarded' | 'kept_editing' | 'shown'
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ }
+ reportDashboardEmptyAiPromptClicked: (
+ promptLabel: string,
+ dashboardId: number | undefined
+ ) => {
+ dashboardId: number | undefined
+ promptLabel: string
+ }
+ reportDashboardFiltersChanged: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ changeType: DashboardFilterChangeType,
+ properties: Record<string, boolean | number | string | null | undefined>
+ ) => {
+ changeType: DashboardFilterChangeType
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ properties: Record<string, boolean | number | string | null | undefined>
+ }
+ reportDashboardFrontEndUpdate: (
+ dashboardId: number | undefined,
+ attribute: 'description' | 'name' | 'tags',
+ originalLength: number,
+ newLength: number
+ ) => {
+ attribute: 'description' | 'name' | 'tags'
+ dashboardId: number | undefined
+ newLength: number
+ originalLength: number
+ }
+ reportDashboardInsightAnnotationsToggled: (
+ dashboardId: number | undefined,
+ insightId: number,
+ source: DashboardEventSource
+ ) => {
+ dashboardId: number | undefined
+ insightId: number
+ source: DashboardEventSource
+ }
+ reportDashboardInsightLegendToggled: (
+ dashboardId: number | undefined,
+ insightId: number,
+ source: DashboardEventSource
+ ) => {
+ dashboardId: number | undefined
+ insightId: number
+ source: DashboardEventSource
+ }
+ reportDashboardInsightMetaUpdated: (
+ dashboardId: number | undefined,
+ insightId: number,
+ attribute: 'description' | 'name'
+ ) => {
+ attribute: 'description' | 'name'
+ dashboardId: number | undefined
+ insightId: number
+ }
+ reportDashboardInsightValuesOnSeriesToggled: (
+ dashboardId: number | undefined,
+ insightId: number,
+ source: DashboardEventSource
+ ) => {
+ dashboardId: number | undefined
+ insightId: number
+ source: DashboardEventSource
+ }
+ reportDashboardLayoutEditModeEntered: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ source: DashboardEventSource,
+ layoutZoom: number | null
+ ) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ layoutZoom: number | null
+ source: DashboardEventSource
+ }
+ reportDashboardLayoutZoomChanged: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ layoutZoom: number,
+ source: 'button' | 'shortcut'
+ ) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ layoutZoom: number
+ source: 'button' | 'shortcut'
+ }
+ reportDashboardListSearched: (
+ searchLength: number,
+ resultsCount: number
+ ) => {
+ resultsCount: number
+ searchLength: number
+ }
+ reportDashboardLoadingTime: (
+ loadingMilliseconds: number,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ loadingMilliseconds: number
+ }
+ reportDashboardModeToggled: (
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ mode: DashboardMode | null,
+ source: DashboardEventSource | null,
+ layoutZoom: number | null,
+ layoutEditMode?: boolean
+ ) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ layoutEditMode: boolean | undefined
+ layoutZoom: number | null
+ mode: DashboardMode | null
+ source: DashboardEventSource | null
+ }
+ reportDashboardMoveInitiated: (
+ method: 'bulk' | 'single',
+ count: number
+ ) => {
+ count: number
+ method: 'bulk' | 'single'
+ }
+ reportDashboardMovedToFolder: (props: {
+ fromDepth: number
+ fromUnfiled: boolean
+ toDepth: number
+ toUnfiled: boolean
+ }) => {
+ fromDepth: number
+ fromUnfiled: boolean
+ toDepth: number
+ toUnfiled: boolean
+ }
+ reportDashboardPinToggled: (
+ dashboardId: number,
+ pinned: boolean,
+ source: DashboardEventSource
+ ) => {
+ dashboardId: number
+ pinned: boolean
+ source: DashboardEventSource
+ }
+ reportDashboardPropertiesChanged: (dashboard: DashboardType<QueryBasedInsightModel> | null) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ }
+ reportDashboardRefreshed: (
+ dashboardId: number,
+ dashboard: DashboardType<QueryBasedInsightModel> | null,
+ filters: Record<string, any>,
+ variables: Record<string, any>,
+ lastRefreshed: string | Dayjs | null,
+ action: string,
+ forceRefresh: boolean,
+ insightsRefreshedInfo: {
+ refreshDurationMs: number
+ tilesAbortedCount: number
+ tilesErroredCount: number
+ tilesRefreshedCount: number
+ tilesStaleCount: number
+ totalTileCount: number
+ }
+ ) => {
+ action: string
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ dashboardId: number
+ filters: Record<string, any>
+ forceRefresh: boolean
+ insightsRefreshedInfo: {
+ refreshDurationMs: number
+ tilesAbortedCount: number
+ tilesErroredCount: number
+ tilesRefreshedCount: number
+ tilesStaleCount: number
+ totalTileCount: number
+ }
+ lastRefreshed: string | Dayjs | null
+ variables: Record<string, any>
+ }
+ reportDashboardShareToggled: (
+ dashboardId: number | undefined,
+ isShared: boolean
+ ) => {
+ dashboardId: number | undefined
+ isShared: boolean
+ }
+ reportDashboardTileInsertedInline: (
+ tileType: DashboardAddTileType,
+ column: number,
+ row: number,
+ fullWidth: boolean
+ ) => {
+ column: number
+ fullWidth: boolean
+ row: number
+ tileType: DashboardAddTileType
+ }
+ reportDashboardTileRefreshed: (
+ dashboardId: number,
+ tile: DashboardTile<QueryBasedInsightModel>,
+ filters: Record<string, any>,
+ variables: Record<string, any>,
+ refreshDurationMs: number,
+ individualRefresh: boolean
+ ) => {
+ dashboardId: number
+ filters: Record<string, any>
+ individualRefresh: boolean
+ refreshDurationMs: number
+ tile: DashboardTile<QueryBasedInsightModel<Node<Record<string, any>>>>
+ variables: Record<string, any>
+ }
+ reportDashboardTileRepositioned: (
+ dashboardId: number,
+ action: 'moved' | 'resized',
+ layoutZoom: number
+ ) => {
+ action: 'moved' | 'resized'
+ dashboardId: number
+ layoutZoom: number
+ }
+ reportDashboardViewed: (
+ dashboard: DashboardType<QueryBasedInsightModel>,
+ lastRefreshed: Dayjs | null,
+ delay?: number
+ ) => {
+ dashboard: DashboardType<QueryBasedInsightModel<Node<Record<string, any>>>>
+ delay: number | undefined
+ lastRefreshed: Dayjs | null
+ }
+ reportDashboardWhitelabelToggled: (
+ dashboardId: number | undefined,
+ isWhiteLabelled: boolean
+ ) => {
+ dashboardId: number | undefined
+ isWhiteLabelled: boolean
+ }
+ reportDashboardsTreeFolderNavigated: (
+ depth: number,
+ hasSubfolders: boolean
+ ) => {
+ depth: number
+ hasSubfolders: boolean
+ }
+ reportDataManagementDefinitionCancel: (type: TaxonomicFilterGroupType) => {
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementDefinitionClickEdit: (type: TaxonomicFilterGroupType) => {
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementDefinitionClickView: (type: TaxonomicFilterGroupType) => {
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementDefinitionHovered: (
+ type: TaxonomicFilterGroupType,
+ mediaPreviewCount?: number
+ ) => {
+ mediaPreviewCount: number | undefined
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementDefinitionSaveFailed: (
+ type: TaxonomicFilterGroupType,
+ loadTime: number,
+ error: string
+ ) => {
+ error: string
+ loadTime: number
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementDefinitionSaveSucceeded: (
+ type: TaxonomicFilterGroupType,
+ loadTime: number
+ ) => {
+ loadTime: number
+ type: TaxonomicFilterGroupType
+ }
+ reportDataManagementEventDefinitionsPageLoadFailed: (
+ loadTime: number,
+ error: string
+ ) => {
+ error: string
+ loadTime: number
+ }
+ reportDataManagementEventDefinitionsPageLoadSucceeded: (
+ loadTime: number,
+ resultsLength: number
+ ) => {
+ loadTime: number
+ resultsLength: number
+ }
+ reportDataManagementEventDefinitionsPageNestedPropertiesLoadFailed: (
+ loadTime: number,
+ error: string
+ ) => {
+ error: string
+ loadTime: number
+ }
+ reportDataManagementEventDefinitionsPageNestedPropertiesLoadSucceeded: (loadTime: number) => {
+ loadTime: number
+ }
+ reportDataManagementEventPropertyDefinitionsPageLoadFailed: (
+ loadTime: number,
+ error: string
+ ) => {
+ error: string
+ loadTime: number
+ }
+ reportDataManagementEventPropertyDefinitionsPageLoadSucceeded: (
+ loadTime: number,
+ resultsLength: number
+ ) => {
+ loadTime: number
+ resultsLength: number
+ }
+ reportDataTableColumnsUpdated: (context_type: string) => {
+ context_type: string
+ }
+ reportEntityFilterVisibilitySet: (
+ index: number,
+ visible: boolean,
+ entityName?: string
+ ) => {
+ entityName: string | undefined
+ index: number
+ visible: boolean
+ }
+ reportExperimentAiSummaryRequested: (experiment: Experiment) => {
+ experiment: Experiment
+ }
+ reportExperimentAutoRefreshToggled: (
+ experiment: Experiment,
+ enabled: boolean,
+ interval: number
+ ) => {
+ enabled: boolean
+ experiment: Experiment
+ interval: number
+ }
+ reportExperimentBiasWarningShown: (experiment: Experiment) => {
+ experiment: Experiment
+ }
+ reportExperimentCreated: (
+ experiment: Experiment,
+ metadata?: {
+ creation_source?: string
+ has_linked_flag?: boolean
+ }
+ ) => {
+ experiment: Experiment
+ metadata:
+ | {
+ creation_source?: string | undefined
+ has_linked_flag?: boolean | undefined
+ }
+ | undefined
+ }
+ reportExperimentDashboardCreated: (
+ experiment: Experiment,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ experiment: Experiment
+ }
+ reportExperimentEndDateChange: (
+ experiment: Experiment,
+ newEndDate: string
+ ) => {
+ experiment: Experiment
+ newEndDate: string
+ }
+ reportExperimentExposureCohortCreated: (
+ experiment: Experiment,
+ cohort: CohortType
+ ) => {
+ cohort: CohortType
+ experiment: Experiment
+ }
+ reportExperimentExposureCohortEdited: (
+ existingCohort: CohortType,
+ newCohort: CohortType
+ ) => {
+ existingCohort: CohortType
+ newCohort: CohortType
+ }
+ reportExperimentFeatureFlagModalOpened: () => {}
+ reportExperimentFeatureFlagSelected: (featureFlagKey: string) => {
+ featureFlagKey: string
+ }
+ reportExperimentHoldoutAssigned: ({
+ experimentId,
+ holdoutId,
+ }: {
+ experimentId: ExperimentIdType
+ holdoutId: ExperimentHoldoutType['id']
+ }) => {
+ experimentId: ExperimentIdType
+ holdoutId: number | null
+ }
+ reportExperimentHoldoutCreated: (holdout: ExperimentHoldoutType) => {
+ holdout: ExperimentHoldoutType
+ }
+ reportExperimentInconsistencyWarningShown: (
+ experiment: Experiment,
+ warningKey: string
+ ) => {
+ experiment: Experiment
+ warningKey: string
+ }
+ reportExperimentInsightLoadFailed: () => {
+ value: true
+ }
+ reportExperimentMetricBreakdownAdded: (
+ experiment: Experiment,
+ metricUuid: string,
+ breakdown: Breakdown,
+ isPrimary: boolean
+ ) => {
+ breakdown: Breakdown
+ experiment: Experiment
+ isPrimary: boolean
+ metricUuid: string
+ }
+ reportExperimentMetricBreakdownRemoved: (
+ experiment: Experiment,
+ metricUuid: string,
+ breakdown: Breakdown,
+ index: number,
+ isPrimary: boolean
+ ) => {
+ breakdown: Breakdown
+ experiment: Experiment
+ index: number
+ isPrimary: boolean
+ metricUuid: string
+ }
+ reportExperimentMetricFinished: (
+ experimentId: ExperimentIdType,
+ metric: ExperimentFunnelsQuery | ExperimentMetric | ExperimentTrendsQuery,
+ teamId?: number | null,
+ queryId?: string | null,
+ context?: {
+ duration_ms: number
+ execution_mode: 'async' | 'sync'
+ is_cached: boolean
+ is_primary: boolean
+ is_retry: boolean
+ metric_index: number
+ metric_kind: string
+ refresh_id: string
+ }
+ ) => {
+ context:
+ | {
+ duration_ms: number
+ execution_mode: 'async' | 'sync'
+ is_cached: boolean
+ is_primary: boolean
+ is_retry: boolean
+ metric_index: number
+ metric_kind: string
+ refresh_id: string
+ }
+ | undefined
+ experimentId: ExperimentIdType
+ metric: ExperimentFunnelsQuery | ExperimentMetricUnion | ExperimentTrendsQuery
+ queryId: string | null | undefined
+ teamId: number | null | undefined
+ }
+ reportExperimentMetricRecalculation: (
+ status: 'completed' | 'failed' | 'triggered',
+ properties: {
+ duration_ms?: number
+ experiment_id: number
+ failed?: number
+ is_existing?: boolean
+ poll_count?: number
+ recalculation_id: string | null
+ succeeded?: number
+ total_metrics?: number
+ trigger?:
+ | 'auto_refresh'
+ | 'cold_run'
+ | 'config_change'
+ | 'experiment_launch'
+ | 'experiment_stop'
+ | 'experiment_update'
+ | 'manual'
+ | 'stale_refresh'
+ }
+ ) => {
+ properties: {
+ duration_ms?: number | undefined
+ experiment_id: number
+ failed?: number | undefined
+ is_existing?: boolean | undefined
+ poll_count?: number | undefined
+ recalculation_id: string | null
+ succeeded?: number | undefined
+ total_metrics?: number | undefined
+ trigger?:
+ | 'auto_refresh'
+ | 'cold_run'
+ | 'config_change'
+ | 'experiment_launch'
+ | 'experiment_stop'
+ | 'experiment_update'
+ | 'manual'
+ | 'stale_refresh'
+ | undefined
+ }
+ status: 'completed' | 'failed' | 'triggered'
+ }
+ reportExperimentMetricsRefreshed: (
+ experiment: Experiment,
+ forceRefresh: boolean,
+ context?: {
+ auto_refresh_enabled?: boolean
+ auto_refresh_interval?: number
+ previous_refresh_age_ms?: number | null
+ previous_refresh_id?: string | null
+ previous_refresh_state?: string | null
+ previous_refresh_triggered_by?: string | null
+ triggered_by: 'auto-refresh' | 'manual'
+ }
+ ) => {
+ context:
+ | {
+ auto_refresh_enabled?: boolean | undefined
+ auto_refresh_interval?: number | undefined
+ previous_refresh_age_ms?: number | null | undefined
+ previous_refresh_id?: string | null | undefined
+ previous_refresh_state?: string | null | undefined
+ previous_refresh_triggered_by?: string | null | undefined
+ triggered_by: 'auto-refresh' | 'manual'
+ }
+ | undefined
+ experiment: Experiment
+ forceRefresh: boolean
+ }
+ reportExperimentReleaseConditionsUpdated: (experimentId: ExperimentIdType) => {
+ experimentId: ExperimentIdType
+ }
+ reportExperimentReleaseConditionsViewed: (experimentId: ExperimentIdType) => {
+ experimentId: ExperimentIdType
+ }
+ reportExperimentResultsLoadingTimeout: (experimentId: ExperimentIdType) => {
+ experimentId: ExperimentIdType
+ }
+ reportExperimentResultsRefreshCompleted: (
+ experimentId: ExperimentIdType,
+ teamId: number | null | undefined,
+ context: {
+ cached_count: number
+ errored_count: number
+ execution_mode: 'async' | 'sync'
+ experiment_duration_hours: number | null
+ experiment_status: string | null
+ force_refresh: boolean
+ primary_metrics_count: number
+ refresh_id: string
+ secondary_metrics_count: number
+ successful_count: number
+ total_duration_ms: number
+ total_metrics_count: number
+ triggered_by: 'auto_refresh' | 'config_change' | 'manual' | 'page_load'
+ }
+ ) => {
+ context: {
+ cached_count: number
+ errored_count: number
+ execution_mode: 'async' | 'sync'
+ experiment_duration_hours: number | null
+ experiment_status: string | null
+ force_refresh: boolean
+ primary_metrics_count: number
+ refresh_id: string
+ secondary_metrics_count: number
+ successful_count: number
+ total_duration_ms: number
+ total_metrics_count: number
+ triggered_by: 'auto_refresh' | 'config_change' | 'manual' | 'page_load'
+ }
+ experimentId: ExperimentIdType
+ teamId: number | null | undefined
+ }
+ reportExperimentSessionReplaySummaryRequested: (experiment: Experiment) => {
+ experiment: Experiment
+ }
+ reportExperimentSharedMetricAssigned: (
+ experimentId: ExperimentIdType,
+ sharedMetric: SharedMetric
+ ) => {
+ experimentId: ExperimentIdType
+ sharedMetric: SharedMetric
+ }
+ reportExperimentSharedMetricCreated: (sharedMetric: SharedMetric) => {
+ sharedMetric: SharedMetric
+ }
+ reportExperimentStartDateChange: (
+ experiment: Experiment,
+ newStartDate: string
+ ) => {
+ experiment: Experiment
+ newStartDate: string
+ }
+ reportExperimentTimeseriesRecalculated: (
+ experimentId: ExperimentIdType,
+ metric: ExperimentMetric
+ ) => {
+ experimentId: ExperimentIdType
+ metric: ExperimentMetricUnion
+ }
+ reportExperimentTimeseriesViewed: (
+ experimentId: ExperimentIdType,
+ metric: ExperimentMetric
+ ) => {
+ experimentId: ExperimentIdType
+ metric: ExperimentMetricUnion
+ }
+ reportExperimentUpdated: (experiment: Experiment) => {
+ experiment: Experiment
+ }
+ reportExperimentVariantScreenshotUploaded: (experimentId: ExperimentIdType) => {
+ experimentId: ExperimentIdType
+ }
+ reportExperimentViewed: (
+ experiment: Experiment,
+ duration: number | null
+ ) => {
+ duration: number | null
+ experiment: Experiment
+ }
+ reportExperimentWizardGuideToggled: (
+ visible: boolean,
+ currentStep: string
+ ) => {
+ currentStep: string
+ visible: boolean
+ }
+ reportExperimentWizardStarted: (guideVisible: boolean) => {
+ guideVisible: boolean
+ }
+ reportFailedToCreateFeatureFlagWithCohort: (
+ code: string,
+ detail: string
+ ) => {
+ code: string
+ detail: string
+ }
+ reportFeatureFlagBulkCopy: (
+ flagCount: number,
+ projectCount: number,
+ failedCount: number
+ ) => {
+ failedCount: number
+ flagCount: number
+ projectCount: number
+ }
+ reportFeatureFlagCopyFailure: (error: any) => {
+ error: any
+ }
+ reportFeatureFlagCopySuccess: () => {
+ value: true
+ }
+ reportFeatureFlagScheduleFailure: (error: any) => {
+ error: any
+ }
+ reportFeatureFlagScheduleSuccess: () => {
+ value: true
+ }
+ reportFlagsCodeExampleInteraction: (optionType: string) => {
+ optionType: string
+ }
+ reportFlagsCodeExampleLanguage: (language: string) => {
+ language: string
+ }
+ reportFunnelCalculated: (
+ eventCount: number,
+ actionCount: number,
+ interval: string,
+ funnelVizType: string | undefined,
+ success: boolean,
+ error?: string
+ ) => {
+ actionCount: number
+ error: string | undefined
+ eventCount: number
+ funnelVizType: string | undefined
+ interval: string
+ success: boolean
+ }
+ reportFunnelStepReordered: () => {
+ value: true
+ }
+ reportGroupProfileViewed: (delay?: number) => {
+ delay: number | undefined
+ }
+ reportGroupPropertyUpdated: (
+ action: 'added' | 'removed' | 'updated',
+ totalProperties: number,
+ oldPropertyType?: string,
+ newPropertyType?: string
+ ) => {
+ action: 'added' | 'removed' | 'updated'
+ newPropertyType: string | undefined
+ oldPropertyType: string | undefined
+ totalProperties: number
+ }
+ reportGroupTypeDetailDashboardCreated: () => {}
+ reportGroupViewSaved: (
+ groupTypeIndex: number,
+ shortcutName: string
+ ) => {
+ groupTypeIndex: number
+ shortcutName: string
+ }
+ reportHeatmapsToggled: (heatmaps_opt_in: boolean) => {
+ heatmaps_opt_in: boolean
+ }
+ reportHelpButtonUsed: (help_type: HelpType) => {
+ help_type: HelpType
+ }
+ reportHelpButtonViewed: () => {
+ value: true
+ }
+ reportIngestionContinueWithoutVerifying: () => {
+ value: true
+ }
+ reportInsightBreakdownChanged: (queryKind: string | undefined) => {
+ queryKind: string | undefined
+ }
+ reportInsightCompareChanged: (queryKind: string | undefined) => {
+ queryKind: string | undefined
+ }
+ reportInsightDatePickerOpened: (queryKind: string | undefined) => {
+ queryKind: string | undefined
+ }
+ reportInsightDateRangeChanged: (queryKind: string | undefined) => {
+ queryKind: string | undefined
+ }
+ reportInsightDragToZoomed: (queryKind: string | undefined) => {
+ queryKind: string | undefined
+ }
+ reportInsightFilterAdded: (
+ newLength: number,
+ source: GraphSeriesAddedSource
+ ) => {
+ newLength: number
+ source: GraphSeriesAddedSource
+ }
+ reportInsightFilterRemoved: (index: number) => {
+ index: number
+ }
+ reportInsightFilterSet: (
+ filters: Array<{
+ id: number | string | null
+ type?: EntityType
+ }>
+ ) => {
+ filters: {
+ id: number | string | null
+ type?: EntityType | undefined
+ }[]
+ }
+ reportInsightMetadataAiGenerated: (queryKind: NodeKind) => {
+ queryKind: NodeKind
+ }
+ reportInsightMetadataAiGenerationFailed: (queryKind: NodeKind) => {
+ queryKind: NodeKind
+ }
+ reportInsightOpenedFromRecentInsightList: () => {
+ value: true
+ }
+ reportInsightRefreshTime: (
+ loadingMilliseconds: number,
+ insightShortId: InsightShortId
+ ) => {
+ insightShortId: InsightShortId
+ loadingMilliseconds: number
+ }
+ reportInsightSaved: (
+ insight: Partial<QueryBasedInsightModel> | null,
+ query: Node | null,
+ isNewInsight: boolean,
+ saveType: 'save' | 'save_as'
+ ) => {
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ isNewInsight: boolean
+ query: Node<Record<string, any>> | null
+ saveType: 'save' | 'save_as'
+ }
+ reportInsightStarted: (query: Node | null) => {
+ query: Node<Record<string, any>> | null
+ }
+ reportInsightViewed: (
+ insightModel: Partial<QueryBasedInsightModel>,
+ query: Node | null,
+ isFirstLoad: boolean,
+ delay?: number
+ ) => {
+ delay: number | undefined
+ insightModel: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
+ isFirstLoad: boolean
+ query: Node<Record<string, any>> | null
+ }
+ reportInsightWhitelabelToggled: (isWhiteLabelled: boolean) => {
+ isWhiteLabelled: boolean
+ }
+ reportInsightsTableCalcToggled: (mode: string) => {
+ mode: string
+ }
+ reportInstanceSettingChange: (
+ name: string,
+ value: boolean | number | string
+ ) => {
+ name: string
+ value: boolean | number | string
+ }
+ reportIntegrationConnectClicked: (
+ integration: string,
+ kind: string
+ ) => {
+ integration: string
+ kind: string
+ }
+ reportInviteMembersButtonClicked: () => {
+ value: true
+ }
+ reportMCPHintDismissed: (
+ dismissType: 'all' | 'surface',
+ surfaceKey?: string
+ ) => {
+ dismissType: 'all' | 'surface'
+ surfaceKey: string | undefined
+ }
+ reportMCPHintShown: (surfaceKey: string) => {
+ surfaceKey: string
+ }
+ reportMarketingAnalyticsDataSourceConnected: (sourceType: string) => {
+ sourceType: string
+ }
+ reportMarketingAnalyticsOnboardingCompleted: (hasSources: boolean) => {
+ hasSources: boolean
+ }
+ reportMarketingAnalyticsOnboardingViewed: () => {}
+ reportMediaPreviewUploaded: (source: string) => {
+ source: string
+ }
+ reportNavbarStarredItemAdded: (
+ itemType: string,
+ itemName: string
+ ) => {
+ itemName: string
+ itemType: string
+ }
+ reportNavbarStarredItemClicked: (
+ itemType: string,
+ itemName: string
+ ) => {
+ itemName: string
+ itemType: string
+ }
+ reportNavbarStarredItemRemoved: (
+ itemType: string,
+ itemName: string
+ ) => {
+ itemName: string
+ itemType: string
+ }
+ reportNavbarStarredItemsReordered: (
+ itemCount: number,
+ isAIFirst: boolean
+ ) => {
+ isAIFirst: boolean
+ itemCount: number
+ }
+ reportOnboardingCompleted: (productKey: string) => {
+ productKey: string
+ }
+ reportOnboardingProductSelectionPath: (
+ path: 'ai' | 'browsing_history' | 'manual' | 'use_case',
+ properties?: {
+ hasBrowsingHistory?: boolean
+ recommendedProducts?: string[]
+ useCase?: string
+ }
+ ) => {
+ path: 'ai' | 'browsing_history' | 'manual' | 'use_case'
+ properties:
+ | {
+ hasBrowsingHistory?: boolean | undefined
+ recommendedProducts?: string[] | undefined
+ useCase?: string | undefined
+ }
+ | undefined
+ }
+ reportOnboardingProductToggled: (
+ productKey: string,
+ selected: boolean,
+ recommendationSource: string
+ ) => {
+ productKey: string
+ recommendationSource: string
+ selected: boolean
+ }
+ reportOnboardingStarted: (entrypoint: string) => {
+ entrypoint: string
+ }
+ reportOnboardingStepCompleted: (
+ stepKey: OnboardingStepKey,
+ productKey?: string
+ ) => {
+ productKey: string | undefined
+ stepKey: OnboardingStepKey
+ }
+ reportOnboardingStepSkipped: (
+ stepKey: OnboardingStepKey,
+ productKey?: string
+ ) => {
+ productKey: string | undefined
+ stepKey: OnboardingStepKey
+ }
+ reportOnboardingUseCaseSelected: (
+ useCase: string,
+ recommendedProducts: readonly string[]
+ ) => {
+ recommendedProducts: readonly string[]
+ useCase: string
+ }
+ reportOnboardingUseCaseSkipped: () => {
+ value: true
+ }
+ reportPersonDetailViewed: (person: PersonType) => {
+ person: PersonType
+ }
+ reportPersonOpenedFromNewlySeenPersonsList: () => {
+ value: true
+ }
+ reportPersonProfileViewed: (delay?: number) => {
+ delay: number | undefined
+ }
+ reportPersonPropertyUpdated: (
+ action: 'added' | 'removed' | 'updated',
+ totalProperties: number,
+ oldPropertyType?: string,
+ newPropertyType?: string
+ ) => {
+ action: 'added' | 'removed' | 'updated'
+ newPropertyType: string | undefined
+ oldPropertyType: string | undefined
+ totalProperties: number
+ }
+ reportPersonSplit: (merge_count: number) => {
+ merge_count: number
+ }
+ reportPersonsJoinModeUpdated: (mode: string) => {
+ mode: string
+ }
+ reportPersonsModalSearched: (params: { actorType?: string; teamId?: number | null }) => {
+ params: {
+ actorType?: string | undefined
+ teamId?: number | null | undefined
+ }
+ }
+ reportPersonsModalViewed: (params: any) => {
+ params: any
+ }
+ reportPoEModeUpdated: (mode: string) => {
+ mode: string
+ }
+ reportProductTourCreated: (
+ tour: ProductTour,
+ creationSource?: 'app' | 'toolbar'
+ ) => {
+ creationSource: 'app' | 'toolbar' | undefined
+ tour: ProductTour
+ }
+ reportProductTourListViewed: () => {
+ value: true
+ }
+ reportProductTourViewed: (tour: ProductTour) => {
+ tour: ProductTour
+ }
+ reportProductUnsubscribed: (product: string) => {
+ product: string
+ }
+ reportProjectCreationSubmitted: (
+ projectCount: number,
+ nameLength: number
+ ) => {
+ nameLength: number
+ projectCount: number
+ }
+ reportProjectNoticeDismissed: (key: string) => {
+ key: string
+ }
+ reportProjectNoticeShown: (variant: string) => {
+ variant: string
+ }
+ reportProjectSettingChange: (
+ name: string,
+ value: any
+ ) => {
+ name: string
+ value: any
+ }
+ reportPropertyGroupFilterAdded: () => {
+ value: true
+ }
+ reportPropertyGroupFilterDuplicated: () => {
+ value: true
+ }
+ reportPropertyGroupFilterRemoved: () => {
+ value: true
+ }
+ reportPropertySelectOpened: () => {
+ value: true
+ }
+ reportRemovedInsightFromDashboard: (
+ insight: Partial<QueryBasedInsightModel> | null,
+ dashboardId: number | null
+ ) => {
+ dashboardId: number | null
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ }
+ reportRevenueAnalyticsBreakdownAdded: (
+ breakdownProperty: string,
+ breakdownType: string
+ ) => {
+ breakdownProperty: string
+ breakdownType: string
+ }
+ reportRevenueAnalyticsBreakdownRemoved: (
+ breakdownProperty: string,
+ breakdownType: string
+ ) => {
+ breakdownProperty: string
+ breakdownType: string
+ }
+ reportRevenueAnalyticsDataSourceConnected: (sourceType: string) => {
+ sourceType: string
+ }
+ reportRevenueAnalyticsDataSourceDisabled: (sourceType: string) => {
+ sourceType: string
+ }
+ reportRevenueAnalyticsDataSourceEnabled: (sourceType: string) => {
+ sourceType: string
+ }
+ reportRevenueAnalyticsDateRangeChanged: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ reportRevenueAnalyticsEventCreated: (eventName: string) => {
+ eventName: string
+ }
+ reportRevenueAnalyticsEventDeleted: (eventName: string) => {
+ eventName: string
+ }
+ reportRevenueAnalyticsEventEdited: (eventName: string) => {
+ eventName: string
+ }
+ reportRevenueAnalyticsFilterApplied: (filterCount: number) => {
+ filterCount: number
+ }
+ reportRevenueAnalyticsGoalConfigured: () => {}
+ reportRevenueAnalyticsMRRBreakdownModalOpened: () => {}
+ reportRevenueAnalyticsMRRModeChanged: (mrrMode: string) => {
+ mrrMode: string
+ }
+ reportRevenueAnalyticsOnboardingCompleted: (
+ hasEvents: boolean,
+ hasSources: boolean
+ ) => {
+ hasEvents: boolean
+ hasSources: boolean
+ }
+ reportRevenueAnalyticsOnboardingViewed: () => {}
+ reportRevenueAnalyticsSettingsViewed: () => {}
+ reportRevenueAnalyticsTestAccountFilterUpdated: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ }
+ reportRevenueAnalyticsViewed: (delay?: number) => {
+ delay: number | undefined
+ }
+ reportRoleCreated: (role: string) => {
+ role: string
+ }
+ reportSDKSelected: (sdk: SDK) => {
+ sdk: SDK
+ }
+ reportSavedInsightFilterUsed: (filterKeys: string[]) => {
+ filterKeys: string[]
+ }
+ reportSavedInsightNewInsightClicked: (insightType: string) => {
+ insightType: string
+ }
+ reportSavedInsightTabChanged: (tab: string) => {
+ tab: string
+ }
+ reportSavedInsightToDashboard: (
+ insight: Partial<QueryBasedInsightModel> | null,
+ dashboardId: number | null
+ ) => {
+ dashboardId: number | null
+ insight: Partial<QueryBasedInsightModel<Node<Record<string, any>>>> | null
+ }
+ reportSessionTableVersionUpdated: (version: string) => {
+ version: string
+ }
+ reportSubscribedDuringOnboarding: (productKey: string) => {
+ productKey: string
+ }
+ reportSurveyAiPromptSubmitted: (source: string) => {
+ source: string
+ }
+ reportSurveyArchived: (survey: Survey) => {
+ survey: Survey
+ }
+ reportSurveyConsolidatedResultsQuery: (
+ survey: Survey,
+ totalDurationMs: number,
+ queryDurations: {
+ aggregate: number
+ openEnded: number
+ }
+ ) => {
+ queryDurations: {
+ aggregate: number
+ openEnded: number
+ }
+ survey: Survey
+ totalDurationMs: number
+ }
+ reportSurveyCreated: (
+ survey: Survey,
+ isDuplicate?: boolean,
+ creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ ) => {
+ creationSource:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
+ isDuplicate: boolean | undefined
+ survey: Survey
+ }
+ reportSurveyCycleDetected: (survey: NewSurvey | Survey) => {
+ survey: NewSurvey | Survey
+ }
+ reportSurveyEdited: (survey: Survey) => {
+ survey: Survey
+ }
+ reportSurveyEmptyStateViewed: () => {
+ value: true
+ }
+ reportSurveyTemplateClicked: (
+ template: SurveyTemplateType,
+ source?: string
+ ) => {
+ source: string | undefined
+ template: SurveyTemplateType
+ }
+ reportSurveyViewed: (survey: Survey) => {
+ survey: Survey
+ }
+ reportTaxonomicFilterAddFilterClicked: (eventName?: string) => {
+ eventName: string | undefined
+ }
+ reportTaxonomicFilterCategorySelected: (
+ groupType: TaxonomicFilterGroupType,
+ eventName?: string
+ ) => {
+ eventName: string | undefined
+ groupType: TaxonomicFilterGroupType
+ }
+ reportTeamSettingChange: (
+ name: string,
+ value: any
+ ) => {
+ name: string
+ value: any
+ }
+ reportTestAccountFiltersUpdated: (filters: Record<string, any>[]) => {
+ filters: Record<string, any>[]
+ }
+ reportTimeToSeeData: (payload: TimeToSeeDataPayload) => {
+ payload: TimeToSeeDataPayload
+ }
+ reportTimezoneComponentViewed: (
+ component: 'indicator' | 'label',
+ project_timezone?: string,
+ device_timezone?: string | null
+ ) => {
+ component: 'indicator' | 'label'
+ device_timezone: string | null | undefined
+ project_timezone: string | undefined
+ }
+ reportUpgradeModalShown: (featureName: string) => {
+ featureName: string
+ }
+ reportUsageMetricCreated: () => boolean
+ reportUsageMetricDeleted: () => boolean
+ reportUsageMetricUpdated: () => boolean
+ reportUsageMetricsCreateButtonClicked: () => boolean
+ reportUsageMetricsSettingsViewed: () => boolean
+ reportUsageMetricsUpdateButtonClicked: () => boolean
+ reportUserFeedbackButtonClicked: (
+ source: SURVEY_CREATED_SOURCE,
+ meta: Record<string, any>
+ ) => {
+ meta: Record<string, any>
+ source: SURVEY_CREATED_SOURCE
+ }
+ reportWebAnalyticsCompareToggled: (props: { enabled: boolean }) => {
+ props: {
+ enabled: boolean
+ }
+ }
+ reportWebAnalyticsConversionGoalSet: (props: { goal_type: string | null }) => {
+ props: {
+ goal_type: string | null
+ }
+ }
+ reportWebAnalyticsDateRangeChanged: (props: {
+ date_from: string | null
+ date_to: string | null
+ interval: string
+ }) => {
+ props: {
+ date_from: string | null
+ date_to: string | null
+ interval: string
+ }
+ }
+ reportWebAnalyticsFilterApplied: (props: {
+ filter_type: string
+ property_filter_category?: PropertyFilterType
+ total_filter_count: number
+ }) => {
+ props: {
+ filter_type: string
+ property_filter_category?: PropertyFilterType | undefined
+ total_filter_count: number
+ }
+ }
+ reportWebAnalyticsFilterRemoved: (props: {
+ filter_type: string
+ property_filter_category?: PropertyFilterType
+ total_filter_count: number
+ }) => {
+ props: {
+ filter_type: string
+ property_filter_category?: PropertyFilterType | undefined
+ total_filter_count: number
+ }
+ }
+ reportWebAnalyticsFocusModeOnboardingCompleted: (props: { concern_count: number }) => {
+ props: {
+ concern_count: number
+ }
+ }
+ reportWebAnalyticsFocusModeOnboardingShown: () => {
+ value: true
+ }
+ reportWebAnalyticsFocusModeOnboardingSkipped: () => {
+ value: true
+ }
+ reportWebAnalyticsFocusModeOnboardingStarted: () => {
+ value: true
+ }
+ reportWebAnalyticsHealthActionClicked: (props: {
+ category: string
+ check_id: string
+ is_urgent: boolean
+ status: string
+ }) => {
+ props: {
+ category: string
+ check_id: string
+ is_urgent: boolean
+ status: string
+ }
+ }
+ reportWebAnalyticsHealthRefreshed: (props: { overall_status: string; passed_count: number }) => {
+ props: {
+ overall_status: string
+ passed_count: number
+ }
+ }
+ reportWebAnalyticsHealthSectionToggled: (props: { category: string; is_expanded: boolean }) => {
+ props: {
+ category: string
+ is_expanded: boolean
+ }
+ }
+ reportWebAnalyticsHealthStatus: (props: {
+ has_authorized_urls: boolean
+ has_pageleaves: boolean
+ has_pageviews: boolean
+ has_reverse_proxy: boolean
+ has_scroll_depth: boolean
+ has_web_vitals: boolean
+ overall_status: string
+ }) => {
+ props: {
+ has_authorized_urls: boolean
+ has_pageleaves: boolean
+ has_pageviews: boolean
+ has_reverse_proxy: boolean
+ has_scroll_depth: boolean
+ has_web_vitals: boolean
+ overall_status: string
+ }
+ }
+ reportWebAnalyticsHealthTabViewed: (props: {
+ error_count: number
+ overall_status: string
+ passed_count: number
+ warning_count: number
+ }) => {
+ props: {
+ error_count: number
+ overall_status: string
+ passed_count: number
+ warning_count: number
+ }
+ }
+ reportWebAnalyticsPathCleaningToggled: (props: { enabled: boolean }) => {
+ props: {
+ enabled: boolean
+ }
+ }
+ reportWebDashboardCreatedFromTemplate: (payload: {
+ dashboard_id: number
+ template_id: string
+ template_name: string
+ template_scope: DashboardTemplateScope | null
+ template_variable_count: number
+ }) => {
+ dashboard_id: number
+ template_id: string
+ template_name: string
+ template_scope: DashboardTemplateScope | null
+ template_variable_count: number
+ }
+ reportWizardSyncSessionDetected: (props: {
+ runPhase: string
+ skillId: string
+ taskCount: number
+ workflowId: string
+ }) => {
+ runPhase: string
+ skillId: string
+ taskCount: number
+ workflowId: string
+ }
+ reportWizardSyncSessionFinished: (props: {
+ completedTaskCount: number
+ elapsedSeconds: number
+ outcome: string
+ skillId: string
+ taskCount: number
+ workflowId: string
+ }) => {
+ completedTaskCount: number
+ elapsedSeconds: number
+ outcome: string
+ skillId: string
+ taskCount: number
+ workflowId: string
+ }
+}
+
+export type eventUsageLogicType = MakeLogicType<eventUsageLogicValues, eventUsageLogicActions>
+
export const eventUsageLogic = kea<eventUsageLogicType>([
path(['lib', 'utils', 'eventUsageLogic']),
connect(() => ({
diff --git a/frontend/src/lib/wizard-sync/wizardSyncDebugLogic.ts b/frontend/src/lib/wizard-sync/wizardSyncDebugLogic.ts
index 8574f49fada7..237e1659bf8a 100644
--- a/frontend/src/lib/wizard-sync/wizardSyncDebugLogic.ts
+++ b/frontend/src/lib/wizard-sync/wizardSyncDebugLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
-
-import type { wizardSyncDebugLogicType } from './wizardSyncDebugLogicType'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
export type SyncDebugKind = 'connect' | 'open' | 'poll' | 'event' | 'error' | 'complete' | 'disconnect'
@@ -34,6 +32,30 @@ let nextEntryId = 0
// the reducers stay pure. Module-level is fine: this is a dev-only diagnostic, not app state.
const lastTickAtBySource = new Map<string, number>()
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface wizardSyncDebugLogicValues {
+ entries: SyncDebugEntry[]
+ sources: Record<string, SyncDebugSourceInfo>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface wizardSyncDebugLogicActions {
+ clearSyncDebugLog: () => {
+ value: true
+ }
+ recordSyncEvent: (
+ entry: SyncDebugEntry,
+ mode?: 'polling' | 'sse',
+ intervalMs?: number
+ ) => {
+ entry: SyncDebugEntry
+ intervalMs: number | undefined
+ mode: 'polling' | 'sse' | undefined
+ }
+}
+
+export type wizardSyncDebugLogicType = MakeLogicType<wizardSyncDebugLogicValues, wizardSyncDebugLogicActions>
+
/**
* Dev-only in-memory event log for the wizard sync transports (task-run SSE/polling, wizard-session
* SSE/polling). Fed by `logSyncDebug` below and rendered by `WizardSyncDebugPanel`. Never mounted in
diff --git a/frontend/src/scenes/funnels/funnelCorrelationUsageLogic.ts b/frontend/src/scenes/funnels/funnelCorrelationUsageLogic.ts
index acba20d3bd65..7cbe258e2bf4 100644
--- a/frontend/src/scenes/funnels/funnelCorrelationUsageLogic.ts
+++ b/frontend/src/scenes/funnels/funnelCorrelationUsageLogic.ts
@@ -61,18 +61,18 @@ export interface funnelCorrelationUsageLogicValues {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface funnelCorrelationUsageLogicActions {
reportCorrelationInteraction: (
- correlationType: FunnelCorrelation['result_type'],
+ correlationType: FunnelCorrelationResultsType,
action: string,
- props?: Record<string, any>
+ props?: Record<string, any> | undefined
) => {
action: string
correlationType: FunnelCorrelationResultsType
props: Record<string, any> | undefined
} // eventUsageLogic
reportCorrelationViewed: (
- query: Node | null,
- delay?: number,
- propertiesTable?: boolean
+ query: Node<Record<string, any>> | null,
+ delay?: number | undefined,
+ propertiesTable?: boolean | undefined
) => {
delay: number | undefined
propertiesTable: boolean | undefined
diff --git a/frontend/src/scenes/insights/insightUsageLogic.ts b/frontend/src/scenes/insights/insightUsageLogic.ts
index 014ef3682573..9f5c8075da7e 100644
--- a/frontend/src/scenes/insights/insightUsageLogic.ts
+++ b/frontend/src/scenes/insights/insightUsageLogic.ts
@@ -31,10 +31,10 @@ export interface insightUsageLogicValues {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface insightUsageLogicActions {
reportInsightViewed: (
- insightModel: Partial<QueryBasedInsightModel>,
- query: Node | null,
+ insightModel: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>,
+ query: Node<Record<string, any>> | null,
isFirstLoad: boolean,
- delay?: number
+ delay?: number | undefined
) => {
delay: number | undefined
insightModel: Partial<QueryBasedInsightModel<Node<Record<string, any>>>>
diff --git a/products/customer_analytics/frontend/components/CustomerJourneys/customerJourneysLogic.ts b/products/customer_analytics/frontend/components/CustomerJourneys/customerJourneysLogic.ts
index 2ff525d37479..65a1042668d3 100644
--- a/products/customer_analytics/frontend/components/CustomerJourneys/customerJourneysLogic.ts
+++ b/products/customer_analytics/frontend/components/CustomerJourneys/customerJourneysLogic.ts
@@ -45,7 +45,7 @@ export interface customerJourneysLogicActions {
journeyId: string,
journeyName: string,
stepCount: number,
- delay?: number
+ delay?: number | undefined
) => {
delay: number | undefined
journeyId: string