* show locked feature flags on feature flags table
* disable side actions without edit permissions
* add table view for permissions on feature flag
* update permissions editing on new and in edit mode flags
* separate tabs for role access in org settings
* linter fixes
* allow all members to be added to roles
* add expandable row displaying more information
* add info about admins having full edit access always
* link to organization role access settings from feature flag
* Allow creating new team/project with is_demo flag
* make is_demo not read-only
* Give ppl option to create demo proj right away
* Load the demo data if it's a demo project
* Make sure the variable exists
* Add a demo tag next to demo projects in switcher
* Add a darker color to snack
so it shows up on a hovered button
* Swap bookmarklet for 'generating demo data' panel
* Finish getting rid of bookmarklet (test only)
* Show the demo flag in the main nav if Is_demo
* Update permissions to create a new proj if is_demo
and the org doesn't already have a demo proj
* If org already has a demo proj, just go there
* Add DemoProjectButton
* Don't show ingestion details if it's a demo team
* Don't show ingestion flow on demo project
I doubt people will land here, but just in case
I also renamed the ingestionLogic file name since we renamed the
logic itself previously
* Fix a couple ts errors
* Fix and write new pytests
* Don't change test strings
* Add a story for the snack
* Minor fixes
* Don't set completed_snippet_onboarding
just deal with it otherwise
* Remove the demo data option from platforms
* Change CTA to reflect existing demo project
* Only make the first button primary
* Fix ts error
* feat: prevent billing for events in demo projects (#12924)
* Don't include events in a demo proj in billing
* filter demo teams from usage reports
* Fix ts error
* Make sure demo teams actually aren't included
* take a stab at a test for this
* fix test
Co-authored-by: Emanuele Capparelli <k@emkpp.com>
* Enable master project demo data on Cloud too
* Use proper python
Co-authored-by: Michael Matloka <dev@twixes.com>
* Address review suggestions
* Remove color option from ProjectName
It was the same for all uses
Co-authored-by: Emanuele Capparelli <k@emkpp.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
* pre-fill actions tags
* pre-fill insights tags
* add event and event property definitions tags APIs and load them in UI when editing
* extend the definitionEditLogic tests a little
* add a tags endpoint
* remove per item tag api endpoints
* remove more
* start moving to tagsModel
* wiring parts together
* update tags when action is saved
* tag refresh when editing definitions
* initial role and role memberships setup
* create role when org is created and role memberships when user joins
* wip for merge
* fix api tests for role
* nest roles under organization route and test fixes
* remove pdb set trace
* fix types
* remove creating default roles and role memberships for orgs and users
* add permission levels to orgs and roles
* bulk create role memberships
* leave role membership as individual api request, handle bulk creation on the frontend instead
* feature flag role access wip and migrations
* fix flag role access tests
* linter
* isort
* temp type ignore
* add access level to plugin tests
* test remove test migration safe
* test license import error fix
* delete old? org license test
* nvm we need these tests
* type ignore
* reset license plans after test
* add organization resource access model and remove access level field from regular organizations
* feat: permission return on feature flag (#12826)
* suggested permission return
* change naming
* add changes
* pass bool
* fix plugin tests
* organization resource access tests and fixes
* update can edit return with new org resource access model from feature flag
* fix tests
* add permissions to feature flag for editing
* more tests
* remove unnecessary spacing
* fix test
* add context for feature flag serializer tests
* add back workflow test step
* add organization to feature flag role access
* fix(spike): why are tests failing (#12858)
* was it because invalid id is provided?
* allow django to touch the db
* a less unexpected way of allowing access to the DB
* Revert "add organization to feature flag role access"
This reverts commit ef18b0ec8b.
* address feedback and include organization safety checks in tests
* test error fix
* test role dupe name per org
* remove third access level option
* fix migration for it
* more tests
* fix test
* feat: role based permissions UI (#12776)
* add api
* starter
* role and member creation + deletion
* working with all deletes
* add block
* working roles
* permissions tab on org settings
* org default setting
* types
* flag role assignment
* working per flag permission
* working with admin block
* types
* use restricted area component
* wrap flag resource access in different url
* restore migrations manifest
* update url endpoints
* pay gate mini org role settings
* remove view and custom edit and remove resource access creation on org creation
* add feature flag
* address feedback
* fix backend tests
* remove broken permissions setting on new feature flags
* export logic props interface
Co-authored-by: Li Yi Yu <li@posthog.com>
* type fixes
Co-authored-by: Eric Duong <eeoneric@gmail.com>
Co-authored-by: Paul D'Ambra <paul@posthog.com>
* add support for token field in kafka message
* formPipelineEvent
* rename pipeline files according to new order
* wip team_id and anonymize ips
* conditional handlers and tests
* some plugin server fixes
* fix capture bug
* fix
* more fixes
* fix capture tests
* pipeline update
* fix + investigate database resets
* fix import order
* testing and typing updates
* add test for capture endpoint
* testing
* python typing
* plugin server test
* functional test
* fix test
* another fix
* make sure no team ids clash in tests
* fix
* add more metrics and logs
* cache nulls
* updates
* add more metrics
* fix: customer group analytics
* Update snapshots
* customer group analytics when loading user
* fix api mock
* fix snapshot
* Update frontend/src/scenes/billing/v2/billingLogic.ts
Co-authored-by: Ben White <ben@benjackwhite.co.uk>
* fix
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <ben@benjackwhite.co.uk>
* api
* add performed_rollback
* add celery task and tests
* rollback test
* remove first and last
* add sentry stuff
* basic auto rollback UI
* fix errors
* testable
* add errors rollback ui
* clean up sentry keys
* clean up some ui stuff
* add some sentry context
* update ui
* fix celery
* Update posthog/api/feature_flag.py
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* add sentry instructions when not enabled
* add sentry context
* merge migration
* remove unnecessary field right now and update UI to 7 day trailing average
* fix migration
* fix frontend type
* activity
* reset migratioN'
* remove default
* update test
* add feature flag
* add view for conditions and make sure insight loads
* Update snapshots
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Li Yi Yu <li@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
## Problem
Take 2 on [this PR](https://github.com/PostHog/posthog/pull/11993#event-7470261128). The problem is that our rate limits should be based on `team_id` instead of an API key, and the last PR didn't handle views that didn't have a `team_id`.
## Changes
* Moves the rate_limit to be based on the `team_id` when possible
* Handles views that don't have a team_id
* Ensures the enabling/disabling of rate limits applies to all rate_limit classes (it used to only apply to the default classes)
and
* moves enabling the rate limit to an instance setting
* and adds a team id allow list for bypassing the rate limit
* and a simple cache which I think stops us hammering the reading of the infrequently changing settings
👉 *Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review.*
## How did you test this code?
Added tests for the new cases:
* Rate limit works across a team - not just on an individual user.
* Rate limits work on views without a `team_id`
* Disabling the rate limits works
Co-authored-by: Paul D'Ambra <paul@posthog.com>
* fix: dashboard collaboration is required to change dashboard description
* don't change description in tests
* listing dashboards is already nplus1
* check listing is not nplus1 when description is present
* remove nplus1 from sharing config when listing dashboards
* reduce diff
* Update snapshots
* handle optional features better
* Adds missing description test for creating a dashboard
Co-authored-by: pauldambra <pauldambra@users.noreply.github.com>
* first take
* add columns
* replace actions with events
* all actions to events
* attempt to add backend tests
* create merged event_definition and action sql
* rename calculated events to events and events to raw events
* remove all frontend changes
* reformat
* flake
* Revert "remove all frontend changes"
This reverts commit ccae916ed1.
* add action fields
* edge cases
* fossify
* bring where conditions into subquery
* bring order into query
* revert organization
* ci
* fix: remove enterpriseeventdefinition and enterprisepropertydefintion from barrel file to be foss compatible
* unfossify
* imports
* fix imports
* fix tests
* fix wrong test case
* mypy
* fix tests
* fix mypy
* prettify
* fix mounting order of logics
* address feedback and fix action ordering bug
Co-authored-by: eric <eeoneric@gmail.com>