0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
Commit Graph

1856 Commits

Author SHA1 Message Date
Marius Andra
72da684f8a
extract kea-test-utils (#6425) 2021-10-14 17:17:42 +00:00
Karl-Aksel Puulmann
fa9d8cacdc
Sort dashboards alphabetically in dropdown (#6441)
Closes https://github.com/PostHog/posthog/issues/6434

Turns out we sort, but also include information on pinned/not pinned
which is not visible in the modal
2021-10-14 20:14:39 +03:00
Eric Duong
e7b7c18ded
make sure to remove shown_as when switching to trends from stickiness (#6443) 2021-10-14 16:26:23 +00:00
Paolo D'Amico
9041e919b2
Remove Home page experiment (#6410)
* remove FF

* remove home page
2021-10-14 08:25:50 -07:00
Michael Matloka
77621366de
Fix remaining TypeScript errors (#6436)
* Fix remaining TS errors and remove `.ts-strict-blacklist`

* Move `IGNORED_SPECS` to top
2021-10-14 15:08:42 +00:00
Marius Andra
d1caefb606
Refetch insight if id changes (#6368)
* 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
2021-10-14 14:58:17 +00:00
Marius Andra
fc66fc953e
remove all dashboard animations in view mode (#6426) 2021-10-14 15:51:27 +01:00
Marius Andra
7d47c5ef36
Feature flag toolbar link (#6369)
* 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
2021-10-14 13:01:36 +02:00
Paul D'Ambra
63d8af06b6
allow annotations when comparing with previous (#6424) 2021-10-14 12:56:27 +02:00
Paul D'Ambra
ffa8aa98db
Better display of Feature flags table with long key and description (#6408)
* 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>
2021-10-14 11:02:52 +02:00
Marius Andra
6b5eaedd64
fix hash in test (#6423) 2021-10-14 08:44:37 +00:00
Paul D'Ambra
3a899e5743
Show user hash in events table for identified users with only distinct ids (#6403)
* 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
2021-10-14 10:26:59 +02:00
Paolo D'Amico
378ff2efc3
Release ingestion help button (#6411)
* remove ingestion help button

* and feature flag
2021-10-13 14:56:15 -07:00
Rick Marron
853f71f731
remove session recording retention from self-hosted clickhouse (#6417) 2021-10-13 13:38:10 -07:00
Li Yi Yu
dc39a90f2f
remove ingestion taxonomy feature flag (#6412) 2021-10-13 16:20:54 -04:00
Eric Duong
e75a433b90
instrumentation: track which filters change (#6342)
* 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>
2021-10-13 09:57:17 -04:00
Michael Matloka
ec0f7ef880
Add slug field to Organization (#6395)
* 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>
2021-10-13 14:09:40 +02:00
Neil Kakkar
2aa9b92f37
Add Sigma Analysis to funnel table (#6385)
* Add sigma analysis features

* update null results to ensure we are always in window

* forgot to push new test file
2021-10-13 13:02:52 +01:00
Harry Waye
b5b1ccb1de
chore(taxonomic-filter): add storybook story (#6398) 2021-10-13 11:22:14 +01:00
Harry Waye
88262c0e05
chore(correlation): funnel story with correlation events and properties (#6389)
* 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
2021-10-13 04:45:51 +00:00
Li Yi Yu
80d90a7385
Fix white screening from paths filter exclusion dropdown (#6390)
* fix white screening from filter exclusion paths

* account for multiple values in the array oops
2021-10-12 13:41:22 -04:00
Marius Andra
f7ae840178
rename "Explore" to "New Insight" (#6387) 2021-10-12 16:30:11 +02:00
Harry Waye
3e9322843f
feat(correlation): add warning when funnel skewed (#6365)
* 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
2021-10-12 13:05:17 +01:00
Marius Andra
b19a6be9a8
Split 'urls' out of 'sceneLogic.ts' (#6381) 2021-10-12 12:11:39 +02:00
Marius Andra
da8e70a15d
loadResults doesn't only load funnel results, bail if so (#6367) 2021-10-12 09:35:14 +03:00
Rick Marron
5b582b314f
Recording filters are stored in URL (#6370)
* fix loading state

* store session recording filters in URL
2021-10-12 08:08:25 +02:00
Michael Matloka
d867472409
Remove PROJECT_BASED_PERMISSIONING feature flag (#6366) 2021-10-12 07:44:01 +03:00
Li Yi Yu
c0d7f1e17d
Paths Viz: horizontal scroll, path card item display on link hover, adding typing (#6323)
* 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
2021-10-11 20:30:25 -04:00
Rick Marron
63d127df13
Filter session recordings (#6162)
* 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
2021-10-11 13:15:05 -07:00
Marius Andra
eda638a3b4
Insight logic refactor version 2 - unified filters (#6327)
* 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
2021-10-11 16:26:15 +02:00
Harry Waye
6bc3a80dca
fix(correlation): property success/failure should update property correlation type (#6336) 2021-10-11 09:52:04 +00:00
Marius Andra
098aa91fa4
Revert #4206 - Test Environment toggle (#6250)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-10-11 10:28:07 +03:00
Paolo D'Amico
fc9fad76e0
Recordings tweaks (#6322)
Co-authored-by: Rick Marron <rcmarron@gmail.com>
2021-10-11 09:17:44 +03:00
Karl-Aksel Puulmann
4acae13312
No more unneeded scroll bars (#6326) 2021-10-09 10:30:44 +02:00
Eric Duong
b9927713ee
fix refreshing, fix insightLogic props passing, fix funnel bar leakover (#6340) 2021-10-08 14:14:29 -04:00
Harry Waye
eb4082241f
feat(correlation): add property correlation to funnels UI (#6328) 2021-10-08 16:31:02 +03:00
Marius Andra
00633412cc
Insight logic refactor version 1 - keyed insightLogic (#6310)
* 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
2021-10-08 12:13:23 +00:00
Li Yi Yu
cd5e164d91
Paths highlighting for path start and end (#6297)
* 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
2021-10-07 20:22:54 -04:00
Eric Duong
cdfab3d821
paths: Default params funnel and prompt (#6317)
* add pageview and cusotm events as default types

* add prompt
2021-10-07 18:11:18 -04:00
Neil Kakkar
e062d5113f
add CH guard to Correlation API Calls (#6315) 2021-10-07 19:00:48 +01:00
Alex Gyujin Kim
970e2892b0
Remove saved funnels (#6313)
* follow up on todo

* ff
2021-10-07 09:55:54 -07:00
Marius Andra
f2c9c522bf
Remove scrollbar (#6304)
* remove scrollbar

* revert list height to 32px
2021-10-07 08:21:10 +00:00
Marcus Hyett (PostHog)
3520b553a4
Colon in Dashboard Name Search (#6291)
* Added colon in Go To dashboard search

* Moved colon to correct place
2021-10-07 09:44:14 +02:00
Michael Matloka
96760e0096
Reduce direct usage of user.team (#6206)
* Reduce direct usage of `user.team`

* Add missing `.id`

* Remove unused `type: ignore`s

* Fix typing issue

* Remove selector circular dependency between `userLogic` and `teamLogic`

* Try to simplify things to fix circular dependency

* Remove extraneous typing
2021-10-07 09:33:37 +02:00
Paul D'Ambra
73de6cd9fd
Adds a hot key keypress detection method that isn't flummoxed by the shadow DOM (#6249)
* 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
2021-10-07 09:12:49 +02:00
Paolo D'Amico
9d4287c1c4
Clarify copy on data point click (#6255) 2021-10-07 08:08:27 +03:00
Alex Gyujin Kim
04045ff466
Add default count_operator thats already selected on changing match type (#6295) 2021-10-06 13:55:19 -07:00
Neil Kakkar
d4a1151c49
Path Wildcards in Taxonomic Filter (#6205)
* Path Wildcards in Taxonomic Filter

* better handling

* ADD LOGIC TEST
2021-10-06 16:06:52 -04:00
Li Yi Yu
cb3b394633
Paths related UI fixes (#6257)
* 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>
2021-10-06 15:37:04 -04:00
Neil Kakkar
750116101a
fix (#6290) 2021-10-06 11:57:53 -04:00