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

864 Commits

Author SHA1 Message Date
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
Paolo D'Amico
5baee2875d
New Person Page (V2) (#2738)
* person v2 stage I

* delete person

* merge persons

* person properties

* address feedback & cleanup

* updates isURL utility with tests

* edit text-based person properties inline

* allow changing bool & null props as well

* sort properties by type & alphabetically

* editing only on first-level of nesting

* remove properties
2020-12-14 14:27:28 +02:00
Karl-Aksel Puulmann
31433404f2
Proposal: When clicking 'add action/event', populate the generated event with last event data (#2635)
* Proposal: When clicking 'add action/event', populate the generated event with last event data

In my usecase I was analyzing $capture_failed_request with different
percentiles/math operators on the same properties. Doing this was
slightly painful, since I needed to enter the same data over and over
again.

After this change we'll populate the action/event with last row.
My hypothesis is this will speed things up generally.

* when adding rows to entity filters, keep visibility as well
2020-12-14 09:16:08 +02:00
Paolo D'Amico
00930e3e32
Insights link on event list (#2748)
Co-authored-by: samcaspus <sandeepguptan1998@gmail.com>
2020-12-13 13:09:22 -06:00
Yakko Majuri
0c916c571e
Revert "Add autocapture to selection properties" (#2746)
* Revert "add autocapture to selection properties (#2696)"

This reverts commit 64f2a57bd2.

* also fix #2613 correctly
2020-12-12 22:07:32 +01:00
Tim Glaser
560fe0765e
Deprecate dashboard item type and move to display (#2715)
* Deprecate dashboard item type and move to display

* Mypy rerors

* fix test

* fix

* Fix test

* Fix another test

* Remove determineInsightType

* Get rid of RetentionTable display types

* Fix update dashboard
2020-12-11 20:12:52 +01:00
Marius Andra
98fbd2c681
Spy on feature flags 🕵️ (#2643)
* featureFlagLogic spy

* add comment and simplify code
2020-12-11 17:45:59 +01:00
Tim Glaser
803efc3489
Make active feature flags more obvious (#2742)
* Make active feature flags more obvious

* Also fix ch

* Fix typing

* Update usage URL

* Fix CH
2020-12-11 12:27:45 -03:00
Karl-Aksel Puulmann
3f0f051758
Sessions filtering postgres support (#2728)
* Duplicate existing endpoints under /api/event/sessions

* Use different endpoint for sessions table logic in sessions page

* drop irrelevant code for insights endpoint

* update documentation

* extract method

* move code under only relevant path

* Extract clickhouse sessions logic

* Refactor: Separate session list logic from rest of sessions

* move sessions list to separate file

* Move sessions list tests to separate file

* add clickhouse session list tests

* add support for duration filtering on postgres

* move api tests to right place

* kill dead code
2020-12-11 11:01:14 +02:00
Paolo D'Amico
05344d1292
Fixes to Persons page 201210 (#2737)
* fix initial persons load

* fix icons
2020-12-11 10:58:21 +02:00
Karl-Aksel Puulmann
d73e808be4
Sessions filtering: improve UX (#2726)
* Handle empty duration input properly

* rename no option

* Add close button to the filter

* Allow choosing time unit in dropdown

* solve mypy errors

* minor changes

* show arrow

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-12-11 10:44:47 +02:00
Marius Andra
ad2d36d8cd
Capture plugin installation events (#2729)
* instrument plugins

* track plugin beta optin

* Improve style

* add plugin install type

* share type

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-12-11 00:20:21 +01:00
Paolo D'Amico
9f5e42b5bd
Fix persons page V2 handle person with no distinct IDs (#2731) 2020-12-10 09:30:30 -06:00
Tim Glaser
e7cf836d59
Merge person modal (#2644)
* WIP merge person

* Warning message

* Fix test

* fix

* Fix small issues
2020-12-10 15:37:30 +01:00
Eric Duong
952f6e5870
Add clickhouse query for people breakdown (#2669)
* add clickhouse query for people breakdown

* remove log

* add pg implementation

* remove caching and fix timestamp formatting

* modify how people are returned

* reimplement frontend logic for handling new people payload

* remove period check

* change params

* add returndict

* DRY retention param formatting

* remove feature flag for retention

* remove feature flag for retention
2020-12-10 14:51:24 +01:00
Karl-Aksel Puulmann
b03d4da7e0
Allow filtering sessions by recording duration (#2721)
* Use return value of add_session_recording_ids

The mutation here is incidental, this is symmetrical with how postgres
behaves.

* Implement sessions_filter

This will hold session-recording specific filters

* WIP: make filtering by session recording length possible on ch

* Kill dead method

* Allow filtering by session length

* Make logic a bit smoother around filtering by recording duration

* More common code for clickhouse_session_recording

* Add filtering tests for ch

* Resolve mypy issues

* Only run duration tests for ch

* Put new filters logic behind a feature flag

* Kill dead const

* Solve operators-related comment

* Review feedback: rename variable

* Fix test failures
2020-12-10 10:26:47 +02:00