* Refactor plugin installation and reloading logic
* Preinstall and autoenable plugins (only GeoIP one for now)
* Fix PluginManager.install issues
* Add tests
* Disable plugin preinstallation on Cloud
* Check plugins access level before preinstallation
* Rename field `preinstalled` to `is_preinstalled`
* Adjust tests for Cloud v. self-hosted
* Fix test_preinstalled_are_autoenabled
* Ensure install plugins access level for preinstallation tests
* Bump migration
* Bump migration
* Add and use Plugin.get_default_config, with tests
* Refactor private PluginConfigSerializer methods out of the class
* Skip preinstallation of plugin if it couldn't be done (e.g. airgapped)
* Don't hit GitHub API in tests
* Satisfy mypy
* Fix a test on Cloud CI
* Revert "Revert "Increase Element model varchar limits (#3912)" (#3923)"
This reverts commit e30681bade.
* Use RunSQL to avoid ORM crap
* Fix attr_class being converted from varchar[] to varchar
* Bump migration
* Simplify migration and remove attr_class alter due to locking
* Bump migration
Error:
```
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0147_fix_stickiness_dashboard_items, 0147_plugin_logs in posthog).
To fix them run 'python manage.py makemigrations --merge'
```
* migration to add delayed jobs to sync team event properties
* remove .delay
* update latest migrations
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* remove event & properties endpoint from team endpoint
* event definition model
* sync events from Team with EventDefinition
* fix typing
* missing commit
* event definition API
* add querying capabilities
* property definition model
* sync property definitions
* temp: bring back event properties to Team model to split PR
* PropertyDefinition API + tests
* fix tests for Python 3.7 & more deprecation notices
* default values to 0 instead of null
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* initial refactor
* simple serializer for teams
* basic team in front-end
* use basicTeam where applicable
* refactor UserSerializer to UserBasicSerializer
* abstract UserBasicSerializer
* add uuid to users
* move event properties methods to Team model
* basic V2 user endpoint
* update current user
* update current team and org
* post-merge fix
* fix load logic
* change password
* add some extra tests
* undo all frontend changes from this PR
* remove last frontend change
* update preflight tests
* remove team basic fetch
* fix foss tests
* adjust migration & add distinct ID to payload
* add deprecation notice
* add uuid to UserBasic serializer & update memberships
* add available features to org serializer
* address feedback
* endpoint -> `users/@me/`
* address feedback
* Use UUIDClassicModel abstract model when adding uuid field
Co-authored-by: Michael Matloka <dev@twixes.com>
* add `important_data_attributes`
* fix undefined bug
* important data attributes in setup
* add dashes
* remove dead code
* scarier exampe
* support multiple data attributes in the toolbar
* update to simmer that supports wildcards
* rename "important_data_attributes" -> "data_attributes", store as a json array
* update ts blacklist
* another one
* use a tag select for data attributes
* remove needless string serialization
* implement text feedback
* data attribute setup style improvement
* better default handling
* fix out of sync migration
* 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
* Disable useless InsecureRequestWarning
* Disallow ASYNC_EVENT_ACTION_MAPPING on CH and make it default otherwise
* Return early from calculate_actions_from_last_calculation if CH
* Optimize Action.calculate_events and fire hooks from it
* Run calculate_event_action_mappings every 30 s instead of 5 min
* Optimize post_event_to_webhook thanks to new actions approach
* Add Event.site_url field for reworked Postgres webhooks
* Adjust tests by using sync calls to actions calculation
* Update calculate_action.py
* Use assertEntityResponseEqual more
* Update test_capture_new_person for Cloud
* Don't async calculate actions that haven't finished last calculation
* Fix is_calculating condition place
* Improve calculate_actions_from_last_calculation logging
* Clean up event_query, params
* Fix .only usage
* Update migration
* 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>
* 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
* Add team filter to cohort query to speed up
* Fix querying
* Remove emails from CSV upload
* fix clickhouse email
* Add person email index
* back to concurrent
* Make PluginConfig.order mandatory
* upgrade plugin server to 0.6.10
* black
* Ensure no PluginConfig.order collission
* Clean up PluginConfig API
* Revert "Ensure no PluginConfig.order collission"
This reverts commit d8b2c907e4.
* Black
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* 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
* 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
* 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>
* 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
* Event must be a string
* test that event can't be a dict
* convert dicts and other unknown event names to strings
* mypy
* update packages to have mypy working with python 3.9
* fix event name sanitization types
* fix misc type error from mypy/django-stubs update
* fix other type errors from mypy/django-stubs update
* add migration to update events for users if there's weird data in team.event_names
* ignore type to fix mypy issue
* fix migrations
* 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>
* 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
* Fix unix-dgram build
* Add per-organization whitelisting of plugins API on Cloud
* Add migration
* Update can_install_plugins_via_api calls in serializer
* Remove unused type: ignore
* Update PluginSerializer for organization_id
* Make Plugin.organization nullable
* Fix can_install_plugins_via_api
* Update pluginsLogic.ts
* Adjust can_configure_plugins_via_api for organization
* Don't include organization_id in serializer
* Set default Plugin.organization to first Organization in instance
* Fix PluginConfigSerializer.create
* Test that other orgs' plugins can't be accessed (as if they didn't exist, 404)
* fix typo
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* fix tsc error
* add plugin source, create plugin source version model, add plugin_type
* can create and save source plugins via the api
* make empty source plugins
* message if no config options available
* different image or tag for source plugins
* fix some types
* second drawer
* add fields into drawer
* add monaco editor
* refactor drawer
* save plugin and must be json
* close tab on save
* fix default code
* upgrade to plugin server 0.5.0 - with scheduled plugins
* less height
* upgrade to plugin server 0.5.1 - with posthog.capture
* remove minimap from editor
* upgrade to 0.5.1
* use enum
* reduce quirk
* must enter a name/url
* use the source
* simpler text
* sync image
* add link to docs
* add a link to the documentation inside the source code drawer
* text / ux simplifications
* nicer first plugin experience
* nicer django model choices