0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 19:41:46 +01:00
Commit Graph

1034 Commits

Author SHA1 Message Date
Karl-Aksel Puulmann
b7bdad90eb
Add test for bar charts (#3474)
* Add test for bar charts

Since our charts are rendered on a canvas we can't really interact well
with it. Instead, we take a screenshot now (new dependency).

* Debug error in CI

* Make sure images are the same size on CI and locally
2021-02-26 16:50:36 +02:00
Karl-Aksel Puulmann
75f1332afc
Reload our feature flags after changing them (#3477)
This only "affects" our team and local development. I got tired of
needing to reload after toggling a feature flag locally. This makes it
so that the newly edited flag is applied immediately.
2021-02-25 16:28:52 -06:00
Tim Glaser
e5cfa68b60
Reduce calls to api/action (#3493)
* Reduce calls to api/action

* Fix saving
2021-02-25 22:48:53 +01:00
Eric Duong
195a358819
Change graphs to ts (#3181)
* change to TS

* fix type

* fix types

* add type to kea logic

* fix errors
2021-02-25 12:44:37 -05:00
Eric Duong
2d4daa6558
Revert "Revert "935 trend legend"" (#3489)
* Revert "Revert "935 trend legend (#3434)" (#3487)"

This reverts commit 5784f90df6.

* patch bug

* format breakdown label

* add ff
2021-02-25 12:06:06 -05:00
Eric Duong
5784f90df6
Revert "935 trend legend (#3434)" (#3487)
This reverts commit cd660e52f8.
2021-02-25 11:41:57 -05:00
Eric Duong
cd660e52f8
935 trend legend (#3434)
* base table legend

* toggle visibility logic

* colors working

* display data in legend

* clean up types and conditions

* review-points

* missing constant from merge

* Make the table small

* disabled when only 1 is left and add label clickable

* add better label handling

* fix test

Co-authored-by: Tim Glaser <tim@glsr.nl>
2021-02-25 10:59:35 -05:00
Karl-Aksel Puulmann
eb7b361401
Fix: funnels & retention person links, funnel calculations (#3483)
* Fix links to people from Retention modal and Funnels.

More details under issue https://github.com/PostHog/posthog/issues/3480

* Fix funnel calculations on self-hosted

Broken by renames within https://github.com/PostHog/posthog/pull/3301

* Handle cached calculations in e2e test runner

When executing e2e tests, celery tasks are evaluated immediately. Previously
due to the caching the funnels never loaded as we overwrite the results immediately.

* Add test for navigating to persons from funnels

* Test for retention visualization and person navigation
2021-02-25 17:41:25 +02:00
Karl-Aksel Puulmann
264d4b03db
Bar chart by value (#3457)
* Extract const for a frequent if-statement

* Show bar graph

* Show bar chart breaking down by value

* Don't show interval filter when non-time based visualization

* Set axis color as expected

* Add percentage of total to bar graph

* Include action info in tooltip for value graph

* Support DashboardItem

* Mark prop as optional

* Convert new file to typescript

* Disable bar value for stickiness
2021-02-25 17:01:05 +02:00
Karl-Aksel Puulmann
f36495bec6
Filters: Select multiple for equality/inequality (#3422)
* Don't colorize sql for output

* Handle setting array props as values

* Handle arrays exact/is_not property filters

Also updates tests to use parameterization

* Avoid autoclosing PropertyFilter popup

As key changes, old one got removed from DOM

* Improve filter UX

Don't allow filter to become multi-line and keep inputs the same size.

Previous flex={1} was doing flex: 1 1 auto which was messing things up

* Fix typescript issue

* Handle array lookups in postgres

* Update types

* Fix fixture to recreate tables

* Make replace spaces logic consistent with what was there before

* Handle list filtering better in postgres

* Update frontend tests

* Handle edge case: Switching between multi operator and single operators
2021-02-25 16:54:55 +02:00
Karl-Aksel Puulmann
bd9a44cdb3
Fix "unseen sessions" filter (#3478) 2021-02-25 16:26:42 +02:00
Michael Matloka
a50822b27f
Fix "passowrd" on invite page (#3473) 2021-02-25 12:26:52 +01:00
Marius Andra
84d853748d
Earlier IP anonymization (#3464)
* Clarify what anonymize_ips does

* Hide IP before event ingestion, not during (hides it also from the task queues and plugins)

* flip it around

* add IPs to tests that expected them to be there

* "Discard"

* test that everything works when ip is none
2021-02-25 10:31:33 +01:00
Michael Matloka
55ffbb04a1
Fix invite signup being inaccessible for users without org or project (#3466) 2021-02-25 10:14:10 +01:00
Marius Andra
325a8d653e
Alert if plugin server down (#3465)
* Alert if plugin server down

* Strip plugin server version of quotes

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-02-25 01:57:49 +01:00
Michael Matloka
4a08abf789
Bulk invite the Polish (#3346)
* Refactor bulk invites to use OrganizationInviteViewSet

* Refactor BulkInviteModal

* Flyby utils fix

* Make invitation button nicer

* Fix dropdown Invite button

* Fix invites/bulk response status

* Update test_organization_invites.py

* Fix Formula typing

* Fix test_invites_are_create_atomically

* Fix typing

* Update comment

* The to each

* Address feedback and introduce optimizations

* Fix tests

* Polish

* use single invite on user dropdown if email is not available

* Add unit tests for pluralize

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-02-24 23:41:08 +01:00
Eric Duong
9514e290a2
Static cohort on person modal (#2952)
* 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

* initial cleanup

* initial scaffold for cohort static logic

* intiial frontend changes

* initial working

* fix error on iterable

* stickiness people func refactor

* Use JSON instead of protobuf

* stickiness working

* clickhouse route

* unused import

* move button

* make interface easier to user

* clickhouse support

* restore cache decorator

* endpoint adjustment

* adjust how clickhouse handles inserting for static cohorts

* split out processing into pg

* use worker for clickhouse querying too

* add pg test

* ee test

* add input for cohort naming

* add stickiness test

* condition for when to show save cohort

* fix types

* minor fix

* remove repeats

* remove hardcoded id

* add date handling to trends cohort func

* remove print

* add link on success creation

* cohort working

* fix backend test

* fix cohort typescript

* remove unnecessary kafka topic

* remove brackets

* shift default

* raise exceptions when debug or test is true

* remove test flag

* move trends insight related components to different folder

* change get_earliest_timestamp

* remove extraneous condition

* fix test call

* put behind ff

* fix test x2

* fix tests

* restore exceptions hog

* fix tests

* restore exceptions hog

* fix test x20

Co-authored-by: Tim Glaser <tim@glsr.nl>
2021-02-24 09:59:13 -05:00
Eric Duong
23a7c9e2df
Fix clicking datapoint with multiple entities (#3428)
* remove unnecessary condition

* change all refs

* fix switched params

* remove targeet entity from filter
2021-02-23 11:03:14 -05:00
Karl-Aksel Puulmann
f4039003e1
Dashboards: allow changing date filters & refresh (#3363)
* DashboardHeader to ts

* Convert files to typescript

* Use BindLogic instead of passing logics as arguments

* Improve typing for dashboards

* Fix DashboardHeader types

* Improve typing: DashboardItem

* Fix InsightHistoryPanel, SharedDashboard types

* Add WIP code for date ranges on dashboards

* DateFilter/dateFilterLogic to typescript

* Show 'Custom' daterange by default on a dashboard

* Border for dates in Dashboard

* Add dashboard.filters field

* Populate dashboard.filters, use it in code

* Fix some type errors in dashboardItemsModel

* Fetch dashboard items again on date change

* Make dashboard items refresh as dashboard gets updated

* Add refresh button to DashboardHeader

* Make saving dashboard items work again

* Update dashboard type

* Don't update URL in DateFilter

* Update selected time range on load

* Avoid flickering in DateFilter

* Only show 'Custom' in dashboards

* Show calendar icon next to date filter in dashboard

* Avoid double-loading results due to date change

* Kill some duplicated code

* Avoid cache when filters change

(datefilters on dashboard)

* Test individual update_cache method

* Add test for import_from and attributes being updated

* Fix typing errors

* Update api/dashboard tests

* Avoid redirects when changing date range for funnels or retention

Previously funnelLogic might be mounted in the background, causing a
reload

* Add a missing breakpoint

* Reformat with black
2021-02-23 12:19:36 +02:00
Paolo D'Amico
348b50f73f
Fix authenticated invite signup (#3433) 2021-02-22 14:55:02 -06:00
Yakko Majuri
28b548f72c
Rename DAU -> Active Users (#3420)
* Rename DAU -> Active Users

* update test
2021-02-22 12:48:45 +00:00
Michael Matloka
65e5878683
Stricter Team model (#3252)
* Remove deprecated Team.opt_out_capture

* Remove obsolete and unused Team.users

* Make Team.organization, api_token and name stricter

* Add migration

* Add Team.api_token min length

* Adjust 0124_stricter_team for opt_out_capture removal

* Don't remove Team fields

* Update migration

* Update migration

* Set org ID of orgless teams to first org instead of deleting

* Update migration

* Fix

* Ensure that each project has a name before migration

* Rename prepare_teams
2021-02-22 13:14:53 +01:00
Michael Matloka
52cc8b3124
Fix "Finish setup" button (#3416) 2021-02-22 09:11:37 +01:00
Paolo D'Amico
e35ef9df80
Migrate team invite signup to React - Part II (Front-end) (#3300)
Co-authored-by: Michael Matloka <dev@twixes.com>
2021-02-19 16:53:01 -06:00
Karl-Aksel Puulmann
e50980c06a
Improve reordering funnel steps (#3412)
You can now drag the whole "row" not just by the handle

distance now needs to be set not to interact badly with dropdown menus -
by default it would eat all the clicks.

Fixes #3410
2021-02-19 16:20:54 -05:00
Paolo D'Amico
b25a72d0cf
Support client-side compact number formatting & instrumentation (#3360) 2021-02-19 11:58:00 -06:00
Yakko Majuri
33c989721f
Add created by tag to individual dashboards (#3367)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-02-19 05:50:18 -06:00
Michael Matloka
cb3127ea3b
Fix tooltips over property type icons (#3404)
* Fix lack of rowKey on EventsTable

* Fix tooltips over property type icons
2021-02-19 13:41:30 +02:00
Tim Glaser
ed919918b3
Fix unselecting fields in action (#3352)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-02-18 17:09:56 -06:00
Paolo D'Amico
d7aa259d7e
Fix loading billing plans on self-hosted (#3389)
* only load plans on cloud

* move plans endpoints to /api/plans
2021-02-18 19:39:02 +01:00
Eric Duong
f1de2e9002
add properties to filter cleaner for retention logic (#3359) 2021-02-17 19:43:23 +02:00
Yakko Majuri
98b7b85af4
Fix hidden plugin config field (#3364)
* Fix hidden plugin config field

* remove console.log
2021-02-17 15:20:15 +01:00
Yakko Majuri
8e3559a4c2
Update launch toolbar CTA for new nav (#3347) 2021-02-17 13:43:45 +00:00
Eric Duong
66641546d7
Trend component test (#3278)
* temp changes

* more tests

* initial trend tests

* merge master

* remove creepover

* remove stubs

* remove unnecessary check

* remove flaky test

* change fixture

* remove console

* focus tests

* update names

* make test more specific

* remove unecessary check

* fix insights file

* checkout insight file
2021-02-17 13:50:41 +02:00
Karl-Aksel Puulmann
3a6ffad2be
Fix/replace setTimeout in logics (#3337)
* Update kea to 2.3.2

* Clear timeout before unmount

https://sentry.io/organizations/posthog/issues/2212704003/?project=1899813&query=is%3Aunassigned+is%3Aunresolved&statsPeriod=14d

* Fix old kea ts compatibility issue
2021-02-16 12:44:23 +01:00
Michael Matloka
77b01bd9cb
Add Invite Team Member to top bar user dropdown (#3343)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-02-15 12:25:06 -06:00
Tim Glaser
5c8314ba09
Fix funnel people not showing (#3335)
* Fix funnel people not showing

* funnel viz
2021-02-15 09:50:13 +01:00
Tim Glaser
aa2295467a
Refreshing insights (#3301)
* Refreshing insights

* Fix dashboarditem

* put exceptionhog back

* Fix ts issues

* fix tests

* Fix tests

* Remove printers

* fix type errors

* fix test

* Fix flickering

* Fix issues switching between views

* Use result for backwards compatability

* Fix tests

* Refreshing insights part 2

* Get rid of last refresh

* Add breakpoint

* more breakpoints

* Remove loadFunnel function. TODO issue with refreshing funnel in dashboard

* fix refreshing issue

* fix trends loading

* Fix funnel loading
2021-02-12 16:39:49 +01:00
Tim Glaser
c536deacfa
fix more formula errors (#3326) 2021-02-12 15:31:36 +01:00
Yakko Majuri
cb979c5a2a
Remove Stats from Toolbar (#3040)
* Remove Stats from Toolbar

* wip remove logic

* move buttons down

* run prettier

* top: 15 -> 0
2021-02-12 13:36:22 +00:00
Karl-Aksel Puulmann
9402f753da
Move breakpoints around (#3313)
Solves issue from sentry:
https://sentry.io/organizations/posthog/issues/2212704003/events/eadd52c2f9f84356a1c5a2712c2b8342/?project=1899813
that popped up due to person navigating from trends before API result
came back.

(PS: Thanks marius for the new error messages!)
2021-02-12 11:13:08 +01:00
Karl-Aksel Puulmann
95630f7a6b
Return no data for invalid regexes (#3248)
* Return no data if invalid regular expression

This currently returns a 500. Fixes 3191 together with frontend
validation.

* Add browser validation

* Typing errors
2021-02-11 21:53:58 +02:00
Tim Glaser
45933d39b3
Formulas (#3275)
* Formulas

* Add frontend for formulas

* fix type issues

* fix tests

* fixxx

* fix typing

* Add better tests

* Add more tests and fix various options

* fix pie and ui updates

* fix types

* fix lifecycle and table issues

* Regression test for %B in urls
2021-02-11 20:20:01 +01:00
Karl-Aksel Puulmann
c6d00fc3ee
Allow viewing sessions/recordings on persons page (#3302)
* Add spec for being able to reach session recording to sessions page

* Add basic Person page component test

* Fix viewing session recorings on person page

I broke this in a recent PR by narrowing the URLs down too much to fix
another bug (logics clashing).

* Persons tests pass again
2021-02-11 21:14:28 +02:00
Yakko Majuri
5ad265ca18
Add selection option to plugin config (#3229)
* Add selection option to plugin config

* update naming

* bump scaffold version

* add check for choices

* bump plugin scaffold

* wip handle invalid choices

* handle invalid choices

* bump scaffold

* clean up
2021-02-11 12:25:15 +01:00
Marius Andra
fd57536aa0
Misc plugin improvements (#3288)
* redirect to "repository" tab if no plugins installed

* fix lone "." for empty descriptions

* sort repository alphabetically

* add WIP test to make sure plugins are separated by organisation

* org id can be str

* try to reset membership

* Add permission_classes to PluginSerializer

* don't show tabs if only one tab can be used

* sort installed plugins alphabetically

* don't check for updates if can't actually update

* hide some more information if can't install

* remove 'global' from plugin config

* deprecate unused 'error' field

* fix plugin permission_classes mishap

* fix test, 400 -> 403

* simplify test

* Simplify isinstance check

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-02-11 11:46:49 +01:00
Paolo D'Amico
465c87240f
Migrate team invite signup to React - Part I (Backend) (#2734)
* base API invite signup

* prevalidate invites

* allowed signed in users to claim an invite

* add more test cases

* remove legacy invite signup

* add trailing slash to endpoint

* post merge cleanup

* bring back signup_to_organization_view to be able to split the PR

* another cleanup

* bring back signup to organization template

* mask_email_address util

* fix typing

* fix tests

* fix analytics metadata

* OrganizationSocialSignupSerializer

* support social auth

* rename company_name to organization_name

* final tweaks

* add organization_name to prevalidate response
2021-02-11 11:46:42 +01:00
Tim Glaser
b9f3d3ec7c
Don't set is calculating for static cohorts (#3297)
* Don't set is calculating for static cohorts

* update frontend

* fix inconsistency

* Add migration and fix typing

* N/A

* typing

* types

* more! typing!
2021-02-11 11:07:12 +01:00
Eric Duong
399b6a544c
Revert "Revert "Revert "2794 retention people (#3108)" (#3264)" (#3271)" (#3295)
This reverts commit 9934b7905d.
2021-02-10 17:04:10 -05:00
Eric Duong
9934b7905d
Revert "Revert "2794 retention people (#3108)" (#3264)" (#3271)
This reverts commit 6b56abe876.
2021-02-10 16:45:53 -05:00