mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-21 13:39:22 +01:00
Show event properties UI when joined to events table
This commit is contained in:
parent
e2f4caf218
commit
799cd988f3
@ -381,6 +381,29 @@ export function ActionFilterRow({
|
||||
].filter(Boolean)
|
||||
: []
|
||||
|
||||
const eventsTableLazyJoinName =
|
||||
filter.type === TaxonomicFilterGroupType.DataWarehouse &&
|
||||
filter.name &&
|
||||
Object.values(dataWarehouseTablesMap[filter.name]?.fields || {}).find(
|
||||
(field) => field.type === 'lazy_table' && field.table === 'events'
|
||||
)?.name
|
||||
|
||||
const localTaxonomicGroupTypes =
|
||||
filter.type == TaxonomicFilterGroupType.DataWarehouse
|
||||
? [
|
||||
TaxonomicFilterGroupType.DataWarehouseProperties,
|
||||
eventsTableLazyJoinName ? TaxonomicFilterGroupType.EventProperties : undefined,
|
||||
TaxonomicFilterGroupType.HogQLExpression,
|
||||
]
|
||||
: propertiesTaxonomicGroupTypes
|
||||
|
||||
const schemaColumns =
|
||||
filter.type == TaxonomicFilterGroupType.DataWarehouse && filter.name
|
||||
? Object.values(dataWarehouseTablesMap[filter.name]?.fields ?? []).filter(
|
||||
(field) => field.name !== eventsTableLazyJoinName
|
||||
)
|
||||
: []
|
||||
|
||||
return (
|
||||
<li
|
||||
className="ActionFilterRow relative"
|
||||
@ -438,14 +461,7 @@ export function ActionFilterRow({
|
||||
TaxonomicFilterGroupType.PersonProperties,
|
||||
TaxonomicFilterGroupType.DataWarehousePersonProperties,
|
||||
]}
|
||||
schemaColumns={
|
||||
filter.type == TaxonomicFilterGroupType.DataWarehouse &&
|
||||
filter.name
|
||||
? Object.values(
|
||||
dataWarehouseTablesMap[filter.name]?.fields ?? []
|
||||
)
|
||||
: []
|
||||
}
|
||||
schemaColumns={schemaColumns}
|
||||
value={mathProperty}
|
||||
onChange={(currentValue, groupType) =>
|
||||
onMathPropertySelect(index, currentValue, groupType)
|
||||
@ -605,14 +621,7 @@ export function ActionFilterRow({
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
taxonomicGroupTypes={
|
||||
filter.type == TaxonomicFilterGroupType.DataWarehouse
|
||||
? [
|
||||
TaxonomicFilterGroupType.DataWarehouseProperties,
|
||||
TaxonomicFilterGroupType.HogQLExpression,
|
||||
]
|
||||
: propertiesTaxonomicGroupTypes
|
||||
}
|
||||
taxonomicGroupTypes={localTaxonomicGroupTypes}
|
||||
eventNames={
|
||||
filter.type === TaxonomicFilterGroupType.Events && filter.id
|
||||
? [String(filter.id)]
|
||||
@ -620,11 +629,7 @@ export function ActionFilterRow({
|
||||
? getEventNamesForAction(parseInt(String(filter.id)), actions)
|
||||
: []
|
||||
}
|
||||
schemaColumns={
|
||||
filter.type == TaxonomicFilterGroupType.DataWarehouse && filter.name
|
||||
? Object.values(dataWarehouseTablesMap[filter.name]?.fields ?? [])
|
||||
: []
|
||||
}
|
||||
schemaColumns={schemaColumns}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user