Skip to content

Commit

Permalink
feat(data-exploration): convert funnel properties correlation table (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Apr 6, 2023
1 parent cb7bde6 commit eb9f5b7
Show file tree
Hide file tree
Showing 12 changed files with 575 additions and 732 deletions.
4 changes: 2 additions & 2 deletions frontend/src/scenes/funnels/funnelCorrelationFeedbackLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'

import type { funnelCorrelationFeedbackLogicType } from './funnelCorrelationFeedbackLogicType'
import { funnelLogic } from './funnelLogic'
import { InsightLogicProps } from '~/types'
import { funnelCorrelationLogic } from './funnelCorrelationLogic'
import { funnelPropertyCorrelationLogic } from './funnelPropertyCorrelationLogic'

export const funnelCorrelationFeedbackLogic = kea<funnelCorrelationFeedbackLogicType>([
props({} as InsightLogicProps),
Expand All @@ -17,7 +17,7 @@ export const funnelCorrelationFeedbackLogic = kea<funnelCorrelationFeedbackLogic
actions: [
funnelCorrelationLogic(props),
['loadEventCorrelations'],
funnelLogic(props),
funnelPropertyCorrelationLogic(props),
['loadPropertyCorrelations'],
],
})),
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/scenes/funnels/funnelCorrelationLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const funnelCorrelationLogic = kea<funnelCorrelationLogicType>([
},
}),
selectors({
// apiParams for data exploration and legacy mode
apiParams: [
(s) => [s.isUsingDataExploration, s.dataExplorationApiParams, s.legacyApiParams],
(isUsingDataExploration, dataExplorationApiParams, legacyApiParams) => {
Expand All @@ -162,6 +163,15 @@ export const funnelCorrelationLogic = kea<funnelCorrelationLogicType>([
return cleanedParams
},
],
// aggregationGroupTypeIndex for data exploration and legacy mode
aggregationGroupTypeIndex: [
(s) => [s.isUsingDataExploration, s.querySource, s.filters],
(isUsingDataExploration, querySource, filters) => {
return isUsingDataExploration
? querySource?.aggregation_group_type_index
: filters?.aggregation_group_type_index
},
],

// event correlation
correlationValues: [
Expand Down
26 changes: 14 additions & 12 deletions frontend/src/scenes/funnels/funnelCorrelationUsageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { parseEventAndProperty } from './funnelUtils'
import { funnelLogic } from './funnelLogic'
import { funnelDataLogic } from './funnelDataLogic'
import { funnelCorrelationLogic } from './funnelCorrelationLogic'
import { funnelPropertyCorrelationLogic } from './funnelPropertyCorrelationLogic'

export const funnelCorrelationUsageLogic = kea<funnelCorrelationUsageLogicType>([
props({} as InsightLogicProps),
Expand All @@ -21,30 +22,31 @@ export const funnelCorrelationUsageLogic = kea<funnelCorrelationUsageLogicType>(
connect((props: InsightLogicProps) => ({
logic: [eventUsageLogic],

values: [insightLogic(props), ['filters', 'isInDashboardContext'], funnelLogic(props), ['allProperties']],
values: [
insightLogic(props),
['filters', 'isInDashboardContext'],
funnelPropertyCorrelationLogic(props),
['allProperties'],
],

actions: [
insightLogic(props),
['loadResultsSuccess'],
insightDataLogic(props),
['loadDataSuccess'],
funnelLogic(props),
[
'hideSkewWarning as legacyHideSkewWarning',
'setPropertyCorrelationTypes',
'excludePropertyFromProject',
'setPropertyNames',
'openCorrelationPersonsModal',
],
['hideSkewWarning as legacyHideSkewWarning', 'openCorrelationPersonsModal'],
funnelDataLogic(props),
['hideSkewWarning'],
funnelCorrelationLogic(props),
[
'setCorrelationTypes',
'excludeEventFromProject',
'loadEventWithPropertyCorrelations',
'excludeEventPropertyFromProject',
],
funnelDataLogic(props),
['hideSkewWarning'],
insightDataLogic(props),
['loadDataSuccess'],
funnelPropertyCorrelationLogic(props),
['setPropertyCorrelationTypes', 'excludePropertyFromProject', 'setPropertyNames'],
eventUsageLogic,
['reportCorrelationViewed', 'reportCorrelationInteraction'],
],
Expand Down
Loading

0 comments on commit eb9f5b7

Please sign in to comment.