diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 340e8764e9f7b..15d7863124281 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -235,7 +235,6 @@ export const eventUsageLogic = kea([ reportPersonsModalViewed: (params: any) => ({ params, }), - reportCohortCreatedFromPersonsModal: (filters: Partial) => ({ filters }), // insights reportInsightCreated: (insightType: InsightType | null) => ({ insightType }), reportInsightSaved: (filters: Partial, isNewInsight: boolean) => ({ filters, isNewInsight }), @@ -642,9 +641,6 @@ export const eventUsageLogic = kea([ reportPersonsModalViewed: async ({ params }) => { posthog.capture('insight person modal viewed', params) }, - reportCohortCreatedFromPersonsModal: async ({ filters }) => { - posthog.capture('person modal cohort created', sanitizeFilterParams(filters)) - }, reportDashboardViewed: async ({ dashboard, lastRefreshed, delay }, breakpoint) => { if (!delay) { await breakpoint(500) // Debounce to avoid noisy events from continuous navigation diff --git a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts b/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts index cf6e8bdac8c57..224464a866831 100644 --- a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts +++ b/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts @@ -3,7 +3,7 @@ import { actions, afterMount, connect, kea, listeners, path, props, propsChanged import { loaders } from 'kea-loaders' import { router, urlToAction } from 'kea-router' import api from 'lib/api' -import { fromParamsGivenUrl, isGroupType } from 'lib/utils' +import { isGroupType } from 'lib/utils' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { cleanFilters } from 'scenes/insights/utils/cleanFilters' import { urls } from 'scenes/urls' @@ -75,7 +75,7 @@ export const personsModalLogic = kea([ }), connect({ values: [groupsModel, ['groupTypes', 'aggregationLabel']], - actions: [eventUsageLogic, ['reportCohortCreatedFromPersonsModal', 'reportPersonsModalViewed']], + actions: [eventUsageLogic, ['reportPersonsModalViewed']], }), loaders(({ values, actions, props }) => ({ @@ -250,33 +250,16 @@ export const personsModalLogic = kea([ is_static: true, name: cohortName, } - if (values.actorsQuery) { - const cohort = await api.create('api/cohort', { ...cohortParams, query: values.actorsQuery }) - cohortsModel.actions.cohortCreated(cohort) - lemonToast.success('Cohort saved', { - toastId: `cohort-saved-${cohort.id}`, - button: { - label: 'View cohort', - action: () => router.actions.push(urls.cohort(cohort.id)), - }, - }) - actions.setIsCohortModalOpen(false) - } else { - const qs = props.url?.split('?').pop() || '' - const cohort = await api.create('api/cohort?' + qs, cohortParams) - cohortsModel.actions.cohortCreated(cohort) - lemonToast.success('Cohort saved', { - toastId: `cohort-saved-${cohort.id}`, - button: { - label: 'View cohort', - action: () => router.actions.push(urls.cohort(cohort.id)), - }, - }) - - const filters = fromParamsGivenUrl('?' + qs) - actions.setIsCohortModalOpen(false) - actions.reportCohortCreatedFromPersonsModal(filters) - } + const cohort = await api.create('api/cohort', { ...cohortParams, query: values.actorsQuery }) + cohortsModel.actions.cohortCreated(cohort) + lemonToast.success('Cohort saved', { + toastId: `cohort-saved-${cohort.id}`, + button: { + label: 'View cohort', + action: () => router.actions.push(urls.cohort(cohort.id)), + }, + }) + actions.setIsCohortModalOpen(false) }, loadNextActors: () => { if (values.actorsResponse?.next) {