Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ import { dataWarehouseJoinsLogic } from 'scenes/data-warehouse/external/dataWare
import { dataWarehouseSettingsSceneLogic } from 'scenes/data-warehouse/settings/dataWarehouseSettingsSceneLogic'
import { experimentsLogic } from 'scenes/experiments/experimentsLogic'
import { COHORT_BEHAVIORAL_LIMITATIONS_URL } from 'scenes/feature-flags/constants'
import { getInternalEventFilterOptions } from 'scenes/hog-functions/filters/HogFunctionFiltersInternal'
import {
getInternalEventFilterOptions,
getInternalEventPropertyFilterOptions,
} from 'scenes/hog-functions/filters/HogFunctionFiltersInternal'
import { MaxContextTaxonomicFilterOption } from 'scenes/max/maxTypes'
import { NotebookType } from 'scenes/notebooks/types'
import { groupDisplayId } from 'scenes/persons/GroupActorDisplay'
Expand Down Expand Up @@ -285,7 +288,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
type: TaxonomicFilterGroupType.InternalEvents,
options: [
{ name: 'All internal events', value: null },
...getInternalEventFilterOptions('standard').map((item) => ({
...getInternalEventFilterOptions('activity-log').map((item) => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Verify 'standard' context isn't used elsewhere for internal events, or if this change should apply globally to all standard contexts.

Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx
Line: 291:291

Comment:
**style:** Verify `'standard'` context isn't used elsewhere for internal events, or if this change should apply globally to all standard contexts.

How can I resolve this? If you propose a fix, please make it concise.

name: item.label,
value: item.value,
})),
Expand Down Expand Up @@ -397,6 +400,18 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
propertyAllowList?.[TaxonomicFilterGroupType.EventProperties]?.filter(isString),
...propertyTaxonomicGroupProps(),
},
{
name: 'Internal event properties',
searchPlaceholder: 'internal event properties',
type: TaxonomicFilterGroupType.InternalEventProperties,
options: getInternalEventPropertyFilterOptions('activity-log').map((value) => ({
name: value,
value,
group: TaxonomicFilterGroupType.EventProperties,
})),
getIcon: getPropertyDefinitionIcon,
getPopoverHeader: () => 'Internal event properties',
},
{
name: 'Event metadata',
searchPlaceholder: 'event metadata',
Expand Down Expand Up @@ -471,12 +486,11 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
searchPlaceholder: 'exceptions',
type: TaxonomicFilterGroupType.ErrorTrackingProperties,
options: [
...[
'$exception_types',
'$exception_values',
'$exception_sources',
'$exception_functions',
].map((value) => ({ name: value, value, group: TaxonomicFilterGroupType.EventProperties })),
...getInternalEventPropertyFilterOptions('error-tracking').map((value) => ({
name: value,
value,
group: TaxonomicFilterGroupType.EventProperties,
})),
...(currentTeam?.person_display_name_properties
? currentTeam.person_display_name_properties.map((property) => ({
name: property,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/TaxonomicFilter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export enum TaxonomicFilterGroupType {
Elements = 'elements',
Events = 'events',
InternalEvents = 'internal_events',
InternalEventProperties = 'internal_event_properties',
EventProperties = 'event_properties',
EventFeatureFlags = 'event_feature_flags',
EventMetadata = 'event_metadata',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ export const getInternalEventFilterOptions = (contextId: HogFunctionConfiguratio
}
}

export const getInternalEventPropertyFilterOptions = (contextId: HogFunctionConfigurationContextId): string[] => {
switch (contextId) {
case 'activity-log':
return [
'id',
'unread',
'organization_id',
'was_impersonated',
'is_system',
'activity',
'item_id',
'scope',
'detail.name',
'detail.changes',
'created_at',
]
case 'error-tracking':
return ['$exception_types', '$exception_values', '$exception_sources', '$exception_functions']
}

return []
}

const getSimpleFilterValue = (value?: CyclotronJobFiltersType): string | undefined => {
return value?.events?.[0]?.id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,23 @@ export type HogFlowFiltersProps = {
*/
export function HogFlowEventFilters({ filters, setFilters, typeKey, buttonCopy }: HogFlowFiltersProps): JSX.Element {
const shouldShowInternalEvents = useFeatureFlag('WORKFLOWS_INTERNAL_EVENT_FILTERS')

const actionsTaxonomicGroupTypes = [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions]
if (shouldShowInternalEvents) {
actionsTaxonomicGroupTypes.push(TaxonomicFilterGroupType.InternalEvents)
}

const propertyTaxonomicGroupTypes = [
TaxonomicFilterGroupType.EventProperties,
TaxonomicFilterGroupType.EventFeatureFlags,
TaxonomicFilterGroupType.Elements,
TaxonomicFilterGroupType.PersonProperties,
TaxonomicFilterGroupType.HogQLExpression,
]
if (shouldShowInternalEvents) {
propertyTaxonomicGroupTypes.push(TaxonomicFilterGroupType.InternalEventProperties)
}

return (
<ActionFilter
filters={filters ?? {}}
Expand All @@ -40,13 +52,7 @@ export function HogFlowEventFilters({ filters, setFilters, typeKey, buttonCopy }
hideDuplicate
showNestedArrow={false}
actionsTaxonomicGroupTypes={actionsTaxonomicGroupTypes}
propertiesTaxonomicGroupTypes={[
TaxonomicFilterGroupType.EventProperties,
TaxonomicFilterGroupType.EventFeatureFlags,
TaxonomicFilterGroupType.Elements,
TaxonomicFilterGroupType.PersonProperties,
TaxonomicFilterGroupType.HogQLExpression,
]}
propertiesTaxonomicGroupTypes={propertyTaxonomicGroupTypes}
propertyFiltersPopover
addFilterDefaultOptions={{
id: '$pageview',
Expand Down
Loading