diff --git a/cypress/integration/funnels.js b/cypress/integration/funnels.js index 2e059aa785dfb..7a14ecd1f1bd7 100644 --- a/cypress/integration/funnels.js +++ b/cypress/integration/funnels.js @@ -23,6 +23,9 @@ describe('Funnels', () => { cy.get('[data-attr=date-filter]').click() cy.contains('Last 30 days').click() + cy.get('[data-attr=date-filter]').click() + cy.contains('Last 30 days').click() + cy.get('[data-attr=funnel-viz]').should('exist') }) diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 0000000000000..cf5bc0109c957 Binary files /dev/null and b/dump.rdb differ diff --git a/frontend/src/lib/components/AppEditorLink/appUrlsLogic.js b/frontend/src/lib/components/AppEditorLink/appUrlsLogic.js index 730e0ce175cbf..790a854dac723 100644 --- a/frontend/src/lib/components/AppEditorLink/appUrlsLogic.js +++ b/frontend/src/lib/components/AppEditorLink/appUrlsLogic.js @@ -23,7 +23,7 @@ export const appUrlsLogic = kea({ events: [{ id: '$pageview', name: '$pageview', type: 'events' }], breakdown: '$current_url', } - let data = await api.get('api/action/trends/?' + toParams(params)) + let data = await api.get('api/insight/trend/?' + toParams(params)) if (data[0]?.count === 0) return [] let domainsSeen = [] return data diff --git a/frontend/src/models/funnelsModel.ts b/frontend/src/models/funnelsModel.ts index c0dda30c0730d..171eb451229ad 100644 --- a/frontend/src/models/funnelsModel.ts +++ b/frontend/src/models/funnelsModel.ts @@ -3,9 +3,9 @@ import api from 'lib/api' import { toParams } from 'lib/utils' import { ViewType } from 'scenes/insights/insightLogic' import { SavedFunnel } from '~/types' -import { funnelsModelType } from './funnelsModelType' import { insightHistoryLogic } from 'scenes/insights/InsightHistoryPanel/insightHistoryLogic' import { funnelLogic } from 'scenes/funnels/funnelLogic' +import { funnelsModelType } from 'types/models/funnelsModelType' const parseSavedFunnel = (result: Record): SavedFunnel => { return { @@ -25,7 +25,7 @@ export const funnelsModel = kea>({ __default: [] as SavedFunnel[], loadFunnels: async () => { const response = await api.get( - 'api/dashboard_item/?' + + 'api/insight/?' + toParams({ order: '-created_at', saved: true, diff --git a/frontend/src/scenes/funnels/funnelLogic.js b/frontend/src/scenes/funnels/funnelLogic.js index 009e1bdea4351..dc90214cd669b 100644 --- a/frontend/src/scenes/funnels/funnelLogic.js +++ b/frontend/src/scenes/funnels/funnelLogic.js @@ -12,12 +12,12 @@ function wait(ms = 1000) { const SECONDS_TO_POLL = 120 export async function pollFunnel(params = {}) { - let result = await api.get('api/action/funnel/?' + toParams(params)) + let result = await api.get('api/insight/funnel/?' + toParams(params)) let count = 0 while (result.loading && count < SECONDS_TO_POLL) { await wait() const { refresh: _, ...restParams } = params - result = await api.get('api/action/funnel/?' + toParams(restParams)) + result = await api.get('api/insight/funnel/?' + toParams(restParams)) count += 1 } // if endpoint is still loading after 2 minutes just return default @@ -139,7 +139,7 @@ export const funnelLogic = kea({ actions.setSteps(result) }, saveFunnelInsight: async ({ name }) => { - await api.create('api/dashboard_item', { + await api.create('api/insight', { filters: values.filters, name, saved: true, diff --git a/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx b/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx index 45198d8933954..68a90a82b3855 100644 --- a/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx +++ b/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx @@ -61,7 +61,7 @@ export const determineFilters = ( } else if (viewType === ViewType.RETENTION) { if (filters.target) result.push({ key: 'Target', value: `${filters.target.name}` }) } else if (viewType === ViewType.PATHS) { - if (filters.type) result.push({ key: 'Path Type', value: `${filters.type}` }) + if (filters.type) result.push({ key: 'Path Type', value: `${filters.type || filters.path_type}` }) if (filters.start) result.push({ key: 'Start Point', value: `Specified` }) } else if (viewType === ViewType.FUNNELS) { let count = 0 diff --git a/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts b/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts index 0b5521a8f3bf3..1f7dc9ce1adf8 100644 --- a/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts +++ b/frontend/src/scenes/insights/InsightHistoryPanel/insightHistoryLogic.ts @@ -40,7 +40,7 @@ export const insightHistoryLogic = kea>( __default: [] as InsightHistory[], loadInsights: async () => { const response = await api.get( - 'api/dashboard_item/?' + + 'api/insight/?' + toParams({ order: '-created_at', limit: 6, @@ -57,7 +57,7 @@ export const insightHistoryLogic = kea>( __default: [] as InsightHistory[], loadSavedInsights: async () => { const response = await api.get( - 'api/dashboard_item/?' + + 'api/insight/?' + toParams({ order: '-created_at', saved: true, @@ -75,7 +75,7 @@ export const insightHistoryLogic = kea>( __default: [] as InsightHistory[], loadTeamInsights: async () => { const response = await api.get( - 'api/dashboard_item/?' + + 'api/insight/?' + toParams({ order: '-created_at', saved: true, @@ -156,13 +156,13 @@ export const insightHistoryLogic = kea>( }), listeners: ({ actions, values }) => ({ createInsight: async ({ filters }) => { - await api.create('api/dashboard_item', { + await api.create('api/insight', { filters, }) actions.loadInsights() }, saveInsight: async ({ insight: { id }, name }) => { - await api.update(`api/dashboard_item/${id}`, { + await api.update(`api/insight/${id}`, { name, saved: true, }) @@ -172,7 +172,7 @@ export const insightHistoryLogic = kea>( }, deleteInsight: ({ insight }) => { deleteWithUndo({ - endpoint: 'dashboard_item', + endpoint: 'insight', object: { name: insight.name, id: insight.id }, callback: () => actions.loadSavedInsights(), }) diff --git a/frontend/src/scenes/insights/InsightTabs/PathTab.tsx b/frontend/src/scenes/insights/InsightTabs/PathTab.tsx index 895d876c0c4ca..3692e02768cd2 100644 --- a/frontend/src/scenes/insights/InsightTabs/PathTab.tsx +++ b/frontend/src/scenes/insights/InsightTabs/PathTab.tsx @@ -22,10 +22,10 @@ export function PathTab(): JSX.Element { <>

Path Type