0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00

Tally up counts of filters on events and actions (#4214)

* tally up counts of filters + actions

* update comment

Co-authored-by: kunal <kunal@Kunals-iMac.hsd1.ca.comcast.net>
This commit is contained in:
Kunal 2021-05-06 07:58:22 -07:00 committed by GitHub
parent 7c9c3a41cb
commit 5377600dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,6 +163,21 @@ export const eventUsageLogic = kea<
properties.total_event_actions_count = (properties.events_count || 0) + (properties.actions_count || 0)
let totalEventActionFilters = 0
filters.events?.forEach((event) => {
if (event.properties?.length) {
totalEventActionFilters += event.properties.length
}
})
filters.actions?.forEach((action) => {
if (action.properties?.length) {
totalEventActionFilters += action.properties.length
}
})
// The total # of filters applied on events and actions.
properties.total_event_action_filters_count = totalEventActionFilters
// Custom properties for each insight
if (insight === 'TRENDS') {
properties.breakdown_type = filters.breakdown_type