diff --git a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx index 15586e766a3..f4b5df34a83 100644 --- a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx +++ b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx @@ -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 (
  • 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} /> )}