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

890 Commits

Author SHA1 Message Date
Karl-Aksel Puulmann
9354b7ce64
Highlight filtered events in events table and in session recording (#2954)
* Highlight rows from sessions which are matched by the filter

* Send start_time of recording to frontend

This helps us calculate offsets a bit better

* Use timestamp by server for date shown

* Load session events via kea logic

* Update rrweb, rrweb-player

* Highlight events user is filtering for in sessions player

* Handle empty case properly

* Add positive test

* Order session recording events in query

* Fix filtering by multiple events with differing names

previously only the first would have been used due to overlapping
params.

* Return all highlighted times as action_filter_times

* Send back ids not timestamps

This avoids weird rounding errors causing issues

* Show skeleton for longer

* update typing

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-19 21:16:42 -06:00
Karl-Aksel Puulmann
c245af6a3e
Filters design followups (#2993)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-19 20:58:21 -06:00
Eric Duong
0a68184cc4
Use utc moment for retention dates and fix modal title (#2998) 2021-01-19 20:54:15 -06:00
Marius Andra
2dc132e388
Plugins Design Refresh (#2939)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-19 18:16:18 -06:00
Karl-Aksel Puulmann
a612a6b6bd
Sessions filters design (#2987) 2021-01-19 08:20:21 -06:00
Yakko Majuri
f39877f869
Add Community tag to plugins (#2982) 2021-01-19 11:11:41 +01:00
Paolo D'Amico
6daaae8cfd
add and indicator to feat flags (#2959) 2021-01-19 11:08:37 +02:00
Eric Duong
7bc28ca282
Fix prop operator not changing (#2981)
* always allow operator to be changed

* use diff solution
2021-01-18 16:28:48 -05:00
Tim Glaser
e6b7ac88ca
Fix options not loaded (#2973) 2021-01-18 15:29:21 +01:00
Paolo D'Amico
c2d38947b3
fix text_muted var (#2969) 2021-01-18 07:53:20 -06:00
Marius Andra
e3256e3ef0
Add link to plugin troubleshooting if server offline (#2936)
* add link to plugin troubleshooting

* Link directly to "Plugin server is offline"

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-18 13:55:03 +01:00
Marius Andra
0a990ff0e3
Lessen the language in the plugin opt-in warning (#2968)
* lessen the language in the plugin optin warning

* Reword slightly for approachability

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-18 13:51:29 +01:00
Calvin
7b74845cb7
Fixes #2942: Order tooltip by volume (#2960) 2021-01-16 10:06:29 +01:00
Karl-Aksel Puulmann
7103c37a7b
Trends: small fixes (#2956) 2021-01-15 08:53:36 -06:00
Karl-Aksel Puulmann
62dedd9610
Capture rageclicks for posthog (#2957)
Let's see if/how it works, this way we can shout this out next release.
2021-01-15 15:49:49 +01:00
Tim Glaser
1a6207d791
Upload static cohort csv (#2932)
* Upload static cohort using CSV, closes #2868

* fix tests

* Fix tests

* Fix e2e test

* Avoid double inserts

* Speed up query

* Move to params

* fix tests

* Use JSON instead of protobuf

* unused import

* produce instead of produce_proto

* Insert directly into clickhouse, no need for kafka

* a few quick fixes

* insert in batch to clickhouse

* test SQLi since we can't really trust what we are inserting

* Extra check for duplicates

Co-authored-by: James Greenhill <fuziontech@gmail.com>
2021-01-15 11:19:31 +01:00
Karl-Aksel Puulmann
17a31f0b43
Speed up sessions list query (#2934)
* Remove (apparently) useless person joins from sessions sql

* WIP: Make sessions list query use python iteration

* WIP: Show loader while session data is loading

* Aggregate together sessions

* Calculate start and end points of session separately

* Remove cruft code

* Load session events asynchronously for self-hosted

Note clickhouse behavior is unchanged.

* Update pagination logic for sessions

In addition to offset, postgres now returns a dict containing person_id,
timestamp which is used to make sure we filter events on different pages
correctly

* Add some tests to SessionListBuilder

* Fix typing errors

* Fix pagination limit

* Move tests to right file

* Query less events for sessions list

Since we're ordering by end_time we know events before last end_time are
all processed.

* Add test for current_url behavior

* Make sure old tests remain working

* Remove unused base class

* Move sessions-related queries to separate subfolder

* Extract sessions list code to separate file(s)

* Sort sessions by end time in ch as well

* List end time in sessions table

* Return person email when querying sessions lists on postgres

This gets used by the view

* Return email over all user properties for sessions in clickhouse and view

* Fix an ordering bug

* Fix a pagination bug

* Fix endpoint

* Fix basic sessions tests for pagination

* Sort consistently for sessions list builder

* Roll pagination into filters
2021-01-15 01:53:28 +02:00
Paolo D'Amico
39270b3249
Insights data instrumentation (#2787) 2021-01-14 10:59:20 -06:00
Eric Duong
e0980027eb
make flag explicit (#2947) 2021-01-14 09:53:08 -06:00
Paolo D'Amico
d91cc21217
More key feature instrumentation (#2811) 2021-01-14 07:36:44 -06:00
Paolo D'Amico
6c31678016
Add pinned dashboards to new navigation (#2906)
Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-13 09:18:31 -06:00
Eric Duong
ca54574374
remove unnecessary action properties iterating (#2926) 2021-01-13 15:13:19 +01:00
Eric Duong
953509b849
change datepickers to rangepicker (#2922) 2021-01-13 14:41:51 +01:00
Karl-Aksel Puulmann
19c50a2bfe
Sessions filtering system (#2912)
* Refactor adding filtering component

* Fix a type error

* Rename events to entries

This makes much more sense since you can select e.g. actions

* Start of the session filter box

* WIP: Sessions filtering

* Make SelectBox more generic

* Make sessions filtering visuals

* Extract operator value selection code

* Make action properties filterable

* Make it possible to filter by cohorts

* Filtering by events

* Make loading sessions possible with the new logic

* Make it possible to filter by actions/events via backend with new code

Note that it's all relying on old 'paths' - will refactor these later.

* Make it possible to filter by user properties

* Update imports

* Small fixes for sessions filter

* Add UserFilter file

* Ignore extra args to Property

* Make it possile to filter by recording duration

* Update how session duration filter works in the backend

* Rename a few columns

* Remove dead mixins

* Remove duplicated logic, put code behind feature flag

* Move sessions filters logic to subfolder

* Don't show properties if feature flag.

* Add saved filters support

This will require some discussion with Paolo - probably want to show
this on the side?

* Add divider before sessions table

* Narrower typing for recordings

* Some frontend for saving filters

* Small rename

* Add SessionsFilter model

* Save filter on backend

* add missing filter

* Extract const

* Make ActionFilterDropdown be able to pick actions again.

* Fix links from person modal to sessions

* Update tests.

* Fix database model

* Use proper deep equal for detecting active filter

* Remove unneeded field

* Only return filters from correct page

* Add missing data-attr

* Add instrumentation

* rename component

* Fix analytics metadata
2021-01-13 14:55:06 +02:00
Michael Matloka
598aea06b9
Make Jest tests work better with TypeScript (#2558)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-12 17:46:59 -06:00
Eric Duong
c3f248513f
Switch user prompt location (#2924)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-12 16:00:31 -06:00
Eric Duong
650bc428d3
Remove shownas filter and move stickiness/lifecycle into separate insight tabs (#2899)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-12 12:12:42 -06:00
Marius Andra
db7b3fef96
fix clearRetention (#2919) 2021-01-12 16:53:14 +01:00
Eric Duong
ed324fd793
add bordercolor var to missing change (#2921) 2021-01-12 16:23:56 +01:00
Marius Andra
1031329986
Fix dashboard colors with non-white backgrounds (#2911)
* fix local variable bug

* add "no-shadow" rule as a warning

* fix two blue lines on line graphs
2021-01-12 12:43:54 +01:00
Eric Duong
70a6ecb407
Separate math aggregates (#2885)
* separate math aggregates

* add data attr back

* adjust cypress

* make sure tooltip is viewable

* Show total by default

Co-authored-by: Tim Glaser <tim@glsr.nl>
2021-01-11 14:28:29 +01:00
Paolo D'Amico
5f726ee485
Hotfix - Papercups chat collision (#2908)
* use distinct ID in Papercups to avoid collision

* Add user_id to Papercups customer metadata

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-11 02:02:01 +01:00
Eric Duong
11a7388477
fix missing action when returning from dashboard (#2884) 2021-01-08 16:29:26 +01:00
Eric Duong
95c9a4ee1c
fix dataindex (#2883) 2021-01-08 16:00:53 +01:00
Eric Duong
3b32961254
fix var name (#2882) 2021-01-08 16:00:37 +01:00
Marius Andra
663d853a07
Make funnel steps sortable (#2862)
* Make funnel steps sortable

* sortableElement eats the `index` prop, must pass separately

* properly sort all types of filters

* Lock dragging to Y axis

* Sorting UI improvements (#2888)

* use icon for drag handle

* allow sorting only when there's at least two steps

* add instrumentation

Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-01-08 09:35:12 +01:00
Paolo D'Amico
f9a35e2dbf
Instrument toolbar (#2859)
* elements instrumentation, stats & heatmaps

* add events for action & inspect mode

* more events

* fix capture on setExtensionPercentage

* update posthog imports

* add heatmap and action counts

* update heatmap and action counts

* fix few type errors

* track down all data-* attributes when selecting an HTML element in the toolbar

* exchange extensionPercentage for toolbar loaded

* rename event (lost in some rebase)

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-01-07 12:55:25 +01:00
Eric Duong
476da265d2
Clickhouse caching (#2855)
* split params into mixins

* add typing

* split func

* dedicated paths filter

* make basefilter

* restructure directories

* move prop mixin

* implement cached_property and fix circular import

* remove unused imports

* stickiness filter converted

* temp patch for breakdown

* correct naming for derived mixins in paths

* fix types

* fix types

* fix casing

* fix breakdown arg

* merge master

* add to_dict

* DRY to_dict

* scoped to_dict ability

* fix types

* add missing fields

* refactor session filter

* remove unused imports

* remove unused imports

* add stickiness filter test

* fix dict for pathfilter

* properly load strs

* add default

* standardize loading

* retention filter separate

* add update filter to retention

* change back decorator

* don't allow setting on filter date_from date_to

* remove seconds on default timestamp

* remove derived values

* fix date formatting

* fix typo

* ch caching endpoints

* add cache funnel and remove ee flag for check cache items

* reorg update cache

* postgres refresh working

* change test so it doesn't hit cache

* minor adjustments

* add cache type testing

* run again

* remove unnecessary imports

* add back ee check for celery tasK

* fix setallfilters

* fix path dashboarditem calling

* fix path func names
2021-01-06 22:37:43 +01:00
Tim Glaser
027708c345
Fix retention entity selection (#2825)
* Fix retention entity selection

* Fix tests

* Remove

* Retnetion

* Fix loading retention on dashboard

* fix graph result interval type

* add comment

* fix period check

* fix type

Co-authored-by: Eric <eeoneric@gmail.com>
2021-01-06 17:09:33 +01:00
Eric Duong
8402bc39db
missing path viz conditoin (#2858) 2021-01-06 09:27:08 -05:00
Karl-Aksel Puulmann
11845b2111
Improve action select box - fix css (#2865)
* Remove outline from SelectBox

This vaused some small visual issues

* Stop select box from jumping due to varying width
2021-01-06 13:57:50 +02:00
Karl-Aksel Puulmann
20ecf64318
Make filtering by actions/events in sessions possible (#2808)
* Solve render warning on insights

* Fix a type error in SelectBox

* Solve some other typescript errors with SelectBox

* Make ActionFilterDropdown not depend on passed logics, add typing

* Fix retention, move open conditional into component

* Simplify onClose logics, solve tpescript errors

* Rename value to id for actions

This way we can avoid some remapping

* Fix fragment warning:wq

* Make it possible to filter by actions in the UI

* add close button

* Allow setting property filters for events

* Readd logic as prop

* Only show action filters on cloud
2021-01-06 13:15:22 +02:00
Karl-Aksel Puulmann
bcffd30092
Allow going from insights -> sessions (on cloud) (#2790)
* extract code to format entity filter

* make it possible to filter by action

* Hack to make filtering by actions subfilters possible

Example url:
http://localhost:8000/api/event/sessions?date_from=2020-12-10&date_to=2020-12-10&action_filter={%22type%22:%22events%22,%22id%22:%22test-event%22,%22properties%22:[{%22key%22:%22email%22,%22value%22:%22example.com%22,%22operator%22:%22icontains%22,%22type%22:%22person%22}]}

Not sure if the team filtering is legit here

* Use discriminated union in types

* Add kludge support for action_filter on sessions via url

* Reduce code in buildURL

* Add link to sessions page from persons modal

* Add muted overview of the invisible filter

* Add link to cohort sessions from persons page

* drop irrelevant test code

* Test clickhouse filtering by action filter

* put filter behind a cloud-only conditional

* remove dead import

* Add icons/data-attr to sessions links

* Appease linter gods
2021-01-06 12:59:52 +02:00
Marius Andra
71b022b8cb
fix bug from query-selector-shadow-dom update (#2856) 2021-01-05 19:48:27 +01:00
Karl-Aksel Puulmann
157003e2ab
Tests, fix for createActionFromEvent, clean up sessions query (#2851)
* Remove a dead TODO

This was solved in PR  #1849

* Make sessions query more readable

* Remove dead code from sessions

* Make it possible to test with imports in jest

* Fix a bug and add tests to createActionFromEvent

I added tests when initially solving #2848, but the original solution
had to be scrapped. The tests are still valid though
2021-01-05 17:11:24 +02:00
Marius Andra
22ef7cec6f
Custom NPM packages under @posthog (#2854)
* move some packages out of the @mariusandra/ npm namespace

* Fix yarn.lock

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-05 14:42:19 +01:00
Eric Duong
4ece4ce3e8
Major filter refactor (#2736)
* split params into mixins

* add typing

* split func

* dedicated paths filter

* make basefilter

* restructure directories

* move prop mixin

* implement cached_property and fix circular import

* remove unused imports

* stickiness filter converted

* temp patch for breakdown

* correct naming for derived mixins in paths

* fix types

* fix types

* fix casing

* fix breakdown arg

* merge master

* add to_dict

* DRY to_dict

* scoped to_dict ability

* fix types

* add missing fields

* refactor session filter

* remove unused imports

* remove unused imports

* add stickiness filter test

* fix dict for pathfilter

* properly load strs

* add default

* standardize loading

* retention filter separate

* add update filter to retention

* change back decorator

* don't allow setting on filter date_from date_to

* remove seconds on default timestamp

* remove derived values

* fix date formatting

* fix typo
2021-01-05 12:15:24 +01:00
Michael Matloka
b579a67fee
Clean up bookmarklet (#2812) 2021-01-04 14:27:42 +01:00
Michael Matloka
e284a29757
Refactor useEventListener to TypeScript (#2841) 2021-01-04 14:26:37 +01:00
Paolo D'Amico
febaed2340
Feature flag Papercups (#2799)
* feature flag papercups

* Use @papercups-io/chat-widget instead of weird useEffect hacks

* Rename basicComponents to essentialElements

* Add posthog_domain to Papercups metadata

* Actually rename basicComponents to essentialElements

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-12-16 21:42:32 +01:00