PostHog / posthog

🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
19.45k stars 1.14k forks source link

refactor(insights): query based `deleteWithUndo` #23473

Open thmsobrmlr opened 4 days ago

thmsobrmlr commented 4 days ago

Problem

We want to have only query based insights frontend side, but we still need to send them to the backend with filters. The bigger goal of the coming PRs is to adapt all instances where we send insights to the backend for persistance with a wrapper function, so that the frontend can happily live with query based insights only.

Changes

This PR replaces all instances of deleteWithUndo for insights with a deleteInsightWithUndo that take a query based insight and conditionally restores it with filters.

How did you test this code?

With flag disabled:

With flag enabled:

github-actions[bot] commented 3 days ago

Size Change: 0 B

Total Size: 1.07 MB

ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `frontend/dist/toolbar.js` | 1.07 MB |

compressed-size-action