Skip to content

Commit

Permalink
feat(events): show stale events in separate section
Browse files Browse the repository at this point in the history
Previously all events would ve listed in one list, irrespective of if
they have recent activity. This makes it difficult to find relevent
events if you have lots of stale events.

This change:

 * adds a group "Stale events" based on `volume_30_days` being falsy
 * filters the main "Events" group by `volume_30_days` being truthy

Closes PostHog#4791

References PostHog#4502

Note that this also references PostHog#4502 as it achieves the functionality of
highlighting which events have had recent activity.
  • Loading branch information
Harry Waye committed Jun 19, 2021
1 parent 2714447 commit 4d870d7
Showing 1 changed file with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,34 @@ export function ActionFilterDropdown({
)
},
dataSource:
eventDefinitions.map((definition) => ({
...definition,
key: EntityTypes.EVENTS + definition.id,
})) || [],
eventDefinitions
.filter((definition) => definition.volume_30_day)
.map((definition) => ({
...definition,
key: EntityTypes.EVENTS + definition.id,
})) || [],
renderInfo: EventInfo,
type: EntityTypes.EVENTS,
getValue: (item: SelectedItem) => item.name || '',
getLabel: (item: SelectedItem) => item.name || '',
},
{
key: 'stale-events',
name: 'Stale events',
header: function eventHeader(label: string) {
return (
<>
<ContainerOutlined /> {label}
</>
)
},
dataSource:
eventDefinitions
.filter((definition) => !definition.volume_30_day)
.map((definition) => ({
...definition,
key: EntityTypes.EVENTS + definition.id,
})) || [],
renderInfo: EventInfo,
type: EntityTypes.EVENTS,
getValue: (item: SelectedItem) => item.name || '',
Expand Down

0 comments on commit 4d870d7

Please sign in to comment.