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

879 Commits

Author SHA1 Message Date
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
Tim Glaser
3f7e95d14a
Improved insights history (#2745)
* Deprecate dashboard item type and move to display

* Mypy rerors

* fix test

* fix

* Fix test

* Fix another test

* WIP save history refactor

* Remove determineInsightType

* Progress

* Get rid of RetentionTable display types

* Sync all together

* Fix update dashboard

* Improved saving

* More bugfixes

* Fix insight caching and filters

* Fix insights

* Fix tests

* Fix import

* Fix saving issues

* Don't duplicate

* fix

* Use session instead of session_type everywhere for consistency

* Remove prints

* Use get_filter

* Fix retention filters

* Fix UI issues

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-12-16 16:37:55 +01:00
Michael Matloka
259e801de6
Whitelist plugins per organization on Cloud (#2791)
* Fix unix-dgram build

* Add per-organization whitelisting of plugins API on Cloud

* Add migration

* Update can_install_plugins_via_api calls in serializer

* Remove unused type: ignore

* Update PluginSerializer for organization_id

* Make Plugin.organization nullable

* Fix can_install_plugins_via_api

* Update pluginsLogic.ts

* Adjust can_configure_plugins_via_api for organization

* Don't include organization_id in serializer

* Set default Plugin.organization to first Organization in instance

* Fix PluginConfigSerializer.create

* Test that other orgs' plugins can't be accessed (as if they didn't exist, 404)

* fix typo

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2020-12-16 14:54:30 +01:00
Karl-Aksel Puulmann
05f66f99a1
Create a bookmarklet for demoing posthog (#2774)
* add bookmarklet instructions to setup

* minor change

Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
2020-12-16 10:34:23 -03:00
Paolo D'Amico
cc58fcace2
disable event property filtering (#2784) 2020-12-16 12:01:53 +02:00
Eric Duong
17253de766
fix pie aggregate value (#2781) 2020-12-15 17:11:22 -05:00
Eric Duong
826182b8d2
Fix total aggregate values (#2723)
* postgres working

* change result attr name

* adhoc solution for clickhouse query

* add breakdown filter test

* adhoc breakdown solution

* add breakdown default

* fix frontend logic

* breakdown refactoring

* reshape breakdown functions

* remove print

* remove dump.rdb

* replace magic string with constant
2020-12-15 18:37:25 +01:00
Paolo D'Amico
3b6a08da82
Not-so-big play button (#2744)
Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2020-12-15 11:02:08 -06:00
Paolo D'Amico
6d69b029e0
Navigation 1775 improvements & fixes (#2763)
* add backTo in new navigation

* fix #2541

* add billing & licenses link

* add annotations
2020-12-15 16:48:14 +02:00
Yakko Majuri
bf506e3d0b
Hide bar from retention (#2770) 2020-12-15 10:15:56 -03:00
Yakko Majuri
d9f9545b18
Fix Identified persons pagination (#2756) 2020-12-14 15:48:02 -06:00
Marius Andra
f3e4cad700
Plugin editor (#2743)
* fix tsc error

* add plugin source, create plugin source version model, add plugin_type

* can create and save source plugins via the api

* make empty source plugins

* message if no config options available

* different image or tag for source plugins

* fix some types

* second drawer

* add fields into drawer

* add monaco editor

* refactor drawer

* save plugin and must be json

* close tab on save

* fix default code

* upgrade to plugin server 0.5.0 - with scheduled plugins

* less height

* upgrade to plugin server 0.5.1 - with posthog.capture

* remove minimap from editor

* upgrade to 0.5.1

* use enum

* reduce quirk

* must enter a name/url

* use the source

* simpler text

* sync image

* add link to docs

* add a link to the documentation inside the source code drawer

* text / ux simplifications

* nicer first plugin experience

* nicer django model choices
2020-12-14 17:11:29 +01:00