* Set ACTION_EVENT_MAPPING_INTERVAL_SECONDS to 300, move to settings
* Add async warning
* Use smarter get_from_env
* Async event action mapping warning when creating a webhook
* Async event action mapping warning when editing an action
* remove top async warning
* Use common reworded notice component for async mapping
Co-authored-by: Michael Matloka <dev@twixes.com>
* Better handle extra info buttons during plugin reordering
* Fix UI bug in first time plugin enabling
* Give very new Cloud org config access to plugins
* Add migration
* Lower the bar to report bugs in plugins
* remove lingering space
* Fix PluginImage sizing
* Improve ordering tooltip clarity
* Use new ExtraPluginButtons component for About and Feedback
* Reduce large PluginImage size
Co-authored-by: Michael Matloka <dev@twixes.com>
* Fix SubtitleProps.buttons type
* Improve "Mark as global" styling
* Show globally managed plugins last in the installed disabled list
* Update InstalledTab.tsx
* Add Edit order tooltip
* Show notice if could not get a unique selector for the element
* Remove redundant value fallback
* Clarify tip
* Prettier
Co-authored-by: Michael Matloka <dev@twixes.com>
* dropdown and datepicker z-index
* remove dead code
* pass getPopupContainer to range picker
* make DateFilter's custom time range work in a shadow root
* close after selecting
* show date filter instead of date range
* skip updating url on date filter change in toolbar
* actually filter the dates
* fix flickering (always show map)
* refactor date filter component
* upgrade to webpack 5 and @posthog/react-rrweb-player module
* disconnect dashboardLogic from dateFilterLogic (remove broken url changes, etc)
* add bundle tracker
* remove react-hot-loader
* Revert "add bundle tracker"
This reverts commit e59bcfa8
* remove bundle tracker
* remove updatePath
* fix code quality complaints
* revert @cypress/webpack-preprocessor version
* try different cypress webpack plugin
* add crypto-browserify
* add crypto-browserify
* revert to webpack 4
* revert to webpack 4
* revert to webpack 4
* implement feedback and remove debug stuff
* move insights date filter logic out of lib/
* rename DateFilterComponent to DateFilter
* rename DateFilterCustom to DateFilterRange
* Remove hot from new code
* WIP auto filter test accounts
* finish off
* Fix tests
* Non generic emails
* add list of generic emails
* Move location to below property filters
* Fix typescript errors
* as any
* fix tests
* filters
* fix tests
* Featureflag doesn't really makes sense for this feature
* fix tests
* fix test
* Add clickhouse + tests for each insight
* Fix lifecycle and paths
* Fix sessions
* Fix session tests
* fix sesisons test
* fix migrations
* fix migration chain
* refactor path & remove stale console.log
* adjust useAnchor & minor copy
* rename to avoid confusion with inline component
* test account filter tweaks
* fix filters
* hardcode
* Add tests for funnel trends
* Make generic emails super fast
* Fix migrations
* Default to false for now
* Default to false, remember a user's preference
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Add crypto-js for calculating MD5
* Add Gravatar support to profile picture
* Add title attribute to ProfilePicture img
* Optimize ProfilePicture
* Fix typing
* Show Gravatar in Members list
* Remove style from ProfilePictureProps
* Update title in ProfilePicture img
* Fix TS
* Show Gravatars in Invites
* Remove debug line
* Use nbsp in /.+ (At|By)/ table headers
* Remove user prefix from ProfilePicture props
* WIP Plugins secret config fields
* add comments
* Polish Secret Plugin Field (#3476)
* Replace warning with a button
* no matter what the value is -> a secret is a secret
* update text
* secret api changes
* check equality with secret string
* fix type
* add tests
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* Add JSON view for events
* Extract sortedKeys to utils
* Don't wrap EventJSON CodeSnippet in extra div
Co-authored-by: Michael Matloka <dev@twixes.com>
* 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
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.
* 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>
* 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
* 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
* 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
* 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
* 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>
* 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>
* 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
* 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
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
* Return no data if invalid regular expression
This currently returns a 500. Fixes 3191 together with frontend
validation.
* Add browser validation
* Typing errors
* 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
* 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
* 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>
* 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
* WIP: get cypress something doing
* Get a test running
* Get css loading, stub posthog
* Move helpers to separate file
* Givens > given2
It plays nicer with beforeEach
* Test for session filters
* Test date navigation
* Test filtering
* Try keep old tests running
* Try get tests running under CI
* Prettify fixtures
* Cleanup, use cypress 6
* Add yarn build
* Fix e2e cypress tests
* given2 => givens
* Rename `frontend-test-runner` to `e2e-test-runner`
* Fix cypress test
* add devdependency
* add scaffold
* person test
* fix type
* fix check
* inline fixture
Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
* Improve entity rows layout
* adjust UI
* handle case where mathSelector is not available
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Update Project Danger Zone to Plugins standard
* Extract PinnedDashboards to own component
* Set default body background to white
* Fix JSBookmarklet note style
* Add project rename
* Expect data-attr in okButtonProps type error
* Rename project name section to "DIsplay Name"
* Use disabled and loading on projet DisplayName
* Add models-side Team.name min length requirement
* Make small fixes on Plugins pages
* Revert "Add models-side Team.name min length requirement"
This reverts commit 97874ed7c2.
* minor copy adjustments
* Make button "Rename Project" and improve interactivity
* Remove teamLogic.connect
* Add project rename success toast
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* WIP: get cypress something doing
* Get a test running
* Get css loading, stub posthog
* Move helpers to separate file
* Givens > given2
It plays nicer with beforeEach
* Test for session filters
* Test date navigation
* Test filtering
* Try keep old tests running
* Try get tests running under CI
* Prettify fixtures
* Cleanup, use cypress 6
* Add yarn build
* Fix e2e cypress tests
* given2 => givens
* Rename `frontend-test-runner` to `e2e-test-runner`
* Fix cypress test
* Add webpack-preprocessor as a devDependency
* Improve freezing time
* Make css inclusions automatic for component tests
* Improve project deletion
I noticed that we immediately reload after project gets deleted - before
the actual request completes and any data is deleted, making it seem it
did not work.
This fixes that, showing a toast while the request is outgoing.
* Fix margin from CreateProjectModal error
Co-authored-by: Michael Matloka <dev@twixes.com>
* update props
* fix props number update on PersonV2
* avoid overwriting function argument
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Update demo data warning styles
Left-over from https://github.com/PostHog/posthog/pull/3103
* minor adjustment
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Unify clickhouse and pg demo data creation
* Adapt yakkos demo data generation to normal demo
* Split demo.py into subfolder
* Add original, web data import
Note that elements are not added because they can't be added
automagically :(.
* Improve wording
* dont generate dashboards
* try get tests passing
* fix types
* Get cypress tests green
* fix form type
* split to enabled/disabled plugins and add empty and loading screens
* show ingestion order
* add "rearrange" button
* show alert when rearranging
* drag to sort plugins
* fixes
* move opt-out to "danger zone" in "advanced" tab
* refactor "custom" to "advanced" in the code
* rename to DangerZone
* start rearranging from dragging card
* show changed order
* remove extra button
* save order in the backend
* fix default config for newly installed plugins
* newly enabled plugins go to the end of the list
* mypy
* hide second "check again" button
* show code diff
* lowercase
* clarify string
* reload only if saved, add 403 status if no access, simplify dict
* set temporary order only on enabled plugins, avoiding rearranging "plugins to update" list
* simplify condition
* change empty component
* raise instead of 403
* Migration for is_demo
* Populate is_demo when triggered
* Refactor: extract create_demo_team
* Also create ee sample data
* Create demo data if feature flag enabled (and in debug), redirect to root
* Show demo warning
* Solve rease issue
* Redirect to personalization
* Redirect to root
* Update antd to latest, which gives access to Alert action prop
* Update demowarning code
* update tests
* Update naming
* Update link
* refactor Signup location
* personalization route stub
* radio buttons base UI
* select radio options
* continue button
* save personalization state
* report personalization answers to PH
* all data & nicer UI
* mark personalization completed on DB
* cannot complete personalization twice
* rename components
* more fixes
* undo completed_personalization as per discussion, @macobo's PR coming
* fix ts
* Add session recording retention period column
* Allow setting session recording retention period
Solves #3059
* Run session recording retention task on all self-hosted
Using setting from team.session_recording_retention_period_days
* make plugins required in the setup
* make plugins still optional in dev, but add a strict warning
* Unify text formatting
Co-authored-by: Michael Matloka <dev@twixes.com>
* private token support for github and npm
* refactor url splitting
* mypy
* fix needless regexp escapes
* simplify parse_url output, tag is always tag now
* simplify parsing api response to get latest tag
* add links to api key docs for various providers
* update title
* global _TOKEN settings for github, gitlab and npm (mainly to bump api limits)
* move gitlab api key to headers
* Support multiple groups in feature flags model
This will be part of #3007
I did not do a migration since it would cause errors for decide endpoint
once migrations have run but new schema not up.
* Update analytics_metadata method
* Allow defining multiple groups in frontend
* Allow sorting
* Update tests, allow submit without filters.
* Update cypress
* Avoid N+1 queries
* Indicate filters better in table
* upgrade typegen
* check for upgrades in the interface
* refactor plugin scene files
* separate plugins needing updates
* show an update button
* show progress when checking
* actually update plugins + ux improvements
* open drawer if new required and unfilled field
* better loading for plugins
* fix frontend type error
* fix backend test
* Do tiny cleanup of version labels
* clarify role of custom.d.ts
* cache plugin update status for 30min, refresh update status on page load if stale
* fix tests
* Fix capitalization in updates check button
* fix bad merge
Co-authored-by: Michael Matloka <dev@twixes.com>
* fix sceneLogic and teamLogic
* personLogic one fix
* navigationLogic type
* topContentLogic type
* personalAPIKeysLogic type
* BackTo type
* few other quick wins
* Update blacklist after rebase
Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
* Fix broken session recording case
No strict typescript makes me sad. This property was gone during
refactoring, probably broken due to parallel PRs.
* Make pagination respect filters
* Add model for session recording viewed
* Save view when querying for session recording data
* Send information to FE about whether session has been viewed
* Allow filtering by "recording unseen"
* Rename property
* Update migration
* open drawer if plugin installed but never configured when toggling switch
* ?.
* set initial/unsaved changes when opening plugin drawer
* set "enabled" to true when installing plugin
* use plugin url as key to remove installed plugins from repository, not name
* extra fix
* disallow multiple plugin installations from the same URL
* Highlight rows from sessions which are matched by the filter
* Send start_time of recording to frontend
This helps us calculate offsets a bit better
* Use timestamp by server for date shown
* Load session events via kea logic
* Update rrweb, rrweb-player
* Highlight events user is filtering for in sessions player
* Handle empty case properly
* Add positive test
* Order session recording events in query
* Fix filtering by multiple events with differing names
previously only the first would have been used due to overlapping
params.
* Return all highlighted times as action_filter_times
* Send back ids not timestamps
This avoids weird rounding errors causing issues
* Show skeleton for longer
* update typing
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Upload static cohort using CSV, closes #2868
* fix tests
* Fix tests
* Fix e2e test
* Avoid double inserts
* Speed up query
* Move to params
* fix tests
* Use JSON instead of protobuf
* unused import
* produce instead of produce_proto
* Insert directly into clickhouse, no need for kafka
* a few quick fixes
* insert in batch to clickhouse
* test SQLi since we can't really trust what we are inserting
* Extra check for duplicates
Co-authored-by: James Greenhill <fuziontech@gmail.com>
* Remove (apparently) useless person joins from sessions sql
* WIP: Make sessions list query use python iteration
* WIP: Show loader while session data is loading
* Aggregate together sessions
* Calculate start and end points of session separately
* Remove cruft code
* Load session events asynchronously for self-hosted
Note clickhouse behavior is unchanged.
* Update pagination logic for sessions
In addition to offset, postgres now returns a dict containing person_id,
timestamp which is used to make sure we filter events on different pages
correctly
* Add some tests to SessionListBuilder
* Fix typing errors
* Fix pagination limit
* Move tests to right file
* Query less events for sessions list
Since we're ordering by end_time we know events before last end_time are
all processed.
* Add test for current_url behavior
* Make sure old tests remain working
* Remove unused base class
* Move sessions-related queries to separate subfolder
* Extract sessions list code to separate file(s)
* Sort sessions by end time in ch as well
* List end time in sessions table
* Return person email when querying sessions lists on postgres
This gets used by the view
* Return email over all user properties for sessions in clickhouse and view
* Fix an ordering bug
* Fix a pagination bug
* Fix endpoint
* Fix basic sessions tests for pagination
* Sort consistently for sessions list builder
* Roll pagination into filters
* Refactor adding filtering component
* Fix a type error
* Rename events to entries
This makes much more sense since you can select e.g. actions
* Start of the session filter box
* WIP: Sessions filtering
* Make SelectBox more generic
* Make sessions filtering visuals
* Extract operator value selection code
* Make action properties filterable
* Make it possible to filter by cohorts
* Filtering by events
* Make loading sessions possible with the new logic
* Make it possible to filter by actions/events via backend with new code
Note that it's all relying on old 'paths' - will refactor these later.
* Make it possible to filter by user properties
* Update imports
* Small fixes for sessions filter
* Add UserFilter file
* Ignore extra args to Property
* Make it possile to filter by recording duration
* Update how session duration filter works in the backend
* Rename a few columns
* Remove dead mixins
* Remove duplicated logic, put code behind feature flag
* Move sessions filters logic to subfolder
* Don't show properties if feature flag.
* Add saved filters support
This will require some discussion with Paolo - probably want to show
this on the side?
* Add divider before sessions table
* Narrower typing for recordings
* Some frontend for saving filters
* Small rename
* Add SessionsFilter model
* Save filter on backend
* add missing filter
* Extract const
* Make ActionFilterDropdown be able to pick actions again.
* Fix links from person modal to sessions
* Update tests.
* Fix database model
* Use proper deep equal for detecting active filter
* Remove unneeded field
* Only return filters from correct page
* Add missing data-attr
* Add instrumentation
* rename component
* Fix analytics metadata
* 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>