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

189 Commits

Author SHA1 Message Date
Marius Andra
32592b36bb
Remove Toolbar Beta Toggle (#1853) 2020-10-15 11:42:42 +02:00
Karl-Aksel Puulmann
c24c58828f
Upgrade cypress, fix and stabilize tests (#1872)
* Upgrade cypress

- https://docs.cypress.io/guides/references/migration-guide.html#Migrating-to-Cypress-5-0
- https://docs.cypress.io/guides/references/changelog.html#5-0-0

* Run tests multiple times if flaky

* Fix broken command palette cypress test

* Remove default retries options
2020-10-14 15:36:25 +03:00
Michael Matloka
c3d3f83c49
Destroy lodash (#1864)
* Convert utils to TS and add missing lodash-like functions

* Purge lodash, using utils and ES features instead

* Remove lodash as a dependency

* Fix Annotation.created_at default value (was null)

* Convert all of utils to TypeScript

* Update ESLint rule @typescript-eslint/explicit-module-boundary-types

* Put all @types/* into devDependencies

* Lower @typescript-eslint/explicit-function-return-type severity

* Fix Annotation.created_at in a better way

* Don't copy item on push in groupBy

* Use `Set.has()` instead of `in Set`

* Update .eslintrc.js

* Update .eslintrc.js
2020-10-14 10:42:06 +02:00
Michael Matloka
a52612cf02
Use proper react-grid-layout (#1862) 2020-10-14 09:59:02 +02:00
Michael Matloka
f71e011a86
Command palette (#1819)
* add hotkey base

* add platform check

* Rename CommandBox to CommandPalette

* Add styled-components

* Restructure CommandPalette and add Esc handling

* Update utils.js

* add search box

* Add logic types

* Implement base logic

* Fix scroll prevention

* Update logic and add goto command base with Fuse fuzzy serach

* ux hotkey

* Implement command (de)registration

* minor fix

* base UI

* error message & hints

* command groups UI

* Add commands search

* Make commands work

* Prepare palette for fuzzy search and add basic labeling

* ui adjustments

* ui

* Improve colors

* switch to global command

* Optimize resolution

* global go to commands

* abstract item selection logic to command palette

* Update casing and types

* Add conditional useCommands

* Improve results

* keyboard nav

* keyboard nav fix

* removed double fuse (synonyms broken)

* Update style

* Fix highlighting

* Remove extra style

* conditional go to commands

* add mouse hover handling and rename functions

* remove mac check

* add more commands

* added insights stub pages

* Add command components

* refactor logic

* Update styling

* Remove extraneous `input`

* load custom dashboards to command palette

* Add input styling

* Add write icon

* Refactor results

* minor adjustments

* add person search

* remove papercups fully

* fix input indexing

* fix result executing empty

* Add command grouping and improve navigation

* add urls

* make logic explicit

* fix error with hadnler

* Remove redundant border-top

* add trend functions

* personal api key stub

* Add command palette toggle button

* Fix things

* fix personal api keys

* copy api key to clipboard

* Add toggle text

* Improve palette UX and perform refactoring

* Improve UX and add palette usage reporting

* tests refactor

* filter person list

* refactor api person tests

* add squeak

* deprecate by_distinct_id & by_email person endpoints

* Optimize squeak

* fix typegen error

* use new filters in frontend

* Optimize squeak

* key identifier refactor

* fix mypy

* removed unused code

* Make custom command UI more coherent

* Add calculator to palette

* Use equal sign

* Make palette button nicer

* Add lodash back officially and show palette suggestions

lodash is still used in a few places, but it was not in package.json. The reason this was working was that lodash is a dependency of some other depedencies, but this was fragile. It's still not ideal to use this, but at least this is now not a hack the way it was.

* Remove isHint

* Optimize graph time range command

* Move command results grouping to Kea logic

* Fix result focus autoshift

* Improve palette result focusing

* Adjust for window.posthog being optional

* add test for third-party person filters

* Remove styled-components in favor of .scss files

* Remove redundant container class

* Use insect (sic!) squeak instead of pig squeak

* Show only unique palette results

* Fix palette overlay

* Add powerful command building protocol CommandFlow

* Fix minor issues

* Always show scope when flow active

* Use custom label icon

* Add feedback sharing command

* block command input from being captured in screen recording

at least until we can figure out how to capture this info in a privacy-preserving way

* Hide palette button on narrow screens

* Improve responsiveness

* Fix palette feedback sending

* Fix Esc handling

* Add Message Sent info

* Fix Message Sent info

* Fix dashboard creation and null name handling

* Rename Cy tests to JS convention

* Add basic Cypress test

* Address feedback

Co-authored-by: Eric <eeoneric@gmail.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2020-10-13 15:44:56 +02:00
Yakko Majuri
b9c3f0a4df
Added Session Recording (#1823)
* WIP

* wip sessions player

* improved types

* minor styling modal

* minor UI changes

* added sessions player behind feature flag

* added SessionsPlayerButton

* added sessions tab

* wip sessions in people

* do not display properties with underscore

* change delete approach

* wip

* hacky person sessions

* hide  property

* fix main sessions table

* get sessions for all ids

* update to  prop

* fix kea type error

* feature flagged person session table

* remove console.log

* make tab panes self-closing

* removed demo recording

Co-authored-by: Tim Glaser <tim@glsr.nl>
2020-10-08 12:37:33 +02:00
Karl-Aksel Puulmann
d4a00c9da2
Make session recording possible (#1821)
* Store rrweb.js under /static/recorder.js

This will be loaded by posthog.js and start the recording.

* Add new migration for Team.session_recording_opt_in

This will be used to figure out by posthog.js whether to capture session
data or not.

* Drop dead code

* refact: extract method

* Refactor decide endpoint to load team separately from calculating feature flags

This will be used for deciding whether to capture or not session
recordings

* Send `sessionRecording` key as part of decide endpoint

Will be used by posthog.js to turn recording on/off

* Make tests pass

* Make rrweb available
2020-10-08 11:09:35 +02:00
Marius Andra
e7a944ea96
Fix tsconfig.json lib property (#1818)
* fix tsconfig lib

* minor ts fix

Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>
2020-10-08 00:43:23 +02:00
Marius Andra
5729fb5f68
Toolbar Shadow Root Support (#1805)
* reset toolbar fonts (only things that leak through the shadow root)

* select elements from the shadow roots for "inspect"

* extract getParent

* select inside shadow roots for heatmap

* upgrade packages

* remove inline querySelectorDeep

* toolbar shadow dom trim

* improve toolbar no capture of itself

* improve a few things on the actions page

* also support actions

* use non-private query-selector-shadow-dom package
2020-10-07 10:17:28 +02:00
Yakko Majuri
8115e4969c
Added password strength bar (#1632)
* added password strength bar

* minor style fixes

* retry cypress

* extract password strength logic to standalone component

* Refactor with TypeScript

* updated strength algo

* fix linter comments

* fix comment

* made distinct chars test less strict

* use zxcvbn

* Make score numbers nicer and add a color between red and orange

Slightly pedantically made passwordScore always a multiple of 20%. :)

* run prettier

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2020-09-25 02:37:55 +02:00
Marius Andra
270c5f4a78
1) upgrade kea to 2.2.0 final and kea-typegen to 0.3.0, 2) fix some broken types (#1634) 2020-09-10 15:29:24 +02:00
Tim Glaser
a0e77935ae
Bump posthog-js 1.4.5 (#1597) 2020-09-08 15:28:35 +02:00
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
Tim Glaser
b101e42bab
Downgrade react dom (#1559) 2020-09-03 14:37:20 +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
Snyk bot
1251fdfad6
fix: package.json & yarn.lock to reduce vulnerabilities (#1527)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-LODASH-608086
2020-08-28 15:41:56 +02:00
Tim Glaser
7575d40d51
Bump posthog-js 1.4.4 (#1517) 2020-08-26 19:03:53 +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
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
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
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
Michael Matloka
49a15e9f53
Enhance and optimize PR GitHub workflows (#1365)
* Enhance and optimize GitHub workflows

* Prettier app.json

* Update YAML list

* Prettier workflows

* Include YAML in prettier runs

* Improve job naming

* Update E2E workflow name

* Prettier docker-compose YAML

* Update workflows

* Put freezegun into prod requirements

* Update workflow names

* Update workflow names again

* Update ci-backend.yml

* Update Lint with flake8

* Remove redundant eslint:ci script

* Revert "Put freezegun into prod requirements"

This reverts commit 460e3942d10194e9f46c8a2196ebd9ecc1f23c6f.

* Install freezegun in workflow and update dev.txt

* Prettier auto-image.yml

* Add "CI" to ci-* names

* Fix prettier:check

* Add missing SECRET_KEY

* Prettier 2 last files
2020-08-18 11:08:40 +02:00
Marius Andra
cd2f40e75a
Revert "Update dependencies (#1436)" (#1444)
This reverts commit 8ab612c246.
2020-08-17 15:40:11 +02:00
Michael Matloka
8ab612c246
Update dependencies (#1436) 2020-08-17 10:56:57 +02: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
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
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
e9d9b98d63
Upgrade posthog-js to 1.4.2 (#1401) 2020-08-11 13:08:04 +02:00
Marius Andra
52cdd7e572
New toolbar cookie + Secure session/csrf cookies (#1387)
* - set a custom cookie to tell the toolbar we're logged in
- make other cookies secure

* skip adding new toolbar cookie on API requests

* fix demo page local https

* enable/disable secure cookies as needed

* show django toolbar only for API requests

* update posthog-js and kea versions

* satisfy mypy

* add SECURE_COOKIES=0 to cypress tests, since they run over HTTP

* revert kea version

* add test for toolbar cookie middleware

* try something for cypress

* add debug

* add cypress-terminal-report for better logging

* fix demo api_url

* revert previous change that triggered cypress
2020-08-11 10:52:43 +02:00
Marius Andra
c4eef98f0e
update posthog-js (#1385) 2020-08-07 02:53:49 +02:00
Marius Andra
cf98e8ba35
Toolbar Typings (#1306)
* update to kea-typegen that runs through prettier

* remove posthog-js yalc package regression

* add types to toolbar

* add react-dom and react-redux types

* add types to toolbar react components

* convert a lot of components to typescript

* convert more components to typescript

* fix error

* actions return void

* clean up other Type.ts files as well

* fix last untyped files

* upgrade kea, fix webpack config entrypoint

* add stricter typechecking

* add types for a few more files

* fix bug with nth_child selectors (introduced in this PR, now fixed)

* fix one more type
2020-07-30 19:16:59 +02:00
Marius Andra
f2b8d54ee5
Kea TypeGen 0.0.31 (#1297)
* update to kea-typegen that runs through prettier

* update logic type files

* remove posthog-js yalc package regression

* upgrade to 0.0.32 that fixes error with string literals in defaults

* prettier wants to reformat things
2020-07-29 11:21:00 +02:00
Marius Andra
3f47ad2d0c
Kea TypeGen (#1286)
* update typescript eslint config / fix tsconfig.json path bug

* add kea-typegen and UserType

* kea-typegen first run, add types to userLogic
2020-07-28 22:25:24 +02:00
Michael Matloka
4ebca38d53
Sort imports with isort (#1272)
* Add and configure isort

* isort all the things!

* Use local black and isort, and include json in prettier

* Remove erroneous import

* Delete isort.cfg and add isort options to lint-staged

* isort all the things! (with Black-compatibile options)
2020-07-28 22:19:33 +02:00
Eric Duong
d7fe71f083
1247 annotations crud (#1258)
* working table

* add modal

* continue adding to modal

* added function to create global annotation

* format

* test commit

* add precommit

* add update function

* crud working

* add type

* fix tests

* add next

* add prompt

* tests
2020-07-22 12:25:54 +02:00
Michael Matloka
5551a2f9fe
Update posthog-js to 1.3.5 (#1260)
* Update posthog-js to 1.3.5

* Update lockfile
2020-07-21 13:26:08 +02:00
Marius Andra
021531c121
Toolbar Instrumentation (& posthog-js-lite) (#1206)
* more packages

* add instrumentation for toolbar

* Remove committed code

Co-authored-by: Tim Glaser <tim.glaser@hiberly.com>
2020-07-21 11:35:52 +02:00
Marius Andra
5623551b04
Launch toolbar (#1186)
Co-authored-by: Twixes <dev@twixes.com>
2020-07-17 19:57:42 +02:00
Marius Andra
34939f7e45
Toolbar __posthog state param and JS_URL setting (#1196)
* use "ph_authorize" as an action when loading toolbar

* upgrade to new posthog-js

* add a new setting for JS_URL (webpack HMR path)
2020-07-13 12:21:53 +02:00
Marius Andra
ff08e5df58
add webpackbar and tune the setup (#1185) 2020-07-10 13:31:35 +02:00
Marius Andra
a256373526
Add Typescript Support (#1157)
* explicitly ignore some linting errors

* add typescript support and fix postcss dev warnings

* convert a few files to ".ts"

* fix return values
2020-07-08 09:45:23 +02:00
Michał Matłoka
93aebb9e7b
Update prettier to 2.0.x (#1143)
* Update prettier devDependency to 2.0.x

* Format with prettier 2.0.5

* Update yarn.lock
2020-07-03 14:37:07 +02:00
Marius Andra
da5a48c33d
Black all the things! (#1136)
* Black all the things!

* changed line length to 120
2020-07-02 15:41:49 +02:00
Marius Andra
9cb177af80
posthog js 1.2.4 (#1133) 2020-07-01 21:18:05 +02:00
Marius Andra
3d245c2b0b
upgrade posthog-js to 1.2.3 (#1131) 2020-07-01 16:24:49 +02:00
Marius Andra
8a9d7f620a
Toolbar Updates - Episode 3 (#1105)
* fix tab alignment

* fix button float color

* default color in float mode

* long press extends the toolbar

* add new logo

* also add logo without text

* add window values plugin

* refactor utils

* support x,y coords in circle

* show toolbar button in new style

* remove float mode

* draging doesn't trigger click

* improve rotation

* improve heatmap number

* position of the close button

* "dock" icons to button

* clarify my choice

* show heatmap in a window

* show heatmap with a border

* use new icons

* open actions tab

* remove unused prop

* move Fade into lib/components

* animate with fire

* fix heatmap icon bug

* don't show X, new stats icon

* heatmap window title

* dock and close also shrink

* flag animation and loading for actions

* dock actions to button when enabled

* actions window

* open actions in button window

* colors for indicators

* close buttons

* inspect X

* add stats view with info

* new icons for close & dock

* add/edit actions in button mode

* color code the different elements in select element view
2020-06-30 12:57:02 +02:00
Karl-Aksel Puulmann
596635fbcd
Improve ./bin/test command (#1074)
It did not run under `fish` shell at all, added a shebang to make it
work.

Also it assumed nodemon is installed globally. Instead we can add
nodemon as a devDependency and use `npx` to run it.
2020-06-23 18:42:54 +02:00
Tim Glaser
f61e9c111b
517 feature flags (#1017)
* WIP #517 feature flags

* Fix default filters

* Move decide to its own file

* Bump posthog-js 1.2.2

* Fix decide endpoint

* Add logic, update posthog-js

* yarn lock

* update snippet

* Add cypress tests

* Add example code

* Fix example code

* Add tests for query size

* Add errors when trying to create feature flag with same key

* Add explanation comment

* Fix cypress tests

* Do caching of teams in Team model

* Use <= instead of <

* Instrumentation and fix

* Fix ci test

* Add patch for team

* Debug test

* It passed
2020-06-22 10:57:09 +02:00
Marius Andra
98108bd4e9
Copy array.js.map as well to better debug errors (#1047) 2020-06-18 13:41:28 +02:00
Tim Glaser
95dc359ab9
Add black (#1043)
* Add black

* Add black
2020-06-17 22:16:25 +02:00
Marius Andra
aeed457909
Toolbar Heatmap (#974)
* Temporary Hack™ - allow access to the events API via the temporaryToken

* Consolidate small utility functions

* Heatmap [WIP]

* Let the mouse through

* adjust z-index

* no heatmap pointer events when inspecting

* bolder and more interactive toolbar button

* zoom and padding for float mode heatmap

* extend toolbar buttons from the mouse distance, add toggle for heatmap

* animated spinner when showing the heatmap

* add labels to circles

* fix distance bug

* more text shadow

* also highlight inspect element after something has been highlighted

* hover heatmap element

* highlight selected elements

* show metadata for heatmap

* reorder elements

* show inspect element box

* tiny "x" in magnifying glass

* close selected element metadata

* heatmap element click data

* add "add action" stub

* fix element selection logic ux inconsistencies, add esc support

* actionstep display

* move events around

* inspect element rect also via react

* extract element trim logic (path --> svg), add support for cursor:pointer click targets

* keep yellow markers in bounds, fix positions after a delay after scrolling

* get heatmap data from /api/element/stats/

* scale element metadata

* show ranking in metadata

* rename link to clickable

* remove posthog toolbar from clickable list

* move TemporaryTokenAuthentication to utils

* try to bust the cache

* use authentication screen to get temporaryToken, add toolbarLogic to store all props

* use button mode if not authenticated

* more control over animation

* can drag unauthenticated button

* hide heatmap when animating

* no need for cascading props

* call a width a width (radius was incorrect as it should be half that)

* clean toolbarButton code

* add 'userIntent' instead of 'defaultTab' to guide the user in adding an action

* enable heatmap in the float/dock toolbar

* re-request authentication on a 403

* small tweaks to scroll update delay and bust cache again

* double-space-cache-bust

* rotating text for logged out button

* split heatmap elements and labels into separate components

* heatmap with inspect element click targets

* also select all elements with cursor:pointer

* merge "inspectElement" and "heatmap" into "element", remove "inspect anything" mode

* fix element tooltip horizontal position

* escape class names in selector

* leave clues for the next time

* toolbar hello text update

* fix css escape issue on nth queries

* fix color in docusaurus v2 dark mode

* show element info window in sidebar in dock mode

* support ESC

* scrolling and animating won't conflict with each other in dock mode

* close button first unselects

* reverse elements if body is the last one returned

* click to select element in heatmap list

* only show element in toolbar in dock mode

* Order elements by order

* heatmap bottom position min and max heights

* keep window on screen

* remove element hack

* highlight element got stuck

* position heatmap info window better

* Fix tests

* remove selected element when disabling heatmap

* simple auth text

* 3 pixels lower

* center with flexbox

Co-authored-by: Tim Glaser <tim.glaser@hiberly.com>
2020-06-16 14:28:11 +02:00
Tim Glaser
aa91409b6a
Bump posthog-js 1.2.2 (#1016)
* Bump posthog-js 1.2.2

* Yarn lock
2020-06-15 18:57:35 +02:00
Marius Andra
3ab8b73817
Upgrade to posthog-js 1.2.0 to support dynamic params. (#957)
* Refactor editor params. Specify default editor tab. Upgrade posthog-js.

* add backwards compatible 'token'

* fix test

* keep things simple
2020-06-09 10:55:56 +01:00
Tim Glaser
9b8736d576
Fix cypress linting errors and speed up tests (#865)
* Speed up e2e builds

* Don't go to demo when logging in/cypress errors

* Execute cypress in docker container

* Pull from correct image

* add -T

* Try something else

* Add dockerfile

* Don't push tags

* Tag

* Try another tag

* image tag

* Try pulling

* Try

* Try caching

* no docker ifle

* Install node

* name

* name
2020-06-08 19:34:39 +01:00
Marius Andra
11ff3787e3
PostHog Toolbar (#896)
* can zoom out toolbar

* refactor the look

* add kea localstorage plugin

* add test to see if user is logged in or not

* keep width when resizing window

* increase padding on larger screens

* floating box style

* toolbar close button

* show what's on the current page

* fix close and remove tags

* inspect element

* inspect element improvements

* show stats

* inspect element

* give jsURL to the editor in debug mode

* toolbar HMR

* move styles to CSS

* tabs on toolbar

* css for current page block

* links to dashboards and actions

* adjust the location of the X so that we don't always have a horizontal scrollbar

* clean up some css, incl renaming toolbar divs

* refactor webpack config to use a separate config for the editor chunk, in it include all CSS inside the JS

* load styles behind the shadow, render only once all CSS is loaded

* tolerable design for the floating view

* header block for float + css zindex fix

* fix height

* move toolbar to toolbar folder

* add back old toolbar folder

* load by default editor.js, move new toolbar to toolbar.js

* only open toolbar.js by default, not editor.js

* add comment for toolbar setting

* Updated Yarn lockfile

* fix test and rename is_authenticated -> isAuthenticated in json

* get mypy to play along

* refactor tab content into folders

* refactor code structure for toolbar

* simplify floating/docked/float/dock -> float/dock

* small refactor

* upgrade to posthog-js 1.1.0

* fix array copy code
2020-06-04 13:45:24 +02:00
Tim Glaser
be7a345a61
Https locally (#910)
* Fix temporary token issue

* only pass params once

* HTTPS locally
2020-06-04 10:14:54 +01:00
Tim Glaser
bcf427cb55
Webpack HMR, Add hashes to chunk filenames. (#878)
* Closes #877 chunk loading errors

* Closes #877 chunk loading errors

* add chunks to all webpack files, use webpack-html-plugin to make an index.html with the right names

* change to contenthash for better caching

* add dev server on a different port

* store loaded scenes in reducer

* add react-hot-loader

* add react-hot-loader to all code split points

* fix action pages HMR

* ignore cypress screenshots

* generate django login/signup page layout with webpack html plugin

* move to devDependencies

* expose webpack-dev-server ports

* run tests on the production docker image

* start webpack dev server on a custom host if requested

* revert e2e to dev dockerfile

* add test travis config

* add stages

* add travis conf

* cache node and pip

* node 11

* travis ci bump

* node via nvm

* install v12, disable cypress for a moment

* remove 2 commands, test cached build time

* try different yarn cache, add cypress

* add postgres 12

* migrate before cypress

* remove latest postgres for now

* createdb before cypress

* Try different port

* cull packages

* remove hash from main bundle filenames to not break anything

* cypress port 8000

* cypress tests with production docker

* don't use the /code path in e2e test, use docker image

* remove hash from css to work better with editor

* only one export from actions

* remove travis test

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2020-06-02 10:39:53 +01:00
Tim Glaser
46eaf1b742
Fix babel errors (#861)
* Fix babel errors

* .

* Update lock file

Co-authored-by: Eric <eeoneric@gmail.com>
2020-05-26 20:14:46 +01:00
Eric Duong
848085682d
change more dropdowns to antd (#814)
* change more dropdowns to antd

* action select

* eslint errors

* remove react-select

* restore lost properties

* add height
2020-05-21 20:33:29 +01:00
Eric Duong
a012aa6723
Cypress tests (#789)
* initial test

* add yaml

* add logs

* without tail

* run again for consistency

* wait longer

* manuall configure cypress

* use latest ubuntu

* try installing all

* yarn install

* yarn install with cypress

* full flow

* run again for consistency

* initial tests for trends

* handle exception

* separate e2e docker-compose

* run on pr

* trends-testing foundation

* run test

* don't pass everything

* handle uncaught exceptions

* fix dashboard tests

* change email domain

* change dataattr to data-attr and boilerplate cleanup

* base url config

* add script for test runner

* change default postgres
2020-05-19 14:48:10 -04:00
Marius Andra
dc447dc172
Touch dashboards (#775)
* more resize handles

* see-through loading overlay

* mobile mode, dragging dashboards, make panels wiggle, etc

* use long press and esc to control dragging

* clean up header

* disable dragging when clicking on the background

* clear toast on unmount, disable pointer events when dragging

* rearrange button

* clicking handles doesn't stop rearranging

* fix grid layout import

* fix header layout on mobile

* better alignment of version and worker info in responsive mode

* overflow fix

* pinned dashboards in sidebar

* more visible rearranging toast

* clear dom text selection after starting to resize panels

* add existing dahboard name in the "save to dashboard" modal

* add divider between pinned dashboards and the rest of the menu

* clarify how to exit drag mode

* dragging enabled by default, disabled if iOS or Android, long touch only to enable wobbly mode

* add margin under wobbly dragging mode to make it nicer to move the last item

* can drag panels from anywhere, except tables

* exclude tables from long pressing

* less padding in low resolutions
2020-05-18 20:48:24 +02:00
Marius Andra
b446731ced
add breakpoint (#754) 2020-05-13 10:02:01 -04:00
Tim Glaser
20fab5d5a2
Add ES Lint (#719)
* Add ES Lint

* Update lint.yml

* move lint file

* Add eslint to package

* use yarn

* Run ci/test only once

* Fix eslint errors

* Fix rest siblings

* precommit hooks

* Lint typo

* ESLint per file

* Eslint
2020-05-13 13:17:00 +01:00
Marius Andra
bc7eabc315
Resize dashboard items (#746)
* Fix Error404

* resize and drag dashboard items

* fix funnel resize issues

* store layouts in kea

* layouts for different breakpoints

* save layouts after updating

* colors in submenu, but disabled

* save item colors

* 1920-sidebar breakpoint

* add graph colors for graphs with backgrounds

* pie chart label color and z-index to put over the chart if a long number
2020-05-13 11:14:09 +01:00
Marius Andra
c324582076
703 multiple dashboards (#740)
* create dashboard model

* add pinned dashboards to submenu

* rename "Default Dashboard" -> "Dashboard"

* refactor SaveToDashboard modal

* save onto right dashboard

* load and show dashboard data

* move logic to separate file

* dashboard selection

* prompt for name

* add promise cancellation for prompts, so that they close when we change the url

* show a global loading progress bar if it takes more than 500ms for any loader to work

* add dashboards on the dashboard page

* pin dashboards

* rename dashboard

* cut off text nicely in the sidebar

* delete dashboards

* dash item "more" link in antd style

* revert to ellipsis

* trigger by click, redirect well with delete

* remember last visited dash, update icons

* better view icons

* refactor Dashboard into subcomponents

* add a sad hedgehog for the 404 page

* fix loading keys

* add a few more overlay hedgehogs

* add new dashboard from "no dashboards" page

* use a hedgehog with a better license

* better redirect when deleting dashboard

* update dashboard items design

* dark sidebar

* make a few other scenes darker

* add a few styles that can be toggled

* add menu to change color of dashboard panel

* move to prompt logic

* new dashboard on dashboards page

* show success message in model

* refactor shared listeners

* rename dashboard item

* add new dashboard when adding to dashboards

* redirect after adding

* fix icon alignment

* undo deleting dashboards

* replace antd message with toast to close programmatically

* remove the style dropdown for now

* set the scene on a new "thread" to avoid react's reconciliation triggering logic building on the current run heap

* fix action run heap issue properly

* use table in dashboard list, link to all dashboards

* support links without hrefs

* empty dashboard style fix

* ignore type

* save created_by user

* remove nprogress spinner

* use antd table to render dashboards

* show "all dashboards" as the default when clicking the link

* pin dashboards automatically

* soft delete

* remove nprogress

* remove nprogress

* remove all caps

* export deleteWithUndo function

* add delete and pin links to dashboards list
2020-05-11 18:09:02 +02:00
Marius Andra
6aea09228c
Routing Refactor (#717)
* extract some components from EventsTable

* event table refactor

* move logic and load next events

* flip sort order

* eventSelected -> selectedEvent

* put all next fetching through the same fetchEvents action

* event polling

* onClick not needed

* refactor EventElements into separate file

* unique key for events table based on the view that is open

* disable filtering in actions page

* use <A> tag

* fix ===

* make property filter update the filter through the browser URL

* move from react-router to kea-router

* add root redirect

* fix dashboard urls

* remove <A /> tag, keep using <Link />

* load events before the scene opens

* rename ActionEvents -> LiveActions

* use eventsTableLogic for live actions

* when removing a filter, assure that there is a {} at the end

* save path so that we don't update anymore when we move off the page

* preload logic before scene

* better name for property filters

* fix default search input uncontrolled error

* set property filters through the url

* refactor some variable names

* clean active views and cached urls, add "order" to actions from url

* fix some linter errors

* build and pass logic

* turn actionFilterLogic into a controlled logic

* make it work

* small code improvements

* use properties from kea-router's search params

* upgrade kea-router

* use properties hash

* rename actionFilterLogic.js to entityFilterLogic.js and pass logic down in props

* more entityFilterLogic cleanup

* use new router for trends

* use objectsEqual instead of manual JSON.stringify comparison

* router.values.searchParams in propertyFilterLogic.js

* adding new entity type works

* always highlight something in the sidebar

* remove unused FilterLink.js

* refactor active submenu

* add query to link to /people

* funnels work again

* split property filters per id of funnel

* set $pageview or $screen as default action in /trends if just opening the URL, sparking loads of joy

* fix uncontrolled<->controlled input warning

* simpler loading, without breaking DOM rules

* cleaner loading screens

* fix uncontrolled to controlled warning

* do not show links to myself if showing events table under /person/:id

* uncontrolled - controlled input

* remove broken link to step event, fix duplicate key errors

* table loading as overlay if something in table

* show loading overlay only after 500ms

* undefined fix

* 2 more undefined fixes

* use kea-router's combineUrl instead of the homebrewn toParams()

* date filter returns dates as strings
2020-05-07 11:48:04 +02:00
Marius Andra
9134e13177
Kea 2 (beta) upgrade (#663)
* upgrade to kea2 beta

* remove empty createStore

* add yalc to .gitignore

* add kea 2 and babel-plugin-kea
2020-04-27 16:39:21 +01:00
Tim Glaser
4931407da2
Closes #505 filter funnels by events as well as actions (#561)
* Closes #505 filter funnels by events as well as actions

* Simplify kea modules and store date_from directly against filter

* Use key on kea so the list doesn't get carried between funnels and trends

* Move filters to selector

* Remove useEffect

* Remove unused type: ignore

* Fix creating new funnel
2020-04-14 20:41:26 +01:00
Tim Glaser
76fa26a1a0
Fix event name test (#579) 2020-04-14 15:31:04 +01:00
Tim Glaser
4782d54d1f
Configure mypy (#562)
* server/mypy: Enable no_implicit_optional

no_implicit_optional Changes the treatment of arguments with a default value of None by not implicitly making their type Optional.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#none-and-optional-handling

* server/mypy: Enable warn_unused_ignores

warn_unused_ignores: Warns about unneeded # type: ignore comments.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#configuring-warnings

It's best to exclude packages with no typing in mypy.ini rather than in
the code. This waym if tin the future these packages add types it's can
easily be disabled (by removing the exclusion in mypy.ini).

* api/user: Fix user password was not really validated

* api/test/base: Remove unreachable code

Team is created in setup, so no reason for it not to be there (unless
setUp is overriden by child, which as far as I can see is currently not
happening),

* server/mypy: Enable check_untyped_defs

check_untyped_defs: Type-checks the interior of functions without type annotations.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#untyped-definitions-and-calls

* server/mypy: Enable strict_equality

strict_equality: Prohibit equality checks, identity checks, and container checks between non-overlapping types.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#miscellaneous-strictness-flags

* server/mypy: Enable warn_unreachable

Added a fixme for a possible oversight in function that parses JSON.

warn_unreachable: Shows a warning when encountering any code
inferred to be unreachable or redundant after performing type
analysis.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#configuring-warnings

* api/posthog: fix possible bug when batch is not a list

Current code assumes batch is a valid list. If batch is not a list, the
capture handling will cause a 500 error.

* fix stricter mypy

* Use response.json instead of .data

Co-authored-by: Haki Benita <hakibenita@gmail.com>
2020-04-14 11:05:45 +01:00
Eric Duong
848d5abf53
added babel plugin (#545) 2020-04-13 10:22:43 +01:00
Eric Duong
ecbec73ac7
Replace current Sidebar with Ant Design Sidebar (#530)
* initial commit for dropin

* remove console log

* inner menu item weirdness

* recover original styling of modal and invite buttons

* colors and styling

* remove parent props

* updated path comparison and squashed an previous error on inviteteam modal

* returned some of previous implementation for less diff
2020-04-10 14:42:31 -04:00
Tim Glaser
6f68b6a8ed
Adds to #533 use offset instead of timestamp of posthog-js to avoid w… (#535)
* Adds to #533 use offset instead of timestamp of posthog-js to avoid wrong user time

* Fix type error
2020-04-10 13:26:59 +01:00
Tim Glaser
8b4a1c2ab1
Bump posthog-js 1.0.6 (#529) 2020-04-09 17:14:00 +01:00
Tim Glaser
cb7dd2551e Fix npm command to copy array.js 2020-04-09 13:25:53 +01:00
Tim Glaser
70c8c71bd1
Use npm instead of yarn in copy command as Heroku doesnt have yarn (#520) 2020-04-09 13:22:48 +01:00
Tim Glaser
4223758d8b
Use posthog-js to get array.js (#518) 2020-04-09 12:58:45 +01:00
Marius Andra
448138beda add props to trendsLogic to split dashboard charts, reactor actions and properties into models, move "results" into a loader 2020-03-25 11:31:08 +01:00
Marius Andra
280384235d sue kea-loaders to fetch trends actions and properties in a controlled way 2020-03-25 10:28:33 +01:00
Marius Andra
bd34449087 move kea-router to deps 2020-03-21 16:26:06 +01:00
Marius Andra
9fce118cbe refactor Trends to functional component and store values in trendsLogic 2020-03-21 00:54:19 +01:00
Marius Andra
888cb3e251 fix rebase: update style and move package.json again 2020-03-18 13:45:06 +01:00
Marius Andra
de6ebca84d move package.json to the root folder 2020-03-18 13:41:46 +01:00
Tim Glaser
16958db9bc Update readme 2020-02-20 00:10:18 -08:00
Tim Glaser
7561597d8c Improve readme with production installation instructions 2020-02-09 14:39:05 -08:00
Tim Glaser
bbd67289d9 Nicer way of displaying elements 2020-02-08 16:00:17 -08:00
Tim Glaser
b5742e3b8a Add actions trends graph 2020-02-01 22:40:38 -08:00
Tim Glaser
5816fc98e3 Add actions view 2020-01-26 23:28:32 -08:00
Tim Glaser
7f911cddcc Events frontend 2020-01-24 15:57:57 -08:00