* refetch insight if id changes
* current project also ingested event
* upgrade kea and loaders
* do not load if sceneLogic is not mounted
* add test for url sync
* don't load results from the API if none in the insight
* avoid extra queries
* avoid loading the results twice
* update kea-loaders to get payload in async actions
* have apiURL without the `/`
* link to flag in posthog
* add bold external link icon
* add external link icon to the end of the row
* import from urls.ts
* wrap feature flag key and description in a typography text block so that it copes with very long values better
* wrap feature flag key and description in a typography text block so that it copes with very long values better
* add manual word-breaks in long feature flag keys
* just a bit less
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* wip
* moves processing of personheaders out of the react component and into a logic
* generates personheader key and persondisplay when props change
* change personheader so the generated HTML better matches previous state for anonymous people
* remove console logging that shouldn't have been included
* add props to the name of the props
* add props to the name of the props
* don't guard against having no props
* hash the person header key
* inline two methods
* instrument changes
* don't send more info if filters don't change
* use selectors with previousState to get the last filters
* return previous state and track deeper changes with entities
* typos
* remove unneeded
* move function
* tests
* add logic test
Co-authored-by: Marius Andra <marius.andra@gmail.com>
* Add `slug` fields to `Organization` and `Team`
* Expose slugs to user
* Add slug autogeneration for new orgs/projects
* Improve slug UX
* Remove slug from settings
* Update org/team instance creation plus add tests
* Only require project slug to be unique for org, not globally
* Fix `get_prep_value`
* Test organization slugification
* Deslugify `Team`
* Clean up changes
* Update test_user.py
* Apply suggestions from code review
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Random 4 letter suffixes for the win
* Fix import
* Ignore `test_migrations_are_null`
* Fix `RunSQL` query being empty
* Fix `generate_random_short_suffix` testing
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* chore(correlation): funnel story with correlation events and properties
This commit:
1. adds msw so we can easily mock the API requests
2. starts msw on storybook page load
3. adds the `mockServiceWorker.js` to storybook public folder so it can
be loaded by the frontend
4. adds a Funnel story that defines the funnel and correlation
responses
Note that we also define types for requests and responses. These could
be shared with the actual application code, so we can explicitly couple
the application changes to updating storybooks, i.e. to help avoid
stories going stale.
The requests and responses are quite basic, but they are sufficient to
be able to easily see and make changes. It has a requirement that it
should be easy for anyone else who comes to the code to easily parse and
be able to make updates. We don't want these to be rotten stories but
*the place* that people go to first when making their changes.
Having simple handwritten request/responses also introduces the
stability needed to, for example, use regression tests. Changes are
deliberate.
* refactor(storybook): move funnel stories to their own file
This also does quite a bit of cleaning up of the storybook and funnel
story code. Trying to come down on an acceptable way to manage the
sample data.
* dev(storybook): specify public dir when building storybook
I'm hoping this means that chromatic will function properly 🙏
* chore: add back the withApi decorator
* setup msw first
* dev(storybook): Make posthogjs work in chromatic
* dont use as cast for response types
* make hot module reload work
* feat(correlation): add warning when funnel skewed
This actual just uses the funnel numbers rather than the correlation
endpoint as this gives us a little more freedom to, for instance, add
details of why we think there might be inaccurate results, without
having to update the definition in the backend as well.
And alternative option might be to introduce an error code along with a
human readable message that includes the details of skew reasoning,
returned from the API, but I think this gives us what we want.
* Create FunnelCorrelation.tsx, add useMemo
* don't add a logic for funnel correlation
I tried to add one, but got caught in typing issues. I'm not sure adding
isSkewed warrants one tbh
* Move isSkewed to funnelLogic
* allow for horizontal scrolling on paths viz
* wip
* add axis lines
* move more paths util functions over
* do not shorten urls without parameters
* show hidden path cards on link hover
* convert file to typescript
* small fixes and prettier
* es lint fixes
* more typing fixes
* typing
* final fix
* fix bug where session recording is split by new distinct_id
* fix query bug to allow distinct_id clause
* Basic query filtering by events on clickhouse
* add duration filtering
* Add multiple action/event filters
* Move to using person_id + optimize query
* add postgres support and querying on person_id
* move back to distinct_ids
* remove lots of duplicated logic
* Add pagination to backend
* Pagination
* Add duration and date filter
* Use person header is list view
* type fixes
* bug fix
* bugs and tests
* test fixes
* style filters
* logic tests
* Add another test for team leakage
* fix flaky test
* UX changes
* UX tweaks
* auto focus filter box on open
* add test for recording viewed change
* move duration filter to using a tested logic
* move to clsx
* add debounce breakpoint
* Small style change
* fix debounce
* fix breakpoint
* move test to defaultAPIMocks (merging changes)
* react to url change
* kea test "toNotHaveDispatchedActions"
* fix dashboard logic test
* add props and key to insight logic (has no effect)
* inform about is_sample's uniqueness
* use common InsightLogicProps
* persist state via BindLogic and shared insightProps
* persist hashParams
* remove cached Urls
* upgrade new to saved logic
* upgrade typegen
* patch metadata logic
* always show title if saved insights active
* fix negative bug
* fix interval filter
* go to view mode after saving
* full reload when going from dashboard to insight
* use clean filter
* createInsight is no longer used
* fix tests
* fix setAllFilters
* clean retention table duplicate code, fix test
* scene has its own key
* unify insightLogicProps key logic
* consolidate logic fetching
* fix test
* fix reloads
* clears the scene funnel
* move setInsight to reducer
* stronger clicks on menu items
* rename setAllFilters to setFilters, add tests to make sure insight logics use it to sync filters
* fix retention type filter key
* easier printActions
* add failing tests
* unified and broken cleanFilters
* refactor funnel filter cleaning, fix initial event setting,
* fix type
* revert setFilters override, fix filter function
* untangle FunnelStepReference
* move setFilters away from trendsLogic
* fix various type errors
* set filteres inside insightLogic
* set funnel state via insightLogic
* more random changes
* trends working with results in insightLogic
* remove setCachedResults
* move loadResults into insightLogic
* fix trendlogic test
* fetch insight if no fetched data
* fix metrics chart
* fix insight update logic
* consolidate tests
* only load results if needed
* various fixes
* remove wait
* remove activeView
* merge results after updating filters
* don't switch to view mode after saving insight
* don't override results
* misc undefined fixes
* move props down
* cleaner code
* consolidate API mocks
* fix funnel test
* persist some filters when changing tabs
* connect last badly connected funnelLogic
* fetch results if none returned with insight
* show only the right results
* fix paths selector
* match filters and results
* cleanFilters resets fields if switching tabs
* change type insight display if changing tabs
* don't show data if loaded a different type of insight, reload if switching to funnels
* clean filters for history view
* fix trends visibility map
* reset funnel type to VIZ
* fix funnel min height issue on scene
* kea test "toNotHaveDispatchedActions"
* fix dashboard logic test
* add props and key to insight logic (has no effect)
* inform about is_sample's uniqueness
* use common InsightLogicProps
* persist state via BindLogic and shared insightProps
* persist hashParams
* remove cached Urls
* upgrade new to saved logic
* upgrade typegen
* patch metadata logic
* always show title if saved insights active
* fix negative bug
* fix interval filter
* go to view mode after saving
* full reload when going from dashboard to insight
* use clean filter
* createInsight is no longer used
* fix tests
* fix setAllFilters
* clean retention table duplicate code, fix test
* scene has its own key
* unify insightLogicProps key logic
* consolidate logic fetching
* fix test
* fix reloads
* clears the scene funnel
* move setInsight to reducer
* stronger clicks on menu items
* remove wait
* clarify testcases
* node highlighting for path start and end
* rename for clarity
* check for funnel paths between steps
* clean up renderPaths function
* move tooltip placement
* forgot to commit util file
* adds a detection method that isn't flummoxed by the shadow dom
* guard against not having a result for path from older browsers
* guard against the event target returned by composePath not being an html element
* composePath is the standard, check it first
* paths related UI fixes
* add tooltip for long urls
* more fixes
* show cards on hover for smaller paths
* styling and font fixes
* increase font weight
* clean up code
* highlight start and end paths on hover
* undo path start end highlight
* add logic for highlighting all sources
* add centering and move constant
* restore number to normal
Co-authored-by: eric <eeoneric@gmail.com>