0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
Commit Graph

579 Commits

Author SHA1 Message Date
Paolo D'Amico
cf2ec2894c
Signup improvements (#1535)
Co-authored-by: Yakko Majuri <yakko.majuri@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-07 09:23:13 -05:00
James Greenhill
c2e03a3a46
Revert this to bring back the working copy of ee / clickhouse (#1588) 2020-09-04 21:12:07 -07:00
James Greenhill
5506135c3c
Bring back clickhouse changes along with queue size metrics (#1579)
* Revert "Revert "Clickhouse setup (#1463)""

This reverts commit 7f2cab4b93.

* add queue backlog to _stats endpoint

* celery queue length into heartbeat -> statsd

* reformat

* type check fixes

* bump expected number of queries to 8

Co-authored-by: Eric <eeoneric@gmail.com>
2020-09-04 13:44:53 -07:00
Michael Matloka
d5652a5c78
Revert "Make note that Zapier integration is not public yet" (#1574)
* Revert "Make note that Zapier integration is not public yet (#1510)"

This reverts commit 59ec3a6325.

* Capitalize "PostHog Docs"
2020-09-04 13:59:55 +02:00
James Greenhill
7f2cab4b93 Revert "Clickhouse setup (#1463)"
This reverts commit a0327587cb.
Time to process events shot way up and logs are missing.
2020-09-03 19:27:02 -07:00
Eric Duong
a0327587cb
Clickhouse setup (#1463)
* initial

* migration command

* migrations working

* add modelless views for clickhouse

* initial testing structure

* use test factory

* scaffold for all tests

* add insight and person api

* add basic readme

* add client

* change how migrations are run

* add base tables

* ingesting events

* restore delay

* remove print

* updated testing flow

* changed sessions tests

* update tests

* reorganized sql

* parametrize strings

* element list query

* change to seralizer

* add values endpoint

* retrieve with filter

* pruned code to prepare for staged merge

* working ingestion again

* tests for ee

* undo unneeded tests right now

* fix linting

* more typing errors

* fix tests

* add clickhouse image to workflow

* move to right job

* remove django_clickhouse

* return database url

* run super

* remove keepdb

* reordered calls

* fix type

* fractional seconds

* fix type error

* add checks

* remove retention sql

* fix tests

* add property storage and tests

* merge master

* fix tests

* fix tests

* .

* remove keepdb

* format python files

* update CI env vars

* Override defaults and insecure tests

* Update how ClickHouse database gets evaluated

* remove bootstrapping clickhouse database routine

* Don't initialize the clickhouse connection unless we say it's primary

* .

* fixed id generation

* remove dump

* black settings

* empty client

* add param

* move docker-compose for ch to ee dir

* Add _public_ key to repo for verifying self signed cert on server

* update ee compose file for ee dir

* fix a few issues with tls in migrations

* update migrations to be flexible about storage profile and engine

* black settings

* add elements prop tables

Co-authored-by: James Greenhill <jams@uber.com>
2020-09-03 10:27:45 -07:00
Tim Glaser
58b6e43aff
Identify email in frontend (#1558) 2020-09-03 16:30:23 +02:00
Tim Glaser
9dbb5e2134
Revert "WIP: have the element info window follow the mouse (#1472)" (#1542)
This reverts commit b559fee904.
2020-09-01 17:24:23 +02:00
Michael Matloka
71ed4b00d0
Update dependencies (partially) (#1537)
* Update dependencies

* Format with prettier 2.1.1

* Roll back to TypeScript 3.9.x

kea-typegen 0.2.x isn't compatibile with typescript 4.0.x
2020-09-01 15:58:13 +02:00
Marius Andra
b559fee904
WIP: have the element info window follow the mouse (#1472) 2020-09-01 15:51:53 +02:00
Eric Duong
c20df2905f
Consolidate insight api (#1498)
* add insight history

* add table

* edit format

* links working

* add modal

* add tab switch

* saving insights

* remove insights model

* no model for insight history

* initial working

* remove wrong typegen

* made the history per user

* missing param

* added funnel support

* add details

* add delete saved insight functionality

* add line break logic and funnel name

* fix reload logic

* fix rendering error

* add pagination component

* fix bugs

* add backend tests

* add insight-history-panel check

* add drawer and replace table

* add loading next

* add date

* add callback

* update test

* use table

* fix spacing

* fix rows

* adjust spacing

* fix spacing and styling

* fix spacing and styling

* main funnel-insight page working

* consolidated funnels

* refactor funnel dashboard item

* dashboard modals working

* update demo creation

* updated migration

* fix frontend for funnels

* remove funnel code and fix bugs

* fix test and remove caching temp

* remove old tests

* fix types

* added panel for past funnels

* implement polling for funnel refactor

* .

* fix dashbaord item bug

* add params

* fix params

* clean up caching functionality

* fix types

* caching working properly

* fix dashboard update bug

* fix migrations

* .

* fix check

* add missing package

* update caching to work properly

* Fix default

* fix api and styling for insight history

* more spacing

* initial refactor paths to queries and consolidate into /insight

* missing param for paths

* move path tests

* change frontend endpoints

* add comments about specific parameters

* minor tune up

* fix name

* typed filter and paths

* typed retention

* more typing and standardization

* fix tests

* cleanup

* update funnel automatically

* update tests

* fix clear condition

* merge insight history

* return save functionality

* remove file

* fix path params and tests

* add tests

* fix type
2020-09-01 15:19:15 +02:00
Yakko Majuri
35e604e031
Changed tone on action creation buttons (#1531)
* changed tone on action creations buttons

* Update ActionStep.js

* Update style.scss

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-09-01 08:30:49 -03:00
Michael Matloka
22e220f7a3
Fix styling of URL list (#1526)
* Add string breaking to .ant-list-item

* Fix styling of EditAppUrls in particular
2020-08-29 09:56:33 -03:00
Yakko Majuri
76d629dcbc
Made 'Launch Toolbar' links open in a new tab (#1524)
* made open toolbar links open in a new tab

* Remove noreferrer to allow filtering out visits from PostHog

* Allow referrer

* Disable react/jsx-no-target-blank

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-08-27 14:34:11 +02:00
Michael Matloka
411648a371
Code snippets with proper syntax highlighting (#1490)
* Use react-syntax-highlighter in snippest + fix minor issues

* Use synthwave84

* Use vsc-dark-plus

* Use okaidia (PostHog/posthog.com#362)

* Use copyToClipboard from utils
2020-08-26 16:36:34 +02:00
Tim Glaser
b2a5301d90
Fix user paths on firefox (#1513) 2020-08-26 15:47:56 +02:00
Michael Matloka
59ec3a6325
Make note that Zapier integration is not public yet (#1510) 2020-08-26 11:02:09 +02:00
Michael Matloka
c040601f49
Personal API keys and Zapier integration (#1281)
* Add missing migration

* Add generate_random_token() model util

* Move PublicTokenAuthentication to utils

* Make use of generate_random_token

* Add User.personal_access_token field

* Add PersonalAccessTokenAuthentication

* Fix PublicTokenAuthentication

* Fix migration and auth import

* Add personal_access_token to user API

* Update Setup.js

* Support trailing slash in API

* Improve PAT auth quality

* Add django-rest-hooks requirement

* Update settings.py for rest_hooks

* Fix django-rest-hooks requirement

* Bring back API routes with no double trailing slash

* Rename posthog.api.team to team_user

* Add API TODO

* Ad PAT auth with X-PAT HTTP header

* Replace User.personal_access_token with PersonalAPIKey model

* Fix PersonalAPIKey max_lengths

* Describe posthog.models.utils.generate_random_token better

* Add personal_api_key to API

* Add authenticate_header to PersonalAPIKeyAuthentication

* Add hook API endpoint

* Use django.utils.timezone in place of datetime.datetime

* Add Personal API Keys to Setup

* Sort personal_api_keys in ORM

* Add Action.on_perform()

* Remove requirements.txt comment

* Add a

* Add REST hook tasks

* Optimize PersonalAPIKeyAuthentication query

* Add a trailing slash version of /e endpoint

* Add team field to PersonalAPIKey model

* Add personal API key support to capture endpoint, get_cached_from_token

* Reject personal API keys from inactive users

* Add extra_properties_json field to /capture

* Improve PAK auth header regex

* Use custom hook model

* Deliver hooks

* Handle action.on_perform

* Consolidate userLogic in userLogic.tsx

* Update PersonalAPIKeys.js

* Make PersonalAPIKey foreign keys read-only

* Update requirements/dev.txt

* Make PersonalAPIKeys TSX

* Fix conflict

* Fix migration

* Fix minor mishaps

* Update and fix tests

* Use CharField of random 32 bits as hook.id

* Fix conflicting migrations

* Fix ValidationError in HookSerializer.validate_event

* Use query param in /api/event/actions ID filtering

* Rename endpoint `hook` to `hooks`

* Satisfy mypy

* Add tests

* Use DRF serialization in action_defined and annotation_created triggers

* Update migration leafs

* Make mypy ignore rest_hooks

* Update Django signal receiver names

* Update TS dependencies

* Revert "Update TS dependencies"

This reverts commit 7fc26fefcd.

* Add field user to Hook model

* Update migration leafs

* Fix circular import

* Fix some code

* Install git before running pip install in Dockerfiles

* Improve personal API keys UI

* Satisfy mypy

* Reword key label placeholder

* Add personal API key support to /api/user/*

Unfortunately these endpoints are still limited by CSRF protections at the moment, so not accessible outside PostHog itself.

* Improve PersonalAPIKeyAuthentication and add CsrfOrKeyViewMiddleware

* Run collectstatic before test

* Don't install dev dependencies in CI

* Update dependency installation order in CI

* Fix bug and describe PersonalAPIKeyAuthentication

* Fix CI issues

* Fix typing issues

* Fix more typing issues

* Use /api/personal_api_keys to list keys

* Move REST hooks (and therefore Zapier) to ee/

* Refactor personal API logic with kea-loaders

* Add "More about API authentication in PostHog docs."

* Update PersonalAPIKeys.tsx

* Use TestMixin

* Fix "Authentication" that should've been "Authorization"

* Add option to skip self.client.force_login in API tests

* Include team_id and user_id in personal API key serialization

* Update test_hooks.py

* Add personal API key tests

* Remove leftover

* Make ee.settings override posthog.settings

* Don't directly import from models

* Remove unused imports

* Fix mypy issues

* Fix HOOK_DELIVERER

* Use decorator for /api/user PAK auth

* Don't fire REST hook if user doesn't have "zapier" feature

* Import Optional

* Reword to "premium Zapier"

* Make mypy happy

* Fix test_delete_personal_api_key

* Fix misclick

* Fix and test /capture with personal API key

* Make mypy happy

* Remove extra_properties_json

* Resolve migrations

* Remove apt-utils

* Optimize and test PAK user.is_active filtering

* Replace DEBUG true with 1

* Remove unused instance_id

* Improve typing

* Fix deletion toast

* Refactor CopyToClipboard and use it in PAKs

* Use toast.success

* Update migrations

* Fix migration

* Fix migrations

* Complete merge

Co-authored-by: Tim Glaser <tim@glsr.nl>
2020-08-26 10:34:57 +02:00
Michael Matloka
85786265e7
Add ph-no-capture to Toolbar (#1499) 2020-08-26 01:34:15 +02:00
Lee Yi Jie Joel
03a42f0570
Disable Link Sharing (#1475)
* Add backend api

* Run black

* Add Switch button to frontend

* Move switch down

* Add hook to disable signup link

* Run black with line width 120

* update conditional check

* send request on switch

* Update TeamInvitation to use api instead of fetch

* Convert signup_token to signup_state

* Remove unused import and stray comment

* Improve code and UX

* Reword notice

* Add invite link revoke popconfirm

* Update signup_token test

* Improve Popconfirm style

* Make TeamInvitationContent work with Modal

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-08-25 11:09:39 +02:00
Yakko Majuri
ba4a752646
Close #1292: Added tabs for distinguishing between different users (#1382)
* #1292: Added tabs for switching between user types in People

* updated fetchPeople implementation

* refactored and fixed pagination

* fixed search query across tabs issue

* updated api query param for person

* added tests

* added tests & fixed queries

* added cypress tests

* Improve code style

* Improve regex and add compatilibity with demo data

* Improve variable naming

* Switched user identifying mechanism

* made it demo friendly

* Improved method for identifying users, added tests

* fixing minor mistakes

* made cypress test more robust

* cypress test update

* fixed migrations conflict

* updated cypress tests

* Optimize process_event conditions

* Update comment

* Make _set_is_identified more versatile

* Update demo.py

* Rename queryset_anonymous_pass

* Improve rudimental identification detection

* User kea-router for All Users category tab

* Optimize People

* Make category play well with cohort in People

* Simplify way of filtering by identification

* Remove need for deep copy

* Check location in People tabs E2E test

* Update test_process_event.py

* Black test_process_event.py

* Fix test_set_is_identified

* Try E2E test with cy.wait(200)

* Try E2E with more waiting

* Don't check location in E2E test

* Add test_category_param

* Update migration

Co-authored-by: Twixes <dev@twixes.com>
2020-08-25 01:58:12 +02:00
Eric Duong
b172eee920
Insight history (#1379)
* add insight history

* add table

* edit format

* links working

* add modal

* add tab switch

* saving insights

* remove insights model

* no model for insight history

* initial working

* remove wrong typegen

* made the history per user

* missing param

* added funnel support

* add details

* add delete saved insight functionality

* add line break logic and funnel name

* fix reload logic

* fix rendering error

* add pagination component

* fix bugs

* add backend tests

* add insight-history-panel check

* add drawer and replace table

* add loading next

* add date

* add callback

* update test

* use table

* fix spacing

* fix rows

* adjust spacing

* fix spacing and styling

* fix spacing and styling

* .

* add missing package

* Funnel refactor (#1381)

* main funnel-insight page working

* consolidated funnels

* refactor funnel dashboard item

* dashboard modals working

* update demo creation

* updated migration

* fix frontend for funnels

* remove funnel code and fix bugs

* fix test and remove caching temp

* remove old tests

* fix types

* added panel for past funnels

* implement polling for funnel refactor

* .

* fix dashbaord item bug

* add params

* fix params

* clean up caching functionality

* fix types

* caching working properly

* fix dashboard update bug

* fix migrations

* fix check

* update caching to work properly

* Fix default

* fix api and styling for insight history

* more spacing

* update funnel automatically

* update tests

* fix clear condition

* merge insight history

* return save functionality

* remove file

* added extra save functionality
2020-08-24 17:02:13 -04:00
Michael Matloka
dd1d140c95
Put common head tags into head.html and fix name capitalization (#1489)
* Use EJS comments

* Fix capitalization

* Don't use EJS comments (compilation problems)

* Put common head tags into head.html template
2020-08-24 10:36:35 +02:00
Yakko Majuri
8737b618eb
switched active tab color on action filter dropdown (#1485) 2020-08-22 19:10:25 +02:00
Rupesh Padhye
986f4aaa7b
Closes #1367 update posthog icon (#1481)
* Closes #1367 update posthog icon

* Slightly improve logo in property keys

Co-authored-by: Twixes <dev@twixes.com>
2020-08-22 19:06:23 +02:00
Michael Matloka
575a3ef05c
Fix dashboard funnels on Safari (#1477) 2020-08-21 12:23:56 +02:00
Paolo D'Amico
7605d7abad
Setup improvements - Preflight (#1473)
Co-authored-by: Twixes <dev@twixes.com>
2020-08-20 16:56:12 -05:00
Marius Andra
ff1a1f9408
Toolbar action hints + regex (#1457)
* fix warnings

* Add url_matching help to ActionStep $autocapture inputs (Could be more DRY, but this entire class needs to be refactored)

* Add url_matching hints in toolbar

* plurals

Co-authored-by: Twixes <dev@twixes.com>
2020-08-20 02:40:19 +02:00
Marius Andra
be30a464ef
Few toolbar inspect fixes (#1470)
* Fix undefined error

* Reload all click targets when changing the URL

* Write code like it's 2020... after upgrade simmer to a version that return null instead of false
2020-08-20 02:38:56 +02:00
Anna
03fd0a668c
Fixes #1431 : Checks if event type is submit and adds property to filter by =submit when creating a new action (#1464)
Co-authored-by: Anna Philips <aphilips@matmacorp.com>
2020-08-19 10:43:03 +02:00
Michael Matloka
b151d48b8f
Fix bottom notice closing (#1467) 2020-08-19 01:58:24 +02:00
Marius Andra
1b116059b2
Improve heatmap count display (#1459)
* show count for heatmap instead of index, humanize large numbers and have a red hue for the biggest ones

* Improve humanizeNumber readability

* Fix code style

* Fix humanizeNumber

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-08-18 21:47:47 +02:00
Michael Matloka
860102958f
Clear up dau label and description (#1454) 2020-08-18 12:20:10 +02:00
Michael Matloka
44f45b86c6
Auto update VERSION (#1452)
* Auto update VERSION

* Use SYNC_GITHUB_TOKEN

* Fix minor oversights

* Fix auto commit
2020-08-18 12:02:31 +02:00
Marius Andra
1e261ebabc
Toolbar Heatmap & Inspect improvement (#1424)
* make element selection smarter (fixes several issues from posthog.com), upgrade simmer to version that supports data-attr

* when selecting click tartgets, if tag (e.g. <li>) has only one child (e.g. <a>), go all the way down (before coming back as high up as needed)

* get rect of inner node if it's bigger than click target (e.g. for "a > img")

* trim heatmap elements

* only show elements with `width * height > 0` in inspect

* revert antd to 4.2.0

* upgrade antd, downgrade cypress
2020-08-18 11:13:43 +02:00
James Hawkins
bf0673fd4c
WIP Changed DAU Label (#1453)
DAU is a confusing label - ie if the date range is changed to weeks, this essentially is WAUs
2020-08-18 11:04:58 +02:00
Michael Matloka
606dcfaea8
Add "no TLS in production" warning bar (closes #1422) (#1437)
* Add tls-bar

* Clean up bar

* Update class names and notice

* Refactor for code quality
2020-08-17 22:15:18 +02:00
Michael Matloka
4981139b8c
Improve EventsTable (#1449) 2020-08-17 15:13:14 -03:00
Marius Andra
45f10a8eaf
Kea TypeGen 0.2 (#1427)
* kea-typegen 0.2

* remove old Type.ts files

* more setup for typegen-0.2, update yarn scripts, remove webpackbar

* import types from the right paths

* update ENV in build script
2020-08-14 17:02:57 +02:00
Tim Glaser
70f59f9b58
Add action table created by/at (#1415)
* Add action table created by/at

* Take new User query into account in test

Co-authored-by: Twixes <dev@twixes.com>
2020-08-14 11:36:26 +02:00
Tim Glaser
23f5918477
Add enterprise edition and licensing (#1390)
* Add enterprise edition and licensing

* Cypress test

* License wording change

* Fix typos
2020-08-14 11:23:55 +02:00
Marius Andra
6a57cb3e2d
Fix Heatmap broken CSS selector with button[href=] (#1403)
* Fix Heatmap broken CSS selector with button[href=]

* upgrade posthog to 1.4.3
2020-08-13 22:32:08 +02:00
Marius Andra
d4291da022
Toolbar Actions Flow (#1320)
* fix TS undefined case (store can be undefined, but it never is... should be typed properly in kea)

* respect userIntent prop when opening the toolbar

* refactor opening the right actions view
2020-08-13 15:53:54 +02:00
Michael Matloka
86fe614e0e
Launch Toolbar cleanup (#1345)
* Improve Launch Toolbar button and modal style

* Fix URL list transparency issue

* Use filled rocket icon

* Make toolbar modal hog-icon transition faster

* Replace RocketOutlined with HogIcon
2020-08-13 15:27:27 +02:00
Tim Glaser
0e96ffb5f4
Revert "Poll funnels (#1366)" (#1405)
This reverts commit 9cc2a46bfe.
2020-08-11 18:30:24 +02:00
Tim Glaser
1a151598c8
Hide message format and make optional (#1402) 2020-08-11 15:36:56 +02:00
Marius Andra
83e94c5e68
Upgrade simmer to version that works with colons ":" in class names. (#1397)
* Upgrade simmer to version that works with colons ":" in class names.

* unescape classnames

* improve classname unescaping
2020-08-11 14:54:33 +02:00
Marius Andra
75a12b7bbf
Fix clicks counted multiple times (#1400) 2020-08-11 13:53:33 +02:00
Max Ungless
d14b0404ae
Enhancement (#1156) Adding more slack context via tokenisation (#1219)
* Added ability to customise Slack/Teams messages with additional context

* Refactor slightly and improve UX

* Reword Setup #webhooks description

* Update test_user.py

* Improve Edit action webhook configuration UI

* Refactor webhooks to be more universal

* Change tasks.slack to tasks.webhooks

* Make message format input clearer

* Make post_event_to_webhook more resilient with retries

* Minor fixes

Co-authored-by: Twixes <dev@twixes.com>
2020-08-11 10:53:35 +02:00
Eric Duong
9cc2a46bfe
Poll funnels (#1366)
* working poll funnels

* remove packages

* update test to use polling

* fix types
2020-08-10 16:27:55 +02:00