0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
Commit Graph

5926 Commits

Author SHA1 Message Date
Marius Andra
b5a02e2ca7
Bundle our frontend via esbuild (#6758)
* esbuild package

* almost get esbuild working

* fix react-virtualized imports

* add splitting

* fix funny import reorder bug

* fix squeakAudio referring to itself

* write index.html file

* fix some bad imports

* update antd paths

* remove raw-loader usage, it didn't work anyway

* refactor and copy public

* build app and toolbar

* get toolbar working, but without styles

* make toolbar and its styles work

* shared dashboards

* clean frontend build before rebuilding

* add watch mode

* reorder tasks

* revert js url

* incremental builds of app with debounced chokidar watching

* common build/watch script

* improve logs

* watch during firrst build

* fix toolbar url

* fix wrongly exported scene

* create sceneProxyLogic to untangle sceneLogic from all bundles

* disconnect sceneLogic and refactor setPageTitle

* live reloading server

* rename utils file

* only wait for /static

* fix encoding

* simplify

* add missing dayjs plugins

* fix pathless logics

* simplify options

* add jsx for webapck

* slight delay to catch changes

* a type is a type

* fix build

* esbuild in start

* funnelLogic path

* include all files with a "." (so .mjs, etc) in /frontend/ to docker

* rename to "utils.mjs", make "build.mjs" executable

* improve erroring

* revert some needless changes

* more reverts

* change some scripts

* remove setuff

* clarify function

* make "--host 0.0.0.0" work

* fix import order issue in webpack

* remove webpack css inlining for toolbar to simplify config

* make toolbar with external styles work in storybook

* move live server injection into django

* fix undefined bug

* simplify setup to work with injection directly in http://localhost:8000 (no proxying needed on :8234)

* add comments

* Fix `fse` usage

I was getting this otherwise:

$ node frontend/build.mjs
file:///Users/twixes/Developer/posthog/frontend/utils.mjs:46
    fse.copySync(srcDir, destDir, { overwrite: true }, function (err) {
        ^

TypeError: fse.copySync is not a function
    at copyPublicFolder (file:///Users/twixes/Developer/posthog/frontend/utils.mjs:46:9)
    at file:///Users/twixes/Developer/posthog/frontend/build.mjs:5:1
    at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

* Mock `process` for VFile used by ReactMarkdown

I was getting this otherwise:

core.js:55 Uncaught ReferenceError: process is not defined
    at new VFile (core.js:55)
    at VFile (core.js:49)
    at Function.parse (index.js:273)
    at ReactMarkdown2 (react-markdown.js:42)
    at renderWithHooks (react-dom.development.js:14803)
    at mountIndeterminateComponent (react-dom.development.js:17482)
    at beginWork (react-dom.development.js:18596)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
    at invokeGuardedCallback (react-dom.development.js:292)

* Mock `process.env` for VFile used by ReactMarkdown

I was getting this otherwise:

platform.ts:73 Uncaught TypeError: Cannot read properties of undefined (reading 'ENABLE_VSCODE_BROWSER_CODE_LOADING')
    at platform.ts:73
    at platform.ts:79
    at Function.r._invokeFactory (loader.js:1118)
    at r.complete (loader.js:1128)
    at r._onModuleComplete (loader.js:1754)
    at r._resolve (loader.js:1714)
    at r.defineModule (loader.js:1357)
    at _ (loader.js:1804)
    at numbers.ts:10
    at fake:1

* pass the heavy appScenes to sceneLogic through props via App.tsx

* remove sceneProxyLogic

* remove exported variables

* fix sceneLogic test

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-11-03 09:50:24 +01:00
Michael Matloka
fd4bfdd0e6
Describe AnalyticsDestroyModelMixin (#6803) 2021-11-03 08:28:46 +01:00
Michael Matloka
a18beb8e63
Fix test depending on OrganizationBasicSerializer (#6795)
* Update test_user.py

* Account for "administrator" being shortened to "admin"
2021-11-02 23:58:35 +01:00
Michael Matloka
a0dfa17866
Add top level danger TopBar indicator for potential system issues (#6789)
* Add top level danger `TopBar` indicator for potential system issues

* Update frontend/src/layout/lemonade/TopBar/SitePopover.tsx

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>

* Run prettier

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-11-02 18:01:03 +01:00
PostHog bot
abefe4cf66
Update posthog-js to 1.16.1 (#6787)
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-11-02 09:51:20 -07:00
Michael Matloka
ab3b33bd35
Show org access level in site popover (#6763)
* Show org access level in site popover

* Simplify access level indicator code and shorten "administrator"
2021-11-02 17:37:35 +01:00
dependabot[bot]
de790f66a1
Bump hosted-git-info from 2.8.8 to 2.8.9 in /plugin-server (#6791)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

---
updated-dependencies:
- dependency-name: hosted-git-info
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-11-02 10:19:04 -06:00
dependabot[bot]
eece74f86c
Bump browserslist from 4.16.0 to 4.17.5 in /plugin-server (#6790)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.0 to 4.17.5.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.0...4.17.5)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-02 09:59:32 -06:00
Rob Banagale
5a8fab6be4
Grammar nit: write out number, hyphenate for consistency (#6418) 2021-11-02 09:52:31 -06:00
Eric Duong
4c9ccf1cfa
change url access to https (#6779) 2021-11-02 16:27:16 +01:00
Paolo D'Amico
2f4f3f93ba
Update plugin server deps (Dependabot alerts) (#6774) 2021-11-02 09:25:05 -06:00
Rick Marron
6b523c2ce6
perf improvement on person query in recordings (#6754) 2021-11-02 07:04:35 -07:00
posthog-contributions-bot[bot]
d2611f92f3
🤖: Add pixlwave as a contributor 🎉 (#6786) 2021-11-02 12:34:11 +00:00
Harry Waye
bc5cc504ed
Add storybook support for updating correlation config (#6785) 2021-11-02 12:16:18 +00:00
Harry Waye
b7c898d23e
feat(correlation): load exclude properties from team settings (#6715)
* feat(correlation): add team wide person property exclusion list

This change just adds the exclusion list to the `Team` model and checks
that it can be updated. Separately we can:

 1. add interface for the Project page to display
 2. pull and update this list from the funnels correlation page

NOTE: We don't perform any validation on the structure, :fingerscrossed:
this won't be an issue. Alternative would be to use ArrayField, but use
of JSONField is consistent with other fields.

* test(correlation): add test checking exclude properties pulled from team

* feat(correlation): load exclude properties from team settings

Previously we were loading exclude properties from local storage, so we
would not be sharing the exclusion list between users. This change
simply plugs the `excludePropertyNames` into the `teamLogic` for the
purpose of persisting and loading the values.

* use [teamLogic.actionTypes.loadCurrentTeamSuccess]

* get tests passing

* switch frontend to using `correlation_config`

* refactor: use Team.correlation_config for persistence

* add project settings for correlation

* fix lint

* ensure excluded properties are saved to project config

* Add default excluded properties

* format

* make propertyCorrelations not null

* ensure excluded property names config is unique

* rename excludeProperty to excludePropertyFromProject

* update var names

* change to targetProperties

* remove null special casing

* update to filter client side on exclude from project clicked

* update test name to reflect new functionality

* fix tests
2021-11-02 11:12:13 +00:00
Michael Matloka
8a52b27b12
Unify new correlation icons (#6773) 2021-11-02 10:03:19 +00:00
Neil Kakkar
3e205225e9
Fixes for Correlation UI: pagination & persons modal (#6767)
* Fixes for Correlation  UI: pagination & persons modal
2021-11-02 09:54:44 +00:00
Paolo D'Amico
1e33b081ef
Disable Storybook previews on forks (#6777) 2021-11-01 19:20:34 +00:00
Asher Foa
6584ae4539
Remove unused import in test_preflight.py (#6647)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-11-01 12:43:11 -06:00
Yakko Majuri
7bf8a58394
make migration 0174 reversible (#6724)
* make 0174 reverisble

* remove line altogether
2021-11-01 17:54:57 +00:00
Karl-Aksel Puulmann
e66fbf0278
CI: Run EE tests in 5 minutes (#6759)
* Unify SAML and non-saml tests workflows

* Include matrix name in cache key

* Prettify yaml

* Measure test duration time

* Install pytest-split

* Try out parallelism

* Update name

* Fixup yaml

* Upload artifacts

* Run FOSS tests separately

* Run mark.ee tests only once

* Set up needed files properly

* Run backend tests only on one python version

* Run only cloud tests for cloud repo

* Remove test_durations file for posthog/

* Skip setting up ch on foss tests

* Fixup cloud tests

* Cache .test_durations file

* Fix ternary expression

* Only upload artefacts if needed

* .test_durations change

* Default to 3.8.5 in tests

* Add a note
2021-11-01 17:23:23 +02:00
Neil Kakkar
8477c1d962
Only load correlations for Funnels (#6765)
* Only load correlations for Funnels
2021-11-01 15:20:23 +00:00
Neil Kakkar
08251918f5
Some more polishing & restore property selector semantics (#6748)
* restore property selector semantics

* fix tests

* add another test
2021-11-01 10:52:04 +00:00
Karl-Aksel Puulmann
8ac9c590ec
Proposal: Use unique topic names for kafka in test (#6746)
Without this, to run plugin-server tests you need to reset all
containers every time since otherwise both test- and non-test clickhouse
would attempt to read from the same topic.
2021-11-01 11:42:56 +02:00
posthog-contributions-bot[bot]
d8467b551e
🤖: Add romj as a contributor 🎉 (#6760) 2021-11-01 09:30:10 +00:00
Alex Gyujin Kim
2ce78dcf30
Split out v1 and v2 of sessionsPlayLogic to fix bugs in prod (#6727)
Co-authored-by: Rick Marron <rcmarron@gmail.com>
2021-10-29 18:20:55 +00:00
Tim Glaser
63acdd1423
Don't rely on cache to return result (#6752) 2021-10-29 20:13:01 +02:00
Rick Marron
718a17fd6c
fix session recording permission bug (#6751) 2021-10-29 10:27:00 -07:00
Paolo D'Amico
9a4062e289
Instance preferences - disable feature upselling stub (#6706) 2021-10-29 11:45:22 -05:00
Michael Matloka
2d9ae8c192
Fix "Manage account" positioning (#6750) 2021-10-29 15:35:14 +00:00
Michael Matloka
137c699150
Add site popover on profile picture to fresh top bar (#6701)
* Keep top bar always visible

* Add `LemonPopover`

* Add empty account control sections

* Rename `AccountControl` to `SitePopover`

* Add basic Sign out button

* Add `LemonButton` and use it for sign out

* Scale down popover scaling

* Remove `LemonPopover` in favor of `Popup`

* Improve icons story

* Polish account info

* Add organizations to site popover

* Add `CreateOrganizationModal` to  `TopBar`

* Polish things

* Add PostHog status items

* Update FunnelTab.tsx

* Rename `InitialBlob` to `Lettermark`

* Update utils.test.ts

* Address feedback

* Handle long emails

* Update Cypress test for sentence case title
2021-10-29 16:36:08 +02:00
Guido Iaquinti
70dc55e7f9
Remove .github/workflows/docker-vuln-scan.yml (#6747) 2021-10-29 12:21:02 +00:00
Marius Andra
05d7817d14
update pycharm plugin server run configurations (#6742) 2021-10-29 13:48:39 +02:00
Karl-Aksel Puulmann
87dca4e837
Fix running yarn in plugin-server/ directory (#6738)
This broke with the following error:

```
ESLint: 7.28.0

ESLint couldn't determine the plugin "@typescript-eslint" uniquely.

- /home/macobo/backups/2/projects/posthog/plugin-server/node_modules/@typescript-eslint/eslint-plugin/dist/index.js (loaded in "../../../.eslintrc.js")
- /home/macobo/backups/2/projects/posthog/node_modules/@typescript-eslint/eslint-plugin/dist/index.js (loaded in "../../../../.eslintrc.js")

Please remove the "plugins" setting from either config or remove either plugin installation.

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
```

Relate github issue: https://github.com/eslint/eslint/issues/13385
2021-10-29 10:27:18 +02:00
posthog-contributions-bot[bot]
0e2fdcf4a0
🤖: Add Nishant-Sagar as a contributor 🎉 (#6736) 2021-10-28 23:34:05 +01:00
James Greenhill
4976dfb9af
Remove deprecation warning 2021-10-28 15:03:35 -07:00
James Greenhill
5f6e77ce89
Merge pull request #6735 from PostHog/monorepo
Pull Plugin-server into PostHog Monorepo!
2021-10-28 15:01:17 -07:00
James Greenhill
434e379f9a Add 'plugin-server/' from commit '01a99a4e26b0b11f068a7073d6b94e53a7214d33'
git-subtree-dir: plugin-server
git-subtree-mainline: 776b056b6d
git-subtree-split: 01a99a4e26
2021-10-28 14:59:19 -07:00
James Greenhill
776b056b6d
Merge pull request #6734 from PostHog/revert-6394-monorepo
Revert "Monorepo with updated history" (missing history)
2021-10-28 14:55:56 -07:00
James Greenhill
145937a435
Revert "Monorepo with updated history" 2021-10-28 14:55:17 -07:00
James Greenhill
b372022bc4
Merge pull request #6394 from PostHog/monorepo
Posthog Plugin-Server -> Posthog Monorepo
2021-10-28 14:49:35 -07:00
Eric Duong
5bef4185f0
make sure edge filters are used (#6723) 2021-10-28 20:53:19 +00:00
Eric Duong
18a22c0642
remove heigh check (#6718) 2021-10-28 16:19:36 -04:00
Alex Gyujin Kim
5d73df7090
Use separated session recording endpoints (#6641) 2021-10-28 19:40:20 +00:00
James Greenhill
01a99a4e26 [plugin-server] update Readme to reflect archive and monorepo location 2021-10-28 12:36:26 -07:00
Neil Kakkar
5417ce2af4
Polish Correlation Analysis UI - Part 1 (#6716)
* things finally look amahzing

* update tests
2021-10-28 17:25:45 +01:00
Marius Andra
47892972a1
Saved insight fixes 2 (#6674)
* insights buttons padding right fix

* add icon column

* fix all types

* fix select icons

* improve display and empty states

* searching for a number gives a direct result

* more debouncing time to throttle typing in the searchfield

* 2 columns > 960px, 3 columns > 1580px

* more height for card view

* split options column

* add person icon

* added profile picture

* fix column sort

* add min-width to funnels to make them readable on tiny dashboards

* add "trends" as default type

* stop screaming

* fix api call
2021-10-28 18:05:44 +02:00
Yakko Majuri
d14f619ab4
Make person update function migrations reversible (#6629)
* make person update func migrations reversible

* Update posthog/migrations/0176_update_person_props_function.py

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* Update posthog/migrations/0176_update_person_props_function.py

Co-authored-by: Tiina Turban <tiina303@gmail.com>

Co-authored-by: Tiina Turban <tiina303@gmail.com>
2021-10-28 16:01:17 +00:00
Yakko Majuri
6ce204fe3c
add version to person (#6628)
* add version to person

* add migration

* set all initial version values to 0

* remove defaults

* fix dep
2021-10-28 15:43:30 +00:00
Tiina Turban
8d663368fc [plugin-server] Event to have original passed set and set-once properties (https://github.com/PostHog/plugin-server/pull/615) 2021-10-28 17:43:08 +02:00