diff --git a/.kearc b/.kearc index c51c3e07b6a..7fb5652f271 100644 --- a/.kearc +++ b/.kearc @@ -1,6 +1,7 @@ { "tsConfigPath": "./tsconfig.json", "rootPath": "./frontend/src", - "typesPath": "./frontend/src" + "typesPath": "./frontend/src", + "writePaths": true } diff --git a/frontend/src/layout/lemonade/lemonadeLogic.ts b/frontend/src/layout/lemonade/lemonadeLogic.ts index 67aa9f6b9c9..eed008f97be 100644 --- a/frontend/src/layout/lemonade/lemonadeLogic.ts +++ b/frontend/src/layout/lemonade/lemonadeLogic.ts @@ -4,6 +4,7 @@ import { featureFlagLogic } from '../../lib/logic/featureFlagLogic' import { lemonadeLogicType } from './lemonadeLogicType' export const lemonadeLogic = kea({ + path: ['layout', 'lemonade', 'lemonadeLogic'], connect: { values: [featureFlagLogic, ['featureFlags']], }, diff --git a/frontend/src/layout/navigation/navigationLogic.ts b/frontend/src/layout/navigation/navigationLogic.ts index 5b71dc7701b..63648405436 100644 --- a/frontend/src/layout/navigation/navigationLogic.ts +++ b/frontend/src/layout/navigation/navigationLogic.ts @@ -19,6 +19,7 @@ type WarningType = | null export const navigationLogic = kea>({ + path: ['layout', 'navigation', 'navigationLogic'], actions: { setMenuCollapsed: (collapsed: boolean) => ({ collapsed }), collapseMenu: () => {}, diff --git a/frontend/src/lib/components/Annotations/annotationsLogic.ts b/frontend/src/lib/components/Annotations/annotationsLogic.ts index 920d2fde51a..1495387cb1a 100644 --- a/frontend/src/lib/components/Annotations/annotationsLogic.ts +++ b/frontend/src/lib/components/Annotations/annotationsLogic.ts @@ -13,6 +13,7 @@ interface AnnotationsLogicProps { } export const annotationsLogic = kea>({ + path: (key) => ['lib', 'components', 'Annotations', 'annotationsLogic', key], props: {} as AnnotationsLogicProps, key: (props) => (props.pageKey ? `${props.pageKey}_annotations` : 'annotations_default'), connect: { diff --git a/frontend/src/lib/components/AppEditorLink/appUrlsLogic.ts b/frontend/src/lib/components/AppEditorLink/appUrlsLogic.ts index 899824445e8..0d06788509d 100644 --- a/frontend/src/lib/components/AppEditorLink/appUrlsLogic.ts +++ b/frontend/src/lib/components/AppEditorLink/appUrlsLogic.ts @@ -10,6 +10,7 @@ import { teamLogic } from 'scenes/teamLogic' const defaultValue = 'https://' export const appUrlsLogic = kea({ + path: ['lib', 'components', 'AppEditorLink', 'appUrlsLogic'], connect: { values: [teamLogic, ['currentTeam', 'currentTeamId']], }, diff --git a/frontend/src/lib/components/BackTo.tsx b/frontend/src/lib/components/BackTo.tsx index f6054d7d0aa..597ec2fbb4f 100644 --- a/frontend/src/lib/components/BackTo.tsx +++ b/frontend/src/lib/components/BackTo.tsx @@ -11,6 +11,7 @@ interface IBackTo { } const backToLogic = kea>({ + path: ['lib', 'components', 'BackTo'], actions: { setBackTo: (payload) => ({ payload }), }, diff --git a/frontend/src/lib/components/ChartFilter/chartFilterLogic.ts b/frontend/src/lib/components/ChartFilter/chartFilterLogic.ts index f7167c55686..32680d656b3 100644 --- a/frontend/src/lib/components/ChartFilter/chartFilterLogic.ts +++ b/frontend/src/lib/components/ChartFilter/chartFilterLogic.ts @@ -9,6 +9,7 @@ function isFunnelVizType(filter: FunnelVizType | ChartDisplayType): filter is Fu } export const chartFilterLogic = kea({ + path: ['lib', 'components', 'ChartFilter', 'chartFilterLogic'], actions: () => ({ setChartFilter: (filter: ChartDisplayType | FunnelVizType) => ({ filter }), }), diff --git a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.ts b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.ts index a5ca0064e1a..56aa020e65e 100644 --- a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.ts +++ b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.ts @@ -121,6 +121,7 @@ export const commandPaletteLogic = kea< RegExpCommandPairs > >({ + path: ['lib', 'components', 'CommandPalette', 'commandPaletteLogic'], connect: { actions: [personalAPIKeysLogic, ['createKey']], values: [teamLogic, ['currentTeam'], userLogic, ['user']], diff --git a/frontend/src/lib/components/CompareFilter/compareFilterLogic.ts b/frontend/src/lib/components/CompareFilter/compareFilterLogic.ts index 1fde1ba15b1..fda83fe0e21 100644 --- a/frontend/src/lib/components/CompareFilter/compareFilterLogic.ts +++ b/frontend/src/lib/components/CompareFilter/compareFilterLogic.ts @@ -5,6 +5,7 @@ import { InsightType, ViewType } from '~/types' import { compareFilterLogicType } from './compareFilterLogicType' export const compareFilterLogic = kea({ + path: ['lib', 'components', 'CompareFilter', 'compareFilterLogic'], actions: () => ({ setCompare: (compare: boolean) => ({ compare }), setDisabled: (disabled: boolean) => ({ disabled }), diff --git a/frontend/src/lib/components/HelpButton/HelpButton.tsx b/frontend/src/lib/components/HelpButton/HelpButton.tsx index 25ac1023ed4..3a741b80542 100644 --- a/frontend/src/lib/components/HelpButton/HelpButton.tsx +++ b/frontend/src/lib/components/HelpButton/HelpButton.tsx @@ -14,6 +14,7 @@ import clsx from 'clsx' const HELP_UTM_TAGS = '?utm_medium=in-product&utm_campaign=help-button-top' export const helpButtonLogic = kea({ + path: ['lib', 'components', 'HelpButton', 'HelpButton'], connect: { actions: [eventUsageLogic, ['reportHelpButtonViewed']], }, diff --git a/frontend/src/lib/components/IntervalFilter/intervalFilterLogic.ts b/frontend/src/lib/components/IntervalFilter/intervalFilterLogic.ts index d64fb8367ba..50b4a8fd3dc 100644 --- a/frontend/src/lib/components/IntervalFilter/intervalFilterLogic.ts +++ b/frontend/src/lib/components/IntervalFilter/intervalFilterLogic.ts @@ -5,6 +5,7 @@ import { intervalFilterLogicType } from './intervalFilterLogicType' import { IntervalKeyType } from 'lib/components/IntervalFilter/intervals' export const intervalFilterLogic = kea({ + path: ['lib', 'components', 'IntervalFilter', 'intervalFilterLogic'], actions: () => ({ setIntervalFilter: (filter: IntervalKeyType) => ({ filter }), setDateFrom: (dateFrom: string) => ({ dateFrom }), diff --git a/frontend/src/lib/components/PersonalAPIKeys/personalAPIKeysLogic.ts b/frontend/src/lib/components/PersonalAPIKeys/personalAPIKeysLogic.ts index 0e3185177de..214eb489ee8 100644 --- a/frontend/src/lib/components/PersonalAPIKeys/personalAPIKeysLogic.ts +++ b/frontend/src/lib/components/PersonalAPIKeys/personalAPIKeysLogic.ts @@ -6,6 +6,7 @@ import { personalAPIKeysLogicType } from './personalAPIKeysLogicType' import { copyToClipboard } from 'lib/utils' export const personalAPIKeysLogic = kea({ + path: ['lib', 'components', 'PersonalAPIKeys', 'personalAPIKeysLogic'], loaders: ({ values }) => ({ keys: [ [] as PersonalAPIKeyType[], diff --git a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts index 578375ca27c..e68ba9fc595 100644 --- a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts +++ b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts @@ -6,6 +6,7 @@ import { taxonomicPropertyFilterLogicType } from './taxonomicPropertyFilterLogic import { cohortsModel } from '~/models/cohortsModel' export const taxonomicPropertyFilterLogic = kea({ + path: (key) => ['lib', 'components', 'PropertyFilters', 'components', 'taxonomicPropertyFilterLogic', key], props: {} as TaxonomicPropertyFilterLogicProps, key: (props) => `${props.pageKey}-${props.filterIndex}`, diff --git a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts index 10657571f47..b2e64da8429 100644 --- a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts +++ b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts @@ -8,6 +8,7 @@ import { isValidPropertyFilter, parseProperties } from 'lib/components/PropertyF import { PropertyFilterLogicProps } from 'lib/components/PropertyFilters/types' export const propertyFilterLogic = kea({ + path: (key) => ['lib', 'components', 'PropertyFilters', 'propertyFilterLogic', key], props: {} as PropertyFilterLogicProps, key: (props) => props.pageKey, diff --git a/frontend/src/lib/components/PropertyNamesSelect/propertyNamesSelectLogic.ts b/frontend/src/lib/components/PropertyNamesSelect/propertyNamesSelectLogic.ts index f9f12d5ad58..6a37ac359d7 100644 --- a/frontend/src/lib/components/PropertyNamesSelect/propertyNamesSelectLogic.ts +++ b/frontend/src/lib/components/PropertyNamesSelect/propertyNamesSelectLogic.ts @@ -2,6 +2,7 @@ import { kea } from 'kea' import { propertySelectLogicType } from './propertyNamesSelectLogicType' export const propertySelectLogic = kea({ + path: (key) => ['lib', 'components', 'PropertyNamesSelect', 'propertyNamesSelectLogic', key], props: { propertySelectLogicKey: '' as string, diff --git a/frontend/src/lib/components/ResizableTable/columnConfiguratorLogic.ts b/frontend/src/lib/components/ResizableTable/columnConfiguratorLogic.ts index 1036b2e6ea6..e71d65310ba 100644 --- a/frontend/src/lib/components/ResizableTable/columnConfiguratorLogic.ts +++ b/frontend/src/lib/components/ResizableTable/columnConfiguratorLogic.ts @@ -19,6 +19,7 @@ const filterColumns = (columnFilter: string, columns: string[]): string[] => : columns export const columnConfiguratorLogic = kea>({ + path: ['lib', 'components', 'ResizableTable', 'columnConfiguratorLogic'], props: { availableColumns: [], selectedColumns: [] } as ColumnConfiguratorLogicProps, actions: { selectColumn: (column: string) => ({ column }), diff --git a/frontend/src/lib/components/ResizableTable/tableConfigLogic.ts b/frontend/src/lib/components/ResizableTable/tableConfigLogic.ts index 18e0345c422..3f37614bf88 100644 --- a/frontend/src/lib/components/ResizableTable/tableConfigLogic.ts +++ b/frontend/src/lib/components/ResizableTable/tableConfigLogic.ts @@ -4,6 +4,7 @@ import { router } from 'kea-router' import { ColumnChoice } from '~/types' export const tableConfigLogic = kea({ + path: ['lib', 'components', 'ResizableTable', 'tableConfigLogic'], actions: { showModal: true, hideModal: false, diff --git a/frontend/src/lib/components/SaveToDashboard/saveToDashboardModalLogic.ts b/frontend/src/lib/components/SaveToDashboard/saveToDashboardModalLogic.ts index 68ff171f442..3ff76032d0e 100644 --- a/frontend/src/lib/components/SaveToDashboard/saveToDashboardModalLogic.ts +++ b/frontend/src/lib/components/SaveToDashboard/saveToDashboardModalLogic.ts @@ -6,6 +6,7 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { saveToDashboardModalLogicType } from './saveToDashboardModalLogicType' export const saveToDashboardModalLogic = kea({ + path: (key) => ['lib', 'components', 'SaveToDashboard', 'saveToDashboardModalLogic', key], props: {} as { id?: number fromDashboard?: number diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts index ecf3b1707e5..acbe4d907d3 100644 --- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts +++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts @@ -33,6 +33,7 @@ const apiCache: Record = {} const apiCacheTimers: Record = {} export const infiniteListLogic = kea({ + path: (key) => ['lib', 'components', 'TaxonomicFilter', 'infiniteListLogic', key], props: {} as InfiniteListLogicProps, key: (props) => `${props.taxonomicFilterLogicKey}-${props.listGroupType}`, diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.ts index 0f675be02cc..e8a21b39b27 100644 --- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.ts +++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.ts @@ -18,6 +18,7 @@ import { groupsModel } from '~/models/groupsModel' import { groupPropertiesModel } from '~/models/groupPropertiesModel' export const taxonomicFilterLogic = kea({ + path: (key) => ['lib', 'components', 'TaxonomicFilter', 'taxonomicFilterLogic', key], props: {} as TaxonomicFilterLogicProps, key: (props) => `${props.taxonomicFilterLogicKey}`, connect: { values: [teamLogic, ['currentTeamId'], groupsModel, ['groupTypes']] }, diff --git a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx index 0e7430a510b..12c9949314f 100644 --- a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx +++ b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx @@ -2,6 +2,7 @@ import { kea } from 'kea' import { visibilitySensorLogicType } from './visibilitySensorLogicType' export const visibilitySensorLogic = kea({ + path: (key) => ['lib', 'components', 'VisibilitySensor', 'visibilitySensorLogic', key], props: {} as { id: string offset?: number diff --git a/frontend/src/lib/experimental/NPSPrompt.tsx b/frontend/src/lib/experimental/NPSPrompt.tsx index 69836894be6..051956cdafa 100644 --- a/frontend/src/lib/experimental/NPSPrompt.tsx +++ b/frontend/src/lib/experimental/NPSPrompt.tsx @@ -24,6 +24,7 @@ interface NPSPayload { } const npsLogic = kea>({ + path: ['lib', 'experimental', 'NPSPrompt'], selectors: { featureFlagEnabled: [ () => [featureFlagLogic.selectors.featureFlags], diff --git a/frontend/src/lib/logic/prompt.jsx b/frontend/src/lib/logic/prompt.jsx index d1b6267cb48..362dff05565 100644 --- a/frontend/src/lib/logic/prompt.jsx +++ b/frontend/src/lib/logic/prompt.jsx @@ -12,6 +12,7 @@ import { Modal, Input, Form } from 'antd' // actions: // - prompt({ title, placeholder, value, error, success, failure }) export const prompt = kea({ + path: (key) => ['lib', 'logic', 'prompt', key], key: (props) => props.key, actions: () => ({ diff --git a/frontend/src/lib/logic/selectBoxLogic.ts b/frontend/src/lib/logic/selectBoxLogic.ts index 1482ecc5d90..02154bef8f6 100644 --- a/frontend/src/lib/logic/selectBoxLogic.ts +++ b/frontend/src/lib/logic/selectBoxLogic.ts @@ -37,6 +37,7 @@ export const searchItems = (sources: SelectedItem[], search: string): SelectedIt } export const selectBoxLogic = kea({ + path: ['lib', 'logic', 'selectBoxLogic'], props: {} as { items: SelectBoxItem[] updateFilter: (type: any, id: string | number, name: string) => void diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 0fcf904e2a1..c8d45909b6f 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -146,6 +146,7 @@ function sanitizeFilterParams(filters: Partial): Record export const eventUsageLogic = kea< eventUsageLogicType >({ + path: ['lib', 'utils', 'eventUsageLogic'], connect: () => [preflightLogic], actions: { reportAnnotationViewed: (annotations: AnnotationType[] | null) => ({ annotations }), diff --git a/frontend/src/models/actionsModel.ts b/frontend/src/models/actionsModel.ts index 1ee03c34d44..302b53d0ba5 100644 --- a/frontend/src/models/actionsModel.ts +++ b/frontend/src/models/actionsModel.ts @@ -8,6 +8,7 @@ interface ActionsModelProps { } export const actionsModel = kea>({ + path: ['models', 'actionsModel'], props: {} as ActionsModelProps, loaders: ({ props }) => ({ actions: { diff --git a/frontend/src/models/annotationsModel.ts b/frontend/src/models/annotationsModel.ts index 1c361232c76..4eaabfb86d4 100644 --- a/frontend/src/models/annotationsModel.ts +++ b/frontend/src/models/annotationsModel.ts @@ -8,6 +8,7 @@ import { AnnotationScope, AnnotationType } from '~/types' import { teamLogic } from '../scenes/teamLogic' export const annotationsModel = kea({ + path: ['models', 'annotationsModel'], actions: { createGlobalAnnotation: (content: string, date_marker: string, dashboard_item?: number) => ({ content, diff --git a/frontend/src/models/cohortsModel.ts b/frontend/src/models/cohortsModel.ts index d7d28edaa4d..6be081e84fd 100644 --- a/frontend/src/models/cohortsModel.ts +++ b/frontend/src/models/cohortsModel.ts @@ -6,6 +6,7 @@ import { CohortType } from '~/types' const POLL_TIMEOUT = 5000 export const cohortsModel = kea({ + path: ['models', 'cohortsModel'], actions: () => ({ setPollTimeout: (pollTimeout: number | null) => ({ pollTimeout }), updateCohort: (cohort: CohortType) => ({ cohort }), diff --git a/frontend/src/models/dashboardItemsModel.tsx b/frontend/src/models/dashboardItemsModel.tsx index e5ec1f0ba0c..6145af2eb4a 100644 --- a/frontend/src/models/dashboardItemsModel.tsx +++ b/frontend/src/models/dashboardItemsModel.tsx @@ -11,6 +11,7 @@ import { urls } from 'scenes/urls' import { teamLogic } from '../scenes/teamLogic' export const dashboardItemsModel = kea({ + path: ['models', 'dashboardItemsModel'], actions: () => ({ renameDashboardItem: (item: DashboardItemType) => ({ item }), renameDashboardItemSuccess: (item: DashboardItemType) => ({ item }), diff --git a/frontend/src/models/eventDefinitionsModel.ts b/frontend/src/models/eventDefinitionsModel.ts index 3615c5343f9..d2ecb0acf72 100644 --- a/frontend/src/models/eventDefinitionsModel.ts +++ b/frontend/src/models/eventDefinitionsModel.ts @@ -17,6 +17,7 @@ interface EventsGroupedInterface { } export const eventDefinitionsModel = kea>({ + path: ['models', 'eventDefinitionsModel'], actions: () => ({ updateDescription: (id: string, description: string | null, type: string) => ({ id, description, type }), updateEventDefinition: (eventDefinition: EventDefinition) => ({ eventDefinition }), diff --git a/frontend/src/models/funnelsModel.ts b/frontend/src/models/funnelsModel.ts index dd0d6e029ca..7eb3f554833 100644 --- a/frontend/src/models/funnelsModel.ts +++ b/frontend/src/models/funnelsModel.ts @@ -19,6 +19,7 @@ const parseSavedFunnel = (result: Record): SavedFunnel => { } export const funnelsModel = kea({ + path: ['models', 'funnelsModel'], loaders: ({ values, actions }) => ({ funnels: { __default: [] as SavedFunnel[], diff --git a/frontend/src/models/groupPropertiesModel.ts b/frontend/src/models/groupPropertiesModel.ts index 76613e66891..3ae6341ea9b 100644 --- a/frontend/src/models/groupPropertiesModel.ts +++ b/frontend/src/models/groupPropertiesModel.ts @@ -6,6 +6,7 @@ import { teamLogic } from 'scenes/teamLogic' import { groupsModel } from './groupsModel' export const groupPropertiesModel = kea({ + path: ['models', 'groupPropertiesModel'], connect: { values: [teamLogic, ['currentTeamId'], groupsModel, ['groupsEnabled']], }, diff --git a/frontend/src/models/groupsModel.ts b/frontend/src/models/groupsModel.ts index 552aa396e42..c72abd8cd60 100644 --- a/frontend/src/models/groupsModel.ts +++ b/frontend/src/models/groupsModel.ts @@ -9,6 +9,7 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types' import { preflightLogic } from 'scenes/PreflightCheck/logic' export const groupsModel = kea({ + path: ['models', 'groupsModel'], connect: { values: [ teamLogic, diff --git a/frontend/src/models/index.ts b/frontend/src/models/index.ts index d7fd35af5dd..03faab7edf6 100644 --- a/frontend/src/models/index.ts +++ b/frontend/src/models/index.ts @@ -11,6 +11,7 @@ import { modelsType } from './indexType' /** "Models" are logics that are persistently mounted (start with app) */ export const models = kea({ + path: ['models', 'index'], connect: [ actionsModel, annotationsModel, diff --git a/frontend/src/models/personPropertiesModel.ts b/frontend/src/models/personPropertiesModel.ts index ede4c5be443..fa71609d2cc 100644 --- a/frontend/src/models/personPropertiesModel.ts +++ b/frontend/src/models/personPropertiesModel.ts @@ -4,6 +4,7 @@ import api from 'lib/api' import { PersonProperty } from '~/types' export const personPropertiesModel = kea({ + path: ['models', 'personPropertiesModel'], loaders: { personProperties: [ [] as Array, diff --git a/frontend/src/models/propertyDefinitionsModel.ts b/frontend/src/models/propertyDefinitionsModel.ts index 2c98bb09965..936110d4250 100644 --- a/frontend/src/models/propertyDefinitionsModel.ts +++ b/frontend/src/models/propertyDefinitionsModel.ts @@ -16,6 +16,7 @@ interface PropertyDefinitionStorage { export const propertyDefinitionsModel = kea< propertyDefinitionsModelType >({ + path: ['models', 'propertyDefinitionsModel'], actions: () => ({ updatePropertyDefinition: (property: PropertyDefinition) => ({ property }), }), diff --git a/frontend/src/scenes/App.tsx b/frontend/src/scenes/App.tsx index f029d6df23c..1aad254e3aa 100644 --- a/frontend/src/scenes/App.tsx +++ b/frontend/src/scenes/App.tsx @@ -22,6 +22,7 @@ import { SideBar } from '../layout/lemonade/SideBar/SideBar' import { appScenes } from 'scenes/appScenes' export const appLogic = kea({ + path: ['scenes', 'App'], actions: { enableDelayedSpinner: true, ignoreFeatureFlags: true, diff --git a/frontend/src/scenes/PreflightCheck/logic.ts b/frontend/src/scenes/PreflightCheck/logic.ts index 0200f24f743..d08e8d7eecc 100644 --- a/frontend/src/scenes/PreflightCheck/logic.ts +++ b/frontend/src/scenes/PreflightCheck/logic.ts @@ -8,6 +8,7 @@ import { getAppContext } from 'lib/utils/getAppContext' type PreflightMode = 'experimentation' | 'live' export const preflightLogic = kea>({ + path: ['scenes', 'PreflightCheck', 'preflightLogic'], loaders: { preflight: [ null as PreflightStatus | null, diff --git a/frontend/src/scenes/actions/Action.tsx b/frontend/src/scenes/actions/Action.tsx index a5cbb0c62c2..368cf637218 100644 --- a/frontend/src/scenes/actions/Action.tsx +++ b/frontend/src/scenes/actions/Action.tsx @@ -18,6 +18,7 @@ interface ActionLogicProps { } const actionLogic = kea>({ + path: (key) => ['scenes', 'actions', 'actionLogic', key], props: {} as ActionLogicProps, key: (props) => props.id || 'new', actions: () => ({ diff --git a/frontend/src/scenes/actions/actionEditLogic.ts b/frontend/src/scenes/actions/actionEditLogic.ts index d8660df9d2d..66b0d7ef1e4 100644 --- a/frontend/src/scenes/actions/actionEditLogic.ts +++ b/frontend/src/scenes/actions/actionEditLogic.ts @@ -17,6 +17,7 @@ export interface ActionEditLogicProps { } export const actionEditLogic = kea>({ + path: (key) => ['scenes', 'actions', 'actionEditLogic', key], props: {} as ActionEditLogicProps, key: (props) => props.id || 'new', actions: () => ({ diff --git a/frontend/src/scenes/annotations/logic.ts b/frontend/src/scenes/annotations/logic.ts index 68f86676148..42f190a2593 100644 --- a/frontend/src/scenes/annotations/logic.ts +++ b/frontend/src/scenes/annotations/logic.ts @@ -7,6 +7,7 @@ import { AnnotationType } from '~/types' import { teamLogic } from '../teamLogic' export const annotationsTableLogic = kea({ + path: ['scenes', 'annotations', 'logic'], loaders: ({ actions }) => ({ annotations: { __default: [], diff --git a/frontend/src/scenes/authentication/inviteSignupLogic.ts b/frontend/src/scenes/authentication/inviteSignupLogic.ts index c5b7a551f51..e74f9695634 100644 --- a/frontend/src/scenes/authentication/inviteSignupLogic.ts +++ b/frontend/src/scenes/authentication/inviteSignupLogic.ts @@ -22,6 +22,7 @@ interface AcceptInvitePayloadInterface { } export const inviteSignupLogic = kea>({ + path: ['scenes', 'authentication', 'inviteSignupLogic'], actions: { setError: (payload: ErrorInterface) => ({ payload }), }, diff --git a/frontend/src/scenes/authentication/loginLogic.ts b/frontend/src/scenes/authentication/loginLogic.ts index 486e30e49d3..e98fa786455 100644 --- a/frontend/src/scenes/authentication/loginLogic.ts +++ b/frontend/src/scenes/authentication/loginLogic.ts @@ -14,6 +14,7 @@ export function afterLoginRedirect(): string { } export const loginLogic = kea>({ + path: ['scenes', 'authentication', 'loginLogic'], loaders: { authenticateResponse: [ null as AuthenticateResponseType | null, diff --git a/frontend/src/scenes/authentication/passwordResetLogic.ts b/frontend/src/scenes/authentication/passwordResetLogic.ts index 7736ce5b82e..d32be98c811 100644 --- a/frontend/src/scenes/authentication/passwordResetLogic.ts +++ b/frontend/src/scenes/authentication/passwordResetLogic.ts @@ -20,6 +20,7 @@ interface ValidatedTokenResponseType extends ResponseType { export const passwordResetLogic = kea< passwordResetLogicType >({ + path: ['scenes', 'authentication', 'passwordResetLogic'], loaders: ({ values }) => ({ resetResponse: [ null as ResetResponseType | null, diff --git a/frontend/src/scenes/authentication/signupLogic.ts b/frontend/src/scenes/authentication/signupLogic.ts index d0a4e694a54..c638a942324 100644 --- a/frontend/src/scenes/authentication/signupLogic.ts +++ b/frontend/src/scenes/authentication/signupLogic.ts @@ -11,6 +11,7 @@ interface AccountResponse { } export const signupLogic = kea>({ + path: ['scenes', 'authentication', 'signupLogic'], actions: { setInitialEmail: (email: string) => ({ email }), setFormSubmitted: (submitted: boolean) => ({ submitted }), diff --git a/frontend/src/scenes/billing/billingLogic.ts b/frontend/src/scenes/billing/billingLogic.ts index 760998e0355..7577bc854bb 100644 --- a/frontend/src/scenes/billing/billingLogic.ts +++ b/frontend/src/scenes/billing/billingLogic.ts @@ -16,6 +16,7 @@ export enum BillingAlertType { } export const billingLogic = kea>({ + path: ['scenes', 'billing', 'billingLogic'], actions: { registerInstrumentationProps: true, }, diff --git a/frontend/src/scenes/billing/billingSubscribedLogic.ts b/frontend/src/scenes/billing/billingSubscribedLogic.ts index 117acb62eab..8b259152667 100644 --- a/frontend/src/scenes/billing/billingSubscribedLogic.ts +++ b/frontend/src/scenes/billing/billingSubscribedLogic.ts @@ -10,6 +10,7 @@ export enum SubscriptionStatus { } export const billingSubscribedLogic = kea>({ + path: ['scenes', 'billing', 'billingSubscribedLogic'], connect: { actions: [sceneLogic, ['setScene']], values: [billingLogic, ['billing']], diff --git a/frontend/src/scenes/cohorts/Cohorts.tsx b/frontend/src/scenes/cohorts/Cohorts.tsx index 8844719f40b..80d1028fc3d 100644 --- a/frontend/src/scenes/cohorts/Cohorts.tsx +++ b/frontend/src/scenes/cohorts/Cohorts.tsx @@ -35,6 +35,7 @@ const NEW_COHORT: CohortType = { } const cohortsUrlLogic = kea({ + path: ['scenes', 'cohorts', 'cohortsUrlLogic'], actions: { setOpenCohort: (cohort: CohortType | null) => ({ cohort }), }, diff --git a/frontend/src/scenes/cohorts/cohortLogic.tsx b/frontend/src/scenes/cohorts/cohortLogic.tsx index 5f16dcafbe5..fcf62a5d7f7 100644 --- a/frontend/src/scenes/cohorts/cohortLogic.tsx +++ b/frontend/src/scenes/cohorts/cohortLogic.tsx @@ -41,6 +41,7 @@ export const cohortLogic = kea({ cohort: CohortType }, key: (props) => props.cohort.id || 'new', + path: (key) => ['scenes', 'cohorts', 'cohortLogic', key], connect: [cohortsModel], actions: () => ({ diff --git a/frontend/src/scenes/dashboard/dashboardLogic.tsx b/frontend/src/scenes/dashboard/dashboardLogic.tsx index a9b1a052b8f..a70a88f5d30 100644 --- a/frontend/src/scenes/dashboard/dashboardLogic.tsx +++ b/frontend/src/scenes/dashboard/dashboardLogic.tsx @@ -24,6 +24,7 @@ export interface DashboardLogicProps { export const AUTO_REFRESH_INITIAL_INTERVAL_SECONDS = 300 export const dashboardLogic = kea>({ + path: (key) => ['scenes', 'dashboard', 'dashboardLogic', key], connect: { values: [teamLogic, ['currentTeamId']], logic: [dashboardsModel, dashboardItemsModel, eventUsageLogic], @@ -226,7 +227,14 @@ export const dashboardLogic = kea>({ setRefreshStatuses: (_, { ids, loading }) => Object.fromEntries( ids.map((id) => [id, loading ? { loading: true } : { refreshed: true }]) - ) as Record, + ) as Record< + number, + { + loading?: boolean + refreshed?: boolean + error?: boolean + } + >, setRefreshError: (state, { id }) => ({ ...state, [id]: { error: true }, diff --git a/frontend/src/scenes/dashboard/dashboardsLogic.ts b/frontend/src/scenes/dashboard/dashboardsLogic.ts index 807d6d1fca2..53ca90fc183 100644 --- a/frontend/src/scenes/dashboard/dashboardsLogic.ts +++ b/frontend/src/scenes/dashboard/dashboardsLogic.ts @@ -7,6 +7,7 @@ import { uniqueBy } from 'lib/utils' import { urls } from 'scenes/urls' export const dashboardsLogic = kea({ + path: ['scenes', 'dashboard', 'dashboardsLogic'], actions: { addNewDashboard: true, setNewDashboardDrawer: (shown: boolean) => ({ shown }), diff --git a/frontend/src/scenes/events/EventsTabs.tsx b/frontend/src/scenes/events/EventsTabs.tsx index f689d47b322..b4d4308d55e 100644 --- a/frontend/src/scenes/events/EventsTabs.tsx +++ b/frontend/src/scenes/events/EventsTabs.tsx @@ -19,6 +19,7 @@ const tabUrls: Record = { } const eventsTabsLogic = kea>({ + path: ['scenes', 'events', 'eventsTabsLogic'], actions: { setTab: (tab: EventsTab) => ({ tab }), }, diff --git a/frontend/src/scenes/events/definitions/definitionDrawerLogic.ts b/frontend/src/scenes/events/definitions/definitionDrawerLogic.ts index 165fdee0bbe..93b713a8432 100644 --- a/frontend/src/scenes/events/definitions/definitionDrawerLogic.ts +++ b/frontend/src/scenes/events/definitions/definitionDrawerLogic.ts @@ -10,6 +10,7 @@ import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel' import { teamLogic } from '../../teamLogic' export const definitionDrawerLogic = kea({ + path: ['scenes', 'events', 'definitions', 'definitionDrawerLogic'], actions: () => ({ openDrawer: (type: string, id: string) => ({ type, id }), setDrawerType: (type: string) => ({ type }), diff --git a/frontend/src/scenes/events/eventsTableLogic.ts b/frontend/src/scenes/events/eventsTableLogic.ts index 56e684e3060..57e55fc3d9d 100644 --- a/frontend/src/scenes/events/eventsTableLogic.ts +++ b/frontend/src/scenes/events/eventsTableLogic.ts @@ -53,6 +53,7 @@ export interface ApiError { } export const eventsTableLogic = kea>({ + path: (key) => ['scenes', 'events', 'eventsTableLogic', key], props: {} as EventsTableLogicProps, // Set a unique key based on the fixed filters. // This way if we move back/forward between /events and /person/ID, the logic is reloaded. @@ -64,7 +65,11 @@ export const eventsTableLogic = kea { + setProperties: ( + properties: AnyPropertyFilter[] | AnyPropertyFilter + ): { + properties: AnyPropertyFilter[] + } => { // there seem to be multiple representations of "empty" properties // the page does not work with some of those representations // this action normalises them diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.tsx b/frontend/src/scenes/feature-flags/featureFlagLogic.tsx index 43263a3d0bb..76f775c0fa4 100644 --- a/frontend/src/scenes/feature-flags/featureFlagLogic.tsx +++ b/frontend/src/scenes/feature-flags/featureFlagLogic.tsx @@ -38,6 +38,7 @@ const EMPTY_MULTIVARIATE_OPTIONS: MultivariateFlagOptions = { } export const featureFlagLogic = kea({ + path: ['scenes', 'feature-flags', 'featureFlagLogic'], connect: { values: [teamLogic, ['currentTeamId']], }, diff --git a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts index 1339debdf09..6b7ec35be59 100644 --- a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts +++ b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts @@ -5,6 +5,7 @@ import { FeatureFlagType } from '~/types' import { teamLogic } from '../teamLogic' export const featureFlagsLogic = kea({ + path: ['scenes', 'feature-flags', 'featureFlagsLogic'], connect: { values: [teamLogic, ['currentTeamId']], }, diff --git a/frontend/src/scenes/ingestion/ingestionLogic.ts b/frontend/src/scenes/ingestion/ingestionLogic.ts index 6ae4999f650..5ac03cce3c6 100644 --- a/frontend/src/scenes/ingestion/ingestionLogic.ts +++ b/frontend/src/scenes/ingestion/ingestionLogic.ts @@ -8,6 +8,7 @@ import { organizationLogic } from 'scenes/organizationLogic' import { teamLogic } from 'scenes/teamLogic' export const ingestionLogic = kea({ + path: ['scenes', 'ingestion', 'ingestionLogic'], connect: { actions: [teamLogic, ['updateCurrentTeamSuccess']], }, diff --git a/frontend/src/scenes/insights/ActionFilter/entityFilterLogic.ts b/frontend/src/scenes/insights/ActionFilter/entityFilterLogic.ts index 9fae544b11d..55431ff5b66 100644 --- a/frontend/src/scenes/insights/ActionFilter/entityFilterLogic.ts +++ b/frontend/src/scenes/insights/ActionFilter/entityFilterLogic.ts @@ -45,6 +45,7 @@ export interface EntityFilterProps { export const entityFilterLogic = kea>({ props: {} as EntityFilterProps, key: (props) => props.typeKey, + path: (key) => ['scenes', 'insights', 'ActionFilter', 'entityFilterLogic', key], connect: { values: [actionsModel, ['actions']], }, diff --git a/frontend/src/scenes/insights/ActionFilter/renameModalLogic.ts b/frontend/src/scenes/insights/ActionFilter/renameModalLogic.ts index 5b650a0824c..26ab2a2a3c0 100644 --- a/frontend/src/scenes/insights/ActionFilter/renameModalLogic.ts +++ b/frontend/src/scenes/insights/ActionFilter/renameModalLogic.ts @@ -12,6 +12,7 @@ export interface RenameModalProps { export const renameModalLogic = kea>({ props: {} as RenameModalProps, key: (props) => props.typeKey, + path: (key) => ['scenes', 'insights', 'ActionFilter', 'renameModalLogic', key], connect: { actions: [entityFilterLogic, ['selectFilter']], }, diff --git a/frontend/src/scenes/insights/Histogram/histogramLogic.ts b/frontend/src/scenes/insights/Histogram/histogramLogic.ts index ac5d1e1ac4f..b96f82d4f92 100644 --- a/frontend/src/scenes/insights/Histogram/histogramLogic.ts +++ b/frontend/src/scenes/insights/Histogram/histogramLogic.ts @@ -4,6 +4,7 @@ import { histogramLogicType } from './histogramLogicType' import { FunnelLayout } from 'lib/constants' export const histogramLogic = kea({ + path: ['scenes', 'insights', 'Histogram', 'histogramLogic'], actions: { setConfig: (config: HistogramConfig) => ({ config }), }, diff --git a/frontend/src/scenes/insights/InsightDateFilter/insightDateFilterLogic.ts b/frontend/src/scenes/insights/InsightDateFilter/insightDateFilterLogic.ts index 8e66063a6d1..fbd151af717 100644 --- a/frontend/src/scenes/insights/InsightDateFilter/insightDateFilterLogic.ts +++ b/frontend/src/scenes/insights/InsightDateFilter/insightDateFilterLogic.ts @@ -10,6 +10,7 @@ interface UrlParams { } export const insightDateFilterLogic = kea({ + path: ['scenes', 'insights', 'InsightDateFilter', 'insightDateFilterLogic'], actions: () => ({ setDates: (dateFrom: string | Dayjs | undefined, dateTo: string | Dayjs | undefined) => ({ dateFrom, diff --git a/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts b/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts index 08ee19ae94a..0776fb8f697 100644 --- a/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts +++ b/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts @@ -40,6 +40,7 @@ const updateInsightState = ( /* insightHistoryLogic - Handles all logic for saved insights and recent history */ export const insightHistoryLogic = kea({ + path: ['scenes', 'insights', 'InsightHistoryPanel', 'insightHistoryLogic'], connect: { values: [teamLogic, ['currentTeamId']], }, diff --git a/frontend/src/scenes/insights/InsightTabs/FunnelTab/funnelCommandLogic.ts b/frontend/src/scenes/insights/InsightTabs/FunnelTab/funnelCommandLogic.ts index 9c49d040578..b5c00f81d64 100644 --- a/frontend/src/scenes/insights/InsightTabs/FunnelTab/funnelCommandLogic.ts +++ b/frontend/src/scenes/insights/InsightTabs/FunnelTab/funnelCommandLogic.ts @@ -9,6 +9,7 @@ import { router } from 'kea-router' const FUNNEL_COMMAND_SCOPE = 'funnels' export const funnelCommandLogic = kea({ + path: ['scenes', 'insights', 'InsightTabs', 'FunnelTab', 'funnelCommandLogic'], connect: [commandPaletteLogic], events: { afterMount: () => { diff --git a/frontend/src/scenes/insights/InsightsTable/insightsTableLogic.ts b/frontend/src/scenes/insights/InsightsTable/insightsTableLogic.ts index b90279f1bf2..8993f1de04f 100644 --- a/frontend/src/scenes/insights/InsightsTable/insightsTableLogic.ts +++ b/frontend/src/scenes/insights/InsightsTable/insightsTableLogic.ts @@ -4,6 +4,7 @@ import { insightsTableLogicType } from './insightsTableLogicType' export type CalcColumnState = 'total' | 'average' | 'median' export const insightsTableLogic = kea>({ + path: ['scenes', 'insights', 'InsightsTable', 'insightsTableLogic'], props: {} as { hasMathUniqueFilter: boolean }, diff --git a/frontend/src/scenes/insights/insightCommandLogic.ts b/frontend/src/scenes/insights/insightCommandLogic.ts index 1223a0bdd2c..2bf16586016 100644 --- a/frontend/src/scenes/insights/insightCommandLogic.ts +++ b/frontend/src/scenes/insights/insightCommandLogic.ts @@ -9,6 +9,7 @@ import { dateMapping } from 'lib/utils' const INSIGHT_COMMAND_SCOPE = 'insights' export const insightCommandLogic = kea({ + path: ['scenes', 'insights', 'insightCommandLogic'], connect: [commandPaletteLogic, compareFilterLogic, insightDateFilterLogic], events: () => ({ afterMount: () => { diff --git a/frontend/src/scenes/insights/insightLogic.tsx b/frontend/src/scenes/insights/insightLogic.tsx index da9d2575832..58e5a3d5065 100644 --- a/frontend/src/scenes/insights/insightLogic.tsx +++ b/frontend/src/scenes/insights/insightLogic.tsx @@ -48,6 +48,7 @@ export const defaultFilterTestAccounts = (): boolean => { export const insightLogic = kea({ props: {} as InsightLogicProps, key: keyForInsightLogicProps('new'), + path: (key) => ['scenes', 'insights', 'insightLogic', key], connect: { values: [teamLogic, ['currentTeamId']], diff --git a/frontend/src/scenes/insights/insightRouterLogic.ts b/frontend/src/scenes/insights/insightRouterLogic.ts index 59a3f42998c..90e1b5130de 100644 --- a/frontend/src/scenes/insights/insightRouterLogic.ts +++ b/frontend/src/scenes/insights/insightRouterLogic.ts @@ -8,6 +8,7 @@ import { cleanFilters } from 'scenes/insights/utils/cleanFilters' import { insightRouterLogicType } from './insightRouterLogicType' export const insightRouterLogic = kea({ + path: ['scenes', 'insights', 'insightRouterLogic'], actions: { loadInsight: (id: string) => ({ id }), setError: true, diff --git a/frontend/src/scenes/instance/Licenses/logic.ts b/frontend/src/scenes/instance/Licenses/logic.ts index 450ff560256..83db5979459 100644 --- a/frontend/src/scenes/instance/Licenses/logic.ts +++ b/frontend/src/scenes/instance/Licenses/logic.ts @@ -6,6 +6,7 @@ import { APIErrorType, LicenseType } from '~/types' import { preflightLogic } from '../../PreflightCheck/logic' export const licenseLogic = kea({ + path: ['scenes', 'instance', 'Licenses', 'licenseLogic'], connect: { values: [preflightLogic, ['preflight']], }, diff --git a/frontend/src/scenes/onboarding/logic.ts b/frontend/src/scenes/onboarding/logic.ts index 7b06d6e05fd..5c8fc5714a0 100644 --- a/frontend/src/scenes/onboarding/logic.ts +++ b/frontend/src/scenes/onboarding/logic.ts @@ -7,6 +7,7 @@ interface AccountResponse { } export const signupLogic = kea>({ + path: ['scenes', 'onboarding', 'signupLogic'], loaders: () => ({ account: [ null as AccountResponse | null, diff --git a/frontend/src/scenes/onboarding/onboardingSetupLogic.ts b/frontend/src/scenes/onboarding/onboardingSetupLogic.ts index 705dc456fa1..f9933e07b66 100644 --- a/frontend/src/scenes/onboarding/onboardingSetupLogic.ts +++ b/frontend/src/scenes/onboarding/onboardingSetupLogic.ts @@ -8,6 +8,7 @@ import { OrganizationType, TeamType } from '~/types' import { onboardingSetupLogicType } from './onboardingSetupLogicType' export const onboardingSetupLogic = kea({ + path: ['scenes', 'onboarding', 'onboardingSetupLogic'], actions: { switchToNonDemoProject: (dest) => ({ dest }), setProjectModalShown: (shown) => ({ shown }), diff --git a/frontend/src/scenes/onboarding/personalizationLogic.ts b/frontend/src/scenes/onboarding/personalizationLogic.ts index fedee8cd0bb..0f3284aa7a3 100644 --- a/frontend/src/scenes/onboarding/personalizationLogic.ts +++ b/frontend/src/scenes/onboarding/personalizationLogic.ts @@ -7,6 +7,7 @@ import { router } from 'kea-router' import { urls } from 'scenes/urls' export const personalizationLogic = kea({ + path: ['scenes', 'onboarding', 'personalizationLogic'], connect: { actions: [organizationLogic, ['updateOrganizationSuccess', 'loadCurrentOrganizationSuccess']], }, diff --git a/frontend/src/scenes/organization/Settings/bulkInviteLogic.ts b/frontend/src/scenes/organization/Settings/bulkInviteLogic.ts index 3a0ae33e24d..a80200e0f70 100644 --- a/frontend/src/scenes/organization/Settings/bulkInviteLogic.ts +++ b/frontend/src/scenes/organization/Settings/bulkInviteLogic.ts @@ -17,6 +17,7 @@ interface InviteRowState { const EMPTY_INVITE: InviteRowState = { target_email: '', first_name: '', isValid: true } export const bulkInviteLogic = kea>({ + path: ['scenes', 'organization', 'Settings', 'bulkInviteLogic'], actions: { updateInviteAtIndex: (payload, index: number) => ({ payload, index }), deleteInviteAtIndex: (index: number) => ({ index }), diff --git a/frontend/src/scenes/organization/Settings/invitesLogic.tsx b/frontend/src/scenes/organization/Settings/invitesLogic.tsx index b75b4f7f5e2..c469878e59e 100644 --- a/frontend/src/scenes/organization/Settings/invitesLogic.tsx +++ b/frontend/src/scenes/organization/Settings/invitesLogic.tsx @@ -9,6 +9,7 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { preflightLogic } from 'scenes/PreflightCheck/logic' export const invitesLogic = kea({ + path: ['scenes', 'organization', 'Settings', 'invitesLogic'], loaders: ({ values }) => ({ invites: { __default: [] as OrganizationInviteType[], diff --git a/frontend/src/scenes/organization/Settings/membersLogic.tsx b/frontend/src/scenes/organization/Settings/membersLogic.tsx index 460c3fd8049..ef3b6777538 100644 --- a/frontend/src/scenes/organization/Settings/membersLogic.tsx +++ b/frontend/src/scenes/organization/Settings/membersLogic.tsx @@ -11,6 +11,7 @@ import { userLogic } from 'scenes/userLogic' import { membershipLevelToName } from '../../../lib/utils/permissioning' export const membersLogic = kea({ + path: ['scenes', 'organization', 'Settings', 'membersLogic'], actions: { changeMemberAccessLevel: (member: OrganizationMemberType, level: OrganizationMembershipLevel) => ({ member, diff --git a/frontend/src/scenes/organizationLogic.tsx b/frontend/src/scenes/organizationLogic.tsx index 2f54cb5148c..363478efec9 100644 --- a/frontend/src/scenes/organizationLogic.tsx +++ b/frontend/src/scenes/organizationLogic.tsx @@ -12,6 +12,7 @@ export type OrganizationUpdatePayload = Partial< > export const organizationLogic = kea>({ + path: ['scenes', 'organizationLogic'], actions: { deleteOrganization: (organization: OrganizationType) => ({ organization }), deleteOrganizationSuccess: true, diff --git a/frontend/src/scenes/paths/pathsLogic.ts b/frontend/src/scenes/paths/pathsLogic.ts index 1f9e9fd58a4..1d52520ae59 100644 --- a/frontend/src/scenes/paths/pathsLogic.ts +++ b/frontend/src/scenes/paths/pathsLogic.ts @@ -35,6 +35,7 @@ interface PathNode { } export const pathsLogic = kea>({ + path: (key) => ['scenes', 'paths', 'pathsLogic', key], props: {} as InsightLogicProps, key: keyForInsightLogicProps(DEFAULT_PATH_LOGIC_KEY), diff --git a/frontend/src/scenes/persons/mergeSplitPersonLogic.ts b/frontend/src/scenes/persons/mergeSplitPersonLogic.ts index 447693b3ccc..5c050d4372d 100644 --- a/frontend/src/scenes/persons/mergeSplitPersonLogic.ts +++ b/frontend/src/scenes/persons/mergeSplitPersonLogic.ts @@ -21,6 +21,7 @@ type PersonIds = NonNullable[] export const mergeSplitPersonLogic = kea>({ props: {} as SplitPersonLogicProps, key: (props) => props.person.id, + path: (key) => ['scenes', 'persons', 'mergeSplitPersonLogic', key || 'new'], connect: { actions: [personsLogic, ['setListFilters', 'loadPersons', 'setPerson', 'setSplitMergeModalShown']], values: [personsLogic, ['persons']], diff --git a/frontend/src/scenes/persons/personsLogic.ts b/frontend/src/scenes/persons/personsLogic.ts index b9210ec0b6b..da32a62a85a 100644 --- a/frontend/src/scenes/persons/personsLogic.ts +++ b/frontend/src/scenes/persons/personsLogic.ts @@ -19,6 +19,7 @@ interface PersonPaginatedResponse { const FILTER_ALLOWLIST: string[] = ['is_identified', 'search', 'cohort'] export const personsLogic = kea>({ + path: ['scenes', 'persons', 'personsLogic'], connect: { actions: [eventUsageLogic, ['reportPersonDetailViewed']], values: [featureFlagLogic, ['featureFlags'], teamLogic, ['currentTeam']], diff --git a/frontend/src/scenes/plugins/edit/interface-jobs/interfaceJobsLogic.ts b/frontend/src/scenes/plugins/edit/interface-jobs/interfaceJobsLogic.ts index 4edafad8c99..c69292b3718 100644 --- a/frontend/src/scenes/plugins/edit/interface-jobs/interfaceJobsLogic.ts +++ b/frontend/src/scenes/plugins/edit/interface-jobs/interfaceJobsLogic.ts @@ -18,6 +18,7 @@ export const interfaceJobsLogic = kea({ key: (props) => { return `${props.pluginId}_${props.jobName}` }, + path: (key) => ['scenes', 'plugins', 'edit', 'interface-jobs', 'interfaceJobsLogic', key], connect: { actions: [pluginsLogic, ['showPluginLogs']], }, diff --git a/frontend/src/scenes/plugins/plugin/pluginLogsLogic.ts b/frontend/src/scenes/plugins/plugin/pluginLogsLogic.ts index f175b1387e3..7f155063671 100644 --- a/frontend/src/scenes/plugins/plugin/pluginLogsLogic.ts +++ b/frontend/src/scenes/plugins/plugin/pluginLogsLogic.ts @@ -14,6 +14,7 @@ export const LOGS_PORTION_LIMIT = 50 export const pluginLogsLogic = kea>({ props: {} as PluginLogsProps, key: ({ pluginConfigId }: PluginLogsProps) => pluginConfigId, + path: (key) => ['scenes', 'plugins', 'plugin', 'pluginLogsLogic', key], connect: { values: [teamLogic, ['currentTeamId']], }, diff --git a/frontend/src/scenes/plugins/pluginsLogic.ts b/frontend/src/scenes/plugins/pluginsLogic.ts index a982e480b59..bf349e59bcc 100644 --- a/frontend/src/scenes/plugins/pluginsLogic.ts +++ b/frontend/src/scenes/plugins/pluginsLogic.ts @@ -35,6 +35,7 @@ function capturePluginEvent(event: string, plugin: PluginType, type?: PluginInst } export const pluginsLogic = kea>({ + path: ['scenes', 'plugins', 'pluginsLogic'], actions: { editPlugin: (id: number | null, pluginConfigChanges: Record = {}) => ({ id, pluginConfigChanges }), savePluginConfig: (pluginConfigChanges: Record) => ({ pluginConfigChanges }), diff --git a/frontend/src/scenes/project/Settings/teamMembersLogic.tsx b/frontend/src/scenes/project/Settings/teamMembersLogic.tsx index 8d55b5750a2..df8f84030d5 100644 --- a/frontend/src/scenes/project/Settings/teamMembersLogic.tsx +++ b/frontend/src/scenes/project/Settings/teamMembersLogic.tsx @@ -21,6 +21,7 @@ import { teamLogic } from '../../teamLogic' export const MINIMUM_IMPLICIT_ACCESS_LEVEL = OrganizationMembershipLevel.Admin export const teamMembersLogic = kea({ + path: ['scenes', 'project', 'Settings', 'teamMembersLogic'], actions: { changeUserAccessLevel: (user: UserBasicType, newLevel: TeamMembershipLevel) => ({ user, diff --git a/frontend/src/scenes/project/Settings/webhookIntegrationLogic.ts b/frontend/src/scenes/project/Settings/webhookIntegrationLogic.ts index 7fe6a2113c4..5ae01a84f21 100644 --- a/frontend/src/scenes/project/Settings/webhookIntegrationLogic.ts +++ b/frontend/src/scenes/project/Settings/webhookIntegrationLogic.ts @@ -10,6 +10,7 @@ function adjustDiscordWebhook(webhookUrl: string): string { } export const webhookIntegrationLogic = kea({ + path: ['scenes', 'project', 'Settings', 'webhookIntegrationLogic'], loaders: ({ actions }) => ({ testedWebhook: [ null as string | null, diff --git a/frontend/src/scenes/retention/retentionTableLogic.ts b/frontend/src/scenes/retention/retentionTableLogic.ts index a37352ee397..ecf7ac0bb00 100644 --- a/frontend/src/scenes/retention/retentionTableLogic.ts +++ b/frontend/src/scenes/retention/retentionTableLogic.ts @@ -33,6 +33,7 @@ const DEFAULT_RETENTION_LOGIC_KEY = 'default_retention_key' export const retentionTableLogic = kea({ props: {} as InsightLogicProps, key: keyForInsightLogicProps(DEFAULT_RETENTION_LOGIC_KEY), + path: (key) => ['scenes', 'retention', 'retentionTableLogic', key], connect: (props: InsightLogicProps) => ({ values: [insightLogic(props), ['filters', 'insight', 'insightLoading'], actionsModel, ['actions']], actions: [insightLogic(props), ['loadResultsSuccess']], diff --git a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts index dad0a6cdf83..31ee691e419 100644 --- a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts +++ b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts @@ -46,6 +46,7 @@ function cleanFilters(values: Partial): SavedInsightFilters } export const savedInsightsLogic = kea>({ + path: ['scenes', 'saved-insights', 'savedInsightsLogic'], connect: { values: [teamLogic, ['currentTeamId']], logic: [eventUsageLogic], @@ -218,7 +219,16 @@ export const savedInsightsLogic = kea { - const changeUrl = (): [string, Record, Record, { replace: true }] | void => { + const changeUrl = (): + | [ + string, + Record, + Record, + { + replace: true + } + ] + | void => { const nextValues = cleanFilters(values.filters) const urlValues = cleanFilters(router.values.searchParams) if (!objectsEqual(nextValues, urlValues)) { diff --git a/frontend/src/scenes/session-recordings/DurationFilterLogic.ts b/frontend/src/scenes/session-recordings/DurationFilterLogic.ts index 66a1f3c0eab..1bf0f9e6f73 100644 --- a/frontend/src/scenes/session-recordings/DurationFilterLogic.ts +++ b/frontend/src/scenes/session-recordings/DurationFilterLogic.ts @@ -18,6 +18,7 @@ export interface DurationFilterProps { const TIME_MULTIPLIERS = { seconds: 1, minutes: 60, hours: 3600 } export const DurationFilterLogic = kea>({ + path: (key) => ['scenes', 'session-recordings', 'DurationFilterLogic', key], key: (props) => props.pageKey || 'global', props: {} as DurationFilterProps, actions: { diff --git a/frontend/src/scenes/session-recordings/player/seekbarLogic.ts b/frontend/src/scenes/session-recordings/player/seekbarLogic.ts index 6dda63f5d05..d2e4cc1a53f 100644 --- a/frontend/src/scenes/session-recordings/player/seekbarLogic.ts +++ b/frontend/src/scenes/session-recordings/player/seekbarLogic.ts @@ -21,6 +21,7 @@ import { import dayjs from 'dayjs' export const seekbarLogic = kea({ + path: ['scenes', 'session-recordings', 'player', 'seekbarLogic'], connect: { values: [ sessionRecordingPlayerLogic, diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts index 86d88b69bbe..f55ce0ccb20 100644 --- a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts +++ b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts @@ -19,6 +19,7 @@ export function getOffsetTime(zeroOffsetTime: number, meta: playerMetaData): num } export const sessionRecordingPlayerLogic = kea({ + path: ['scenes', 'session-recordings', 'player', 'sessionRecordingPlayerLogic'], connect: { logic: [eventUsageLogic], values: [ diff --git a/frontend/src/scenes/session-recordings/sessionRecordingLogic.ts b/frontend/src/scenes/session-recordings/sessionRecordingLogic.ts index a61a8a40610..e3f6d9d1057 100644 --- a/frontend/src/scenes/session-recordings/sessionRecordingLogic.ts +++ b/frontend/src/scenes/session-recordings/sessionRecordingLogic.ts @@ -23,6 +23,7 @@ export const parseMetadataResponse = (metadata: Record): Partial({ + path: ['scenes', 'session-recordings', 'sessionRecordingLogic'], connect: { logic: [eventUsageLogic], values: [teamLogic, ['currentTeamId']], diff --git a/frontend/src/scenes/session-recordings/sessionRecordingsTableLogic.ts b/frontend/src/scenes/session-recordings/sessionRecordingsTableLogic.ts index 72521655282..1b753c4409c 100644 --- a/frontend/src/scenes/session-recordings/sessionRecordingsTableLogic.ts +++ b/frontend/src/scenes/session-recordings/sessionRecordingsTableLogic.ts @@ -47,6 +47,7 @@ export const DEFAULT_ENTITY_FILTERS = { } export const sessionRecordingsTableLogic = kea>({ + path: (key) => ['scenes', 'session-recordings', 'sessionRecordingsTableLogic', key], key: (props) => props.personUUID || 'global', props: {} as { personUUID?: PersonUUID diff --git a/frontend/src/scenes/sessions/LEGACY_sessionsPlayLogic.ts b/frontend/src/scenes/sessions/LEGACY_sessionsPlayLogic.ts index 9b14287c505..f91cab32ecc 100644 --- a/frontend/src/scenes/sessions/LEGACY_sessionsPlayLogic.ts +++ b/frontend/src/scenes/sessions/LEGACY_sessionsPlayLogic.ts @@ -34,6 +34,7 @@ const convertToNewSessionPlayerDataType = (legacyData: LEGACY_SessionPlayerData) } export const LEGACY_sessionsPlayLogic = kea({ + path: ['scenes', 'sessions', 'LEGACY_sessionsPlayLogic'], connect: { logic: [eventUsageLogic], values: [ diff --git a/frontend/src/scenes/sessions/filters/sessionsFiltersLogic.tsx b/frontend/src/scenes/sessions/filters/sessionsFiltersLogic.tsx index 5ebb3158372..d2292b94215 100644 --- a/frontend/src/scenes/sessions/filters/sessionsFiltersLogic.tsx +++ b/frontend/src/scenes/sessions/filters/sessionsFiltersLogic.tsx @@ -20,6 +20,7 @@ export interface SavedFilter { type FilterPropertyType = SessionsPropertyFilter['type'] export const sessionsFiltersLogic = kea>({ + path: ['scenes', 'sessions', 'filters', 'sessionsFiltersLogic'], actions: () => ({ openFilterSelect: (selector: FilterSelector) => ({ selector }), closeFilterSelect: true, diff --git a/frontend/src/scenes/sessions/sessionsTableLogic.ts b/frontend/src/scenes/sessions/sessionsTableLogic.ts index 4869b1da001..0fca27bd452 100644 --- a/frontend/src/scenes/sessions/sessionsTableLogic.ts +++ b/frontend/src/scenes/sessions/sessionsTableLogic.ts @@ -28,10 +28,11 @@ interface Params { } export const sessionsTableLogic = kea>({ - key: (props) => props.personIds || 'global', props: {} as { personIds?: string[] }, + key: (props) => props.personIds || 'global', + path: (key) => ['scenes', 'sessions', 'sessionsTableLogic', Array.isArray(key) ? key.join(',') : key], connect: { values: [sessionsFiltersLogic, ['filters']], actions: [sessionsFiltersLogic, ['setAllFilters', 'removeFilter']], diff --git a/frontend/src/scenes/teamLogic.tsx b/frontend/src/scenes/teamLogic.tsx index d8ad1b84444..d7ad1507d69 100644 --- a/frontend/src/scenes/teamLogic.tsx +++ b/frontend/src/scenes/teamLogic.tsx @@ -10,6 +10,7 @@ import { organizationLogic } from './organizationLogic' import { getAppContext } from '../lib/utils/getAppContext' export const teamLogic = kea({ + path: ['scenes', 'teamLogic'], actions: { deleteTeam: (team: TeamType) => ({ team }), deleteTeamSuccess: true, diff --git a/frontend/src/scenes/trends/personsModalLogic.tsx b/frontend/src/scenes/trends/personsModalLogic.tsx index ac2e51de7ca..49ece641ded 100644 --- a/frontend/src/scenes/trends/personsModalLogic.tsx +++ b/frontend/src/scenes/trends/personsModalLogic.tsx @@ -88,6 +88,7 @@ export function parsePeopleParams(peopleParams: PeopleParamType, filters: Partia } export const personsModalLogic = kea>({ + path: ['scenes', 'trends', 'personsModalLogic'], actions: () => ({ setSearchTerm: (term: string) => ({ term }), setCohortModalVisible: (visible: boolean) => ({ visible }), diff --git a/frontend/src/scenes/trends/trendsLogic.ts b/frontend/src/scenes/trends/trendsLogic.ts index b166534d4ec..921db749838 100644 --- a/frontend/src/scenes/trends/trendsLogic.ts +++ b/frontend/src/scenes/trends/trendsLogic.ts @@ -10,6 +10,7 @@ import { isTrendsInsight, keyForInsightLogicProps } from 'scenes/insights/shared export const trendsLogic = kea({ props: {} as InsightLogicProps, key: keyForInsightLogicProps('all_trends'), + path: (key) => ['scenes', 'trends', 'trendsLogic', key], connect: (props: InsightLogicProps) => ({ values: [insightLogic(props), ['filters', 'insight', 'insightLoading']], diff --git a/frontend/src/scenes/userLogic.tsx b/frontend/src/scenes/userLogic.tsx index 323942ea1ba..3cc9403d380 100644 --- a/frontend/src/scenes/userLogic.tsx +++ b/frontend/src/scenes/userLogic.tsx @@ -9,6 +9,7 @@ import { getAppContext } from 'lib/utils/getAppContext' import { teamLogic } from './teamLogic' export const userLogic = kea({ + path: ['scenes', 'userLogic'], connect: { values: [teamLogic, ['currentTeam']], }, diff --git a/frontend/src/toolbar/actions/actionsLogic.ts b/frontend/src/toolbar/actions/actionsLogic.ts index dcebbcf154c..fb14b94d9da 100644 --- a/frontend/src/toolbar/actions/actionsLogic.ts +++ b/frontend/src/toolbar/actions/actionsLogic.ts @@ -6,6 +6,7 @@ import Fuse from 'fuse.js' import { toolbarFetch } from '~/toolbar/utils' export const actionsLogic = kea({ + path: ['toolbar', 'actions', 'actionsLogic'], actions: { setSearchTerm: (searchTerm: string) => ({ searchTerm }), }, diff --git a/frontend/src/toolbar/actions/actionsTabLogic.tsx b/frontend/src/toolbar/actions/actionsTabLogic.tsx index d691089f5e0..6e5051ec2f5 100644 --- a/frontend/src/toolbar/actions/actionsTabLogic.tsx +++ b/frontend/src/toolbar/actions/actionsTabLogic.tsx @@ -22,6 +22,7 @@ function newAction(element: HTMLElement | null, dataAttributes: string[] = []): type ActionFormInstance = FormInstance export const actionsTabLogic = kea>({ + path: ['toolbar', 'actions', 'actionsTabLogic'], actions: { setForm: (form: ActionFormInstance) => ({ form }), selectAction: (id: number | null) => ({ id: id || null }), diff --git a/frontend/src/toolbar/elements/elementsLogic.ts b/frontend/src/toolbar/elements/elementsLogic.ts index 6b37b077d5c..88ee63cd800 100644 --- a/frontend/src/toolbar/elements/elementsLogic.ts +++ b/frontend/src/toolbar/elements/elementsLogic.ts @@ -16,6 +16,7 @@ type ActionElementMap = Map type ElementMap = Map export const elementsLogic = kea>({ + path: ['toolbar', 'elements', 'elementsLogic'], actions: { enableInspect: true, disableInspect: true, diff --git a/frontend/src/toolbar/elements/heatmapLogic.ts b/frontend/src/toolbar/elements/heatmapLogic.ts index f9fb9e4fb2d..932b2aab540 100644 --- a/frontend/src/toolbar/elements/heatmapLogic.ts +++ b/frontend/src/toolbar/elements/heatmapLogic.ts @@ -10,6 +10,7 @@ import { posthog } from '~/toolbar/posthog' import { collectAllElementsDeep, querySelectorAllDeep } from 'query-selector-shadow-dom' export const heatmapLogic = kea({ + path: ['toolbar', 'elements', 'heatmapLogic'], actions: { enableHeatmap: true, disableHeatmap: true, diff --git a/frontend/src/toolbar/flags/featureFlagsLogic.ts b/frontend/src/toolbar/flags/featureFlagsLogic.ts index bce48947083..ad4c5856603 100644 --- a/frontend/src/toolbar/flags/featureFlagsLogic.ts +++ b/frontend/src/toolbar/flags/featureFlagsLogic.ts @@ -7,6 +7,7 @@ import Fuse from 'fuse.js' import { posthog } from '~/toolbar/posthog' export const featureFlagsLogic = kea({ + path: ['toolbar', 'flags', 'featureFlagsLogic'], actions: { getUserFlags: true, setOverriddenUserFlag: (flagId: number, overrideValue: string | boolean) => ({ flagId, overrideValue }), diff --git a/frontend/src/toolbar/stats/currentPageLogic.ts b/frontend/src/toolbar/stats/currentPageLogic.ts index 8696895f3ce..ef2e1062bc9 100644 --- a/frontend/src/toolbar/stats/currentPageLogic.ts +++ b/frontend/src/toolbar/stats/currentPageLogic.ts @@ -2,6 +2,7 @@ import { kea } from 'kea' import { currentPageLogicType } from './currentPageLogicType' export const currentPageLogic = kea({ + path: ['toolbar', 'stats', 'currentPageLogic'], actions: () => ({ setHref: (href: string) => ({ href }), }), diff --git a/frontend/src/toolbar/toolbarLogic.ts b/frontend/src/toolbar/toolbarLogic.ts index eba3cdf9cf4..3e7b811ba4c 100644 --- a/frontend/src/toolbar/toolbarLogic.ts +++ b/frontend/src/toolbar/toolbarLogic.ts @@ -10,6 +10,7 @@ import { featureFlagsLogic } from '~/toolbar/flags/featureFlagsLogic' // input: props = all editorProps export const toolbarLogic = kea({ + path: ['toolbar', 'toolbarLogic'], props: {} as ToolbarProps, connect: () => [ featureFlagsLogic, // makes an API call that invalidates the token on error diff --git a/package.json b/package.json index 98eda161bd6..c469f14c2f4 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "kea": "^2.5.4", "kea-loaders": "^0.5.1", "kea-localstorage": "^1.1.1", - "kea-router": "^1.0.5", + "kea-router": "^1.0.6", "kea-waitfor": "^0.2.1", "kea-window-values": "^0.1.0", "md5": "^2.3.0", @@ -173,7 +173,7 @@ "husky": "^4.3.8", "jest": "^26.6.3", "kea-test-utils": "^0.2.1", - "kea-typegen": "^1.2.2", + "kea-typegen": "^1.3.0", "less": "^3.12.2", "less-loader": "^7.0.2", "lint-staged": "~10.2.13", diff --git a/yarn.lock b/yarn.lock index d07b5751128..060daf19250 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10970,10 +10970,10 @@ kea-localstorage@^1.1.1: resolved "https://registry.yarnpkg.com/kea-localstorage/-/kea-localstorage-1.1.1.tgz#6edf69476779e002708fb10f2360e48333707406" integrity sha512-YijSF33Y1QpfHAq1hGvulWWoGC9Kckd4lVa+XStHar4t7GfoaDa1aWnTeJxzz9bWnJovfk+MnG8ekP4rWIqINA== -kea-router@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/kea-router/-/kea-router-1.0.5.tgz#1e6e2e820bf012904589b356356dcd3156360fb9" - integrity sha512-EIY/0SmdtLrKTxmoE+MaB1GOQ0HHr4a38TS4ub4ylQ7mQ+lyC2D8m4KIbYRYJ9wFvkEK2QOMsuVQbmfD1AXEOA== +kea-router@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/kea-router/-/kea-router-1.0.6.tgz#2e8fbbde5bdabe1a884d454ffa336070391f093d" + integrity sha512-oOzPAVQKKuM8M9b1friYfUJ2j4BlZ39f3CdjwPjX5w9v2Gff4V7hyZo5BxmTfv2YH9tLSwGymDV6fID5JHpDcw== dependencies: url-pattern "^1.0.3" @@ -10984,10 +10984,10 @@ kea-test-utils@^0.2.1: dependencies: kea-waitfor "^0.2.1" -kea-typegen@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/kea-typegen/-/kea-typegen-1.2.2.tgz#1eec505c9b570b13053a4fd0a048f5390d0b211b" - integrity sha512-2Ushf0mZWqpJMbBBc7raDtUIqOkxv7SmRQs4Y3R5pyMfcw5zOcxAJJKwnX9QfYK0N37O8GlGs7wQLti17md99A== +kea-typegen@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/kea-typegen/-/kea-typegen-1.3.0.tgz#bb2cb334d4643ecea6c675ba17f7d241031802be" + integrity sha512-4LADs4rJ8Jh1QhR9ejhG2l2zLlB816k9RgKDHi8JLK53bqS/xc9YJdHUPlenKfq6tuhCsYCPaCVPoJ2Df44u3w== dependencies: "@wessberg/ts-clone-node" "0.3.19" diff "^5.0.0"