* report from dashboard on insight viewed
* report person modal
* abstract filter sanitization and report cohort creation
* report insight viewed after 10s
* change to insight analyzed
* add popover to calculate funnels
* wrong prop
* remove local state
* hide people table if not valid filter
* more accurate comparison
* dirty state alert
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* pass in funnel_step_breakdown param for persons modal
* add comment
* allow clicking on drop off part of the funnel bar
* fix funnel persons modal titling
* small fixes
* ellipses man
* add FunnelStepTable with titles
* Finish v1 of table
* hide some info on step 0
* visibility toggles per breakdown in table
* breakdown visibility toggles affect graph
* clean up types and dedupe rowKeys
* clean up styling of leftmost column
* address changes
* use memoized values in bar chart
* fix table overflow styling
* fix persons modal; show only when steps > 1
* show only on Steps view
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* get default event name directly from django
* default event name in the backend
* fix "~/" urls in jest tests
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* count display update
* do not reload list of people when loading more people
* Revert "do not reload list of people when loading more people"
This reverts commit eb9ef11690.
* fix flag
* separate initial loading state
* update title with "+", fix person/persons
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* funnel trends is clickhouse only
* don't show graph type if there's only one option
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* fix funnel reload bug with changed filters
* remove the type so we could autocomplete feature flag strings
* hide breakdown from time & trends graphs, remove the param when switching to them for safety
* positive check
* clarify arg name
* remove needless flag
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* handle persons modal navigation better
* clean up excess pesronModal actions/values, move people to loader
* fix person modal not opening on funnels
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* steps with breakdown is already validated
* finally make dashboards render 🙌
* abstract new funnels from FunnelViz component
* refactor basic styles
* post-merge fix
* fix text overflow in event name
* funnels base UI on dashboard
* disable bar tooltip on dashboard
* Revert "disable bar tooltip on dashboard"
This reverts commit 4ba814ff2e.
* fix auto height on dashboards
* colored dashboards support
* full color support
* set layout as a filter param
* save funnel layout on backend
* proper scrolling in dashboards
* restore average conversion time
* only one layout for histograms
* fix bar graph margin that's causing a scrollbar
* fix person modal not opening on funnels
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* various time conversion bugs
* pass real network "Error"s to endQuery in order to show an error on 500
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* Fix:Funnel drop off user list title is confusing (/buggy?)
* Handle Negative Step
* Conditionally Render The String
* Update frontend/src/scenes/funnels/funnelLogic.ts
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* prettier
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* funnel trends persons call
* hide nonfunctioning funnel graph display options
* undo date year conversion
* avoid forced typing
* clean up and add comment
* use funnel_viz_type param for funnel graphs
* fix funnel_viz_type param router replacement bug
* fix types and potential display param bug
* funnel trends should not be an option for non-clickhouse
* reuse existing filters
* patch white screen death bug
* type predicate
* undo prettier
* add all steps option
* all steps working; add total and mean time to convert
* change display type checks to use enum
* kea types
* dangling console log
* Add average conversion time to time to convert results
* respond to feedabck
* responsive histogram sizes
* merged @Twixes backend changes; adjust data shape on frontend; add responsiveness to histogram
* add tooltip label
* adjust copy and tooltip
* minor tweaks
* respond to general feedback
* kea auto
* better empty state:
* error handling null time bins
* fix tests
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* init TaxonomicPropertyFilter based on Tabbed variant
* InfiniteSelectResults
* infinite loader state mgmt
* set local state on select
* set by name, not id
* list and filter static values
* value search & loading anim
* allow selecting operator and value
* add cohorts support - WIP
* Fix cohort select
* default by opening to the correct tab
* extract feature flag
* add pagekey to taxonomic filter logic
* remove use of local state in taxon filter
* create keyed infiniteSelectResultsLogic
* not working: loading logic; need breakpoints and return Promise
* address minor changes
* move files to own folder
* TaxonomicPropertyFilter now controls activeTabKey
* wip: Load next chunk of results when list renders
* change pageKeys
* load initial results on mount
* set breakpoint and overscan count
* add a nextOffset state value rather than breakpt
* preserve scroll pos
* allow loading at arbitrary scroll positions
* styling
* minor cleanup
* wip: limit and offset via list accessors
* do a silly little array slice
* separate endpoint for paginated results
* use Fuse for static lists
* wip: tab titles
* counts update on search for both local and async properties
* revert changes to person.py
* minor improvements
* refactor taxonomic property filter logic WIP
* fix bugs, add search queries
* fix key error
* also show local items
* show counts
* add operator value select
* local search with fuse
* get rid of tabKey, select active tab based on filter
* various cleanup
* add simple api cache
* hide property popover -> make the popup usable
* create filter dropdown
* "add filter"
* show the right cohort
* better handling for when the filter is already in a popup
* move up/down
* keyboard up/down navigation
* select on enter
* preselect selected item, fix focus jank
* autofocus on other dropdowns as well
* improve style and refactor util
* fix dumb bug
* show cohorts full screen
* fix filter alignment, type and placeholder
* filter position and responsiveness
* reduce dependence on antd, fix various layout bugs
* fix responsiveness
* tooltip position
* pass on onComplete
* hide tooltip if switching tab
* search property filters also in EE
* add type, fix typegen write loop
* Minor copy adjustment
You're actually searching all at once
* fix outside click handler
* popups with popper
* add ant-select as exception for popup outside clicks
* simplify deps
* always highlight the first item
* use new popup with taxonomic filter
* fix PropertyFilterButton ref
* clear search on select
* placeholder for value input box
* add empty state
* only open filter downwards
* move listTooltip postition into useState
* list tooltip position after opening and resize events
Co-authored-by: Sam Winslow <sammywinslow@gmail.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Move old funnel people to TS and fix look
* Restore `EntityFilterProps`
* Improve `People` return code readability
* Include People component deprecation notice
* don't end query if failed if new one came in already
* adjust breakpoints and end the query in the end
* abort trends fetch queries
* smaller delay
* fix entityFilter blinking bug and improve types
* new typegen
* remove second source of truth, change value to 300
* improve type accuracy
* log aborted queries
* report aborts in trendsLogic
* consolidate ViewType into types.ts
* one more
* and one more
* add d3 histogram
* different layouts and fine tuning d3 histogram
* spacing math and comments
* row-align steps action dropdown and refactor
* cleanup
* hide time conversion behind ch flag and remove layout toggle
* remove animation and layout toggle
* better app-wide empty states and funnels histogram empty state
* revert fat finger
* erroneous type
* empty state comments
* add d3 histogram
* different layouts and fine tuning d3 histogram
* spacing math and comments
* row-align steps action dropdown and refactor
* cleanup
* hide time conversion behind ch flag and remove layout toggle
* remove animation and layout toggle
* revert fat finger
* erroneous type
* move persons modal logic out of trends
* refactor long action params
* pass filters through actions to decouple trendsLogic from personsModalLogic
* no longer need to preload trendsLogic
* move people loading to persons modal logic
* potential cohort logic id error fix
* Latest browser’s versions and statistics
* Browserlists - Use "defaults" browser support
* Enable Babel polyfills based on usage
* Revert "Polyfill Object.fromEntries (for Safari <= 12) (#4999)"
This reverts commit ad63386a69.
* Different browser support for dev/prod for build performance
* wip
* Add support for plugin config required_if and visibile_if
* update form rules
* update key check
* move from OR to AND operation on deps array
* update scaffold
* Load session events asynchronously from a separate endpoint
This mirrors the behavior of postgres query
* Simplify backend & query
event_count is unused
don't select unused columns in list query
* Rename filter_by_session_recordings to filter_by_session_recordings
This is more in-line with what the function actually does
* Update types, handle start/end url properly
* start_url / end_url to session result
* Update sessions list builder tests
* Remove some `session.events` references
* Remove unneeded code
* Simplify filteredSessions
* Fix type issue
* Add test for session properties
* Test and fix start_url/end_url
* Add test for the new sessions API endpoint
* Improve types
* Update py types again
* Fix bug
* Load action event count asynchronously
This speeds up loading/editing events quite a bit on clickhouse.
Issue: https://github.com/PostHog/posthog/issues/4802
* Add test for /api/action/{id}/count endpoint
* Update code
* connect funnel persons to the frontend
* fixes
* simplify feature flag call and open persons modal on bar click
* persons dropoff call
* move methods to kea and clean up code
* remove unused imports
* round the percentage down
* pass in correct step number
* type fix
* small fixes
* prettier
* clickhouse enabled check
* fix clickhouse enabled check
Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
* connect funnel persons to the frontend
* fixes
* simplify feature flag call and open persons modal on bar click
* persons dropoff call
* move methods to kea and clean up code
* remove unused imports
* round the percentage down
* pass in correct step number
* type fix
* small fixes
* prettier
* clickhouse enabled check
Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
* Display empty values correctly
* fix broken test and I
* handle more cases of empty strings / objects
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* fix when new steps in the url get merged with old steps from values (new steps contain actions, old events)
* set default event in funnels
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* open person link in new tab
* set up filtering for person modal
* leave basic search with fuse
* allow for property filtering
* clean up UI
* linter
* replace fuse with backend querying because of pagination issues
* lint
* cohort test failure fix
* prettier
* fix bug
* do not open new persons tab
* return unique persons
* reuse filter request method for persons modal search
* fix test and linter failures
* isort
* feature flag it
* don't disappoint mypy
* try to separate persons modal logic
* cleanup component and logic code
* try to make types happy
* more type fixing
* fix count bug
* more fixes
* type with session string instead of string
* sanitize url param
* add or session back
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* manual types for kea-router no longer needed
* update packages
* remove needless complication that is done inside cleanFunnelParams anyway
* no longer needed
* update typegen again
* fix indentation
* add FunnelBarViz to enum & ChartFilter dropdown
* Convert FunnelViz to TS && add custom d.ts for FunnelGraph
* type funnelLogic
* some type coercion
* Case-switch to selectively run buildChart
* add FunnelBarGraph: show bars & icons
* Dynamically position percentage label
* Fix NaNs and wrapper sizing
* show dropoff data in footer
* TEMP: disable inspector click-through buttons since logic not ready
* add entry to DashboardItem
* cleanup && fix useEffect dependency array
* useResizeObserver custom hook
* line between funnel steps
* flag for viz: `4535-funnel-bar-viz`
* correct some FF logic
* bugfix switching from Trends -> Steps
* address changes
* cleanup; humanize duration & show on first step
* remove legacy vertical tabs
* remove a bunch of more legacy code
* remove crosshair from lifecycle chart
* bring back changes from #4845
* fix trends tests
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* fix multiple table bugs and standardize table overflows
* support more es2019 functions like Object.fromEntries
* simplify getting active breakout value
* unset maxWidth for resizable cols by default
* fix feature flag key cutoff and empty description bug
* ellipsify feature flag table
* labels or dates or days
* fix bugs; refactor table scroll
* fix double key and increase the width just a bit
Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Sam Winslow <sammywinslow@gmail.com>
* wrap css classnames and allow for property definition filtering
* event properties section
* properties stats table and object tag functionality
* property descriptions and save all descriptions button
* fix description editing on the table
* fix test failures
* debouncing input is weird
* split up components
* refactor definition drawer kea file
* drawer should only open for taxonomy feature users
* lint errors
* prettier
* property definition filter backend test
* fix test
* populate test with definitions..
* clean up
* clean up property drawer interactions
* fix everything but scroll top issue
* test scroll issue
* table state wip
* update logic after typegen
* prevent undefined error
* only make the clickable rows clickable, not the entire table
* upgrade typegen and fix error with feature flags
* move to reducers and rename action
* update blacklist
* fix event properties description bug
* update typegen once more
* fix editing for events table
* fix editing for properties table
* add script to clean typegen
* update ts blacklist
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* few more TS conversions
* type IntervalFilter
* type a few dashboard logics
* add chart display types, fix some others
* fix few types
* fix bug uncovered by TS conversion
* fix regression
* type PropertyFilter
* fix more types
* correct test account filter type
* fix even more types
* fix issue with updateUser type
* fix issue with updateUser type
* fix issue with filters on paths
* extract "isFilledPropertyFilter" method
* few more TS conversions
* type IntervalFilter
* type a few dashboard logics
* add chart display types, fix some others
* fix few types
* fix bug uncovered by TS conversion
* fix regression
* type PropertyFilter
* fix more types
* correct test account filter type
* fix even more types
* fix issue with updateUser type
* fix issue with updateUser type
* few more TS conversions
* type IntervalFilter
* type a few dashboard logics
* add chart display types, fix some others
* fix few types
* fix bug uncovered by TS conversion
* fix regression
* Revert "Revert "[Frontend Change] Funnels API GET -> POST|GET (#4769)" (#4777)"
This reverts commit dab41f0f6a.
* Add POST support to clickhouse funnels
* run funnel tests on clickhouse
* Don't fire webhooks and Zapier in case of PLUGIN_SERVER_ACTION_MATCHING
* Add PLUGIN_SERVER_ACTION_MATCHING to settings
* Add PLUGIN_SERVER_ACTION_MATCHING to ECS task defs
* Remove leftover print
* Update `AsyncActionMappingNotice`
* Remove stale import
* fix a lot of types
* fix another bunch of types
* update typegen to beta, patch last types
* fix introduced bug
* fix a few errors
* update ts blacklist
* adjust tooltip position
* fix crosshair snap
* allow clicking the correct datapoint
* optimize InsightTooltip
* fix no background colors in bar value chart
* fix positioning for bar value chart
* fix display on bar value charts with breakdown
* use custom chart.js
* add slight animation to tooltip position
* use posthog chartjs with "nearestX" mode
* update to a unborked @posthog/chart.js
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* change get to post api
* tests
* fixed bug
* isort
* make funnels endpoint backwards compatible, add test to check this
* descriptive comment
Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro-2.local>
Duration measure/verify a hypothesis - are we seeing some (> 500) errors
due to them taking too long?
Previous full url was useless due to search parameters
* Re-add refresh button, respect refresh in API
Also `internal` dashboard always refreshes all.
How it works under the hood - if refresh param is passed, we call cache
updating code before returning the cached results. This bypasses the
need to fetch data from /api/insight and other endpoints which are not
embedding-aware
Mostly solves https://github.com/PostHog/posthog/issues/3609 and
provides a workaround for https://github.com/PostHog/posthog/issues/4587
* Show "last refresh time" in dashboard.
* Remove individual refresh buttons according to TODO
* Add tests
* mypy fix
* fix UI
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* split up files and organize code
* set up definition drawer and logic and add tagging
* add change owner selection
* definition description editing working
* definition drawer graph and events table
* remove graph logic for now
* small fixes
* property definition doesn't have an owner
* minor tweaks
* lots of small fixes
* show tags on table, disable editing for posthog events, fix tags autocomplete
* fix font sizes and alignment
* allow event limiting and hide behind feature flag again
* linter things
* test fix
* lint
* clean up events limit
* limitOffsetPagination in events
* ignore type
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* simplify cypress nav menu clicks
* clean unused annotations code
* don't blank all cohorts when deleting one
* add data-test-filters-loading to better target loading indicators in tests
* preload user via django
* create django app context
* persist feature flags in localStorage
* add preflight into app context
* return undefined if no context
* keep user as `null`, it'll be overriden before anything renders anyway via `afterMount`
* remove broken and unused user code
* call `registerInstrumentationProps` when preloading `preflight`
* for cypress premium tests: add a search param to opt-out of using the preloaded context, so we could intercept the users api call
* move scene override to sceneLogic to prevent seeing the login screen when logged in
* open the next scene if login has an url
* merge if to avoid bug
* minor comment clarifications
* refactor afterLoginRedirect()
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* added conversion window in days to funnel trends
* convert floats to ints so that the query doesn't break
* use kea breakpoints instead of debouncing lib
* put conversion input behind ee check
* move event and property definitions to models, refactor models to import via component if user present
* rename Logic to Model
* add personPropertiesModel
* refactor sessionFilters to use personPropertiesModel
* remove personProperties from inside propertyFilterLogic and use the model
* break ternary
* fix cohort and feature flag tests (for virutalized lists)
* remove unused export
* better feature flag logic connection
* hide development overlay until CSS loads
* refactor the way feature flags are loaded for the app
* show a spinner only after a second
* type fix
* simplify active scene
* allow copy/pasting from dev bar
* explain why not to use sceneLogic
* rename file to ts
* create appLogic
* clean up empty component
* remove unused path splitting code (`/url1|/url2`)
* add preflight check to App from AppScene
* optimize render performance of graph annotations; squash scroll jump bug
* annotations overflow and dedupe bugs
* naming
* remove @ts-ignore and group by day
* convert annotations to typescript
* fix jest path
* one more fix
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* add description and tag fields to event and property definitions
* set up description and tagging on models
* frontend functionality for description editing
* connect backend and kea logic for description editing
* update event and property definitions model and migration
* delete set null instead of cascade
* migration merge fix
* add owner column
* undo posthog event property taxonomy migrations
* set up definitions on enterprise level
* allow enterprise definitions description editing
* fix licensing conditions and add tests
* proper get and update methods for the multi inheritance table and new column fields for enterprise event model
* check for license to separate routes
* migrate existing definitions to ee definitions tables and render ee vs non-ee definition views based on existing feature conditional
* all the working backend updates
* updated tests
* frontend fixes and linting updates
* feature flag it
* add @posthog/plugin-scaffold type to plugin editor, simplify plugin
* make functions async
* have same config type as config json
* ignore raw-loader ts errors
* remove monaco webpack plugin
* Add example `console.log` to `onEvent`
* Escape backticks inside backticks
Co-authored-by: Michael Matloka <dev@twixes.com>
* Revert "Hotfix SCSS for trend graphs (#4539)"
This reverts commit 545dc62ec6.
* Revert "Move history import to globals (#4531)"
This reverts commit 542be62053.
* Revert "@ import all scss in lib/components (#4530)"
This reverts commit 5e2a3290da.
* fix deduplicated css problem
* update lockfile
* Save Organization.available_features as a DB column
* `update_available_features()` before an organization is created too
* Run the task half past the hour
* Adjust tests and fix available_features sync on start
* Improve action and property TS types
* Use plugin server ActionManager pubsub
* Use better pubsub channel names for plugin server ActionManager
* Fix PubSub's lack of teamId
* Use f-strings for property CH SQL formatting
* Show more things when embedding dashboard for internal purposes
* Show refresh button for /instance/status dashboard
* Allow logged in users to change date range in /instance/status dashboard
Also sets default
Logged in status is checked in a separate Permissions class
* fixing bug
* conslidate breakdown query
* remove clause
* add missing param
* fix name and bracket
* fix tests add none clause
* fix more tests
* more test adjustments
* add person prop filter test
* only use None when offset is 0 (first query)
* add null check and fix api helper
* Send info on insights query timing + route to posthog
This will help with determining the root cause of our problems
* Capture information on "timeouts" correctly
previously every error on insights was reported as a timeout.
* WIP
* Solve typing issues within insightslogic
* WIP part 2
* Add graphs for insight load times
* Add tests for new routes
* PR review iteration
* Make instance_status POST available for all
* Do some cache busting
* Add GitHub style deletion confirmation UI
* Improve edge case handling a bit
* Do #4463 for DeleteProjectModal
Co-authored-by: Joe Saunderson <joe.saunderson@mention-me.com>
* wip: support test_ api key
* Renamed test_environment property to
* Added Prod/Test switch to determine which environment to show data for
* moved environment toggle behind feature flag
* corrected key name to standard $ names
* Moved hidden filters to PropertyKeyInfo for improved clarity
* fix typing
* proposed UI
* Renamed to ; Changed to a string and added environment const types: production, test; Moved into a hidden filter along with environment types for the frontend; Corrected tests to use environment constants; is no longer set by default but only when test_ is supplied in the apiKey or is manually supplied; Moved environment to navigationLogic;
* Added filter for test environments so that when it's enabled all test environments are filtered out
* Remove component if feature flag for test-environment is enabled
* adjust style of tooltip
* adjust UI based on @corywatilo's input
* implemented toggle functionality
* Made Environments an enum for clarity
* Moved environment constants to constants.py for consistency
* Moved Environments into constants for consistency
* Using parameter destructuring for better syntax
* Make sure type is set as a string
* Removed test filters
* Created _clean_token to ensure test_ is removed from all the places
* Bug fixes for adding filter property so that it work properly
* Show test account filter
* ensure token isn't None so that mypy checks pass
* Corrected css selector syntax
* removed quote since it's not needed
* Corrected cypress test by excluding featureFlag usage on shared dashboard scene
* Fixed test
* corrected syntax style issues
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Co-authored-by: Buddy Williams <buddy@Buddys-MacBook-Pro.local>
* Allow getting table schema from clickhouse
This will be useful constructing free-form lists for /instance/status
page
* Show PostgreSQL queries in system status page
* Show table with currently running queries
* Show slow queries from the past 6 hours
* Make collapsible sections optional
This way this page even works for non-clickhouse users
* Remove debug code
* Remove more cols from slow log, handle lists
* Extract const
* Move instance/status api code under viewSet
I will be adding other endpoints, which should live under it rather than
separately
* Fix url
* rename the permission
* use local state until ready to apply changes
* hopefully fix cypress test
* add conditions
* return test
* make logic easier
Co-authored-by: Sam Winslow <sammywinslow@gmail.com>
* Extract function for capture
* Add capability to capture internal metrics
- This is behind an environment variable, we'll turn this on by default
on clickhouse-based installation.
- A special Org/Team gets created for this lazily, which is not accessible for
anyone. This makes avoiding issues with stats/billing/properties and easier.
* Capture some useful metrics into posthog
* Set up an unique constraint for for_internal_metrics organization
This avoids some nasty race conditions
* internal_metrics fixes
* Extract component OverviewTab
* New tabbing system for system status page
* Embed ClickhouseTab
* Generate a dashboard for internal metrics on demand
* More metrics
* Add more internal metrics, add tests
* Fix migration files
* Adjust copy
* Update task definitions
* Fix a typing issue
* Rename a component
* Migration fixup
* Try reset patch after test ends
* Clear lru_cache between tests
* remove wrap on plugin logs table
* Implement a real fix by checking if ResizableTableProps.expandable is set
Co-authored-by: Michael Matloka <dev@twixes.com>