Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(insights): simplify "save insight" #24047

Merged
merged 5 commits into from
Jul 30, 2024
Merged

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Jul 29, 2024

Problem / Changes

Builds upon #24024 to and moves the saveInsight action into the insightLogic, so that we don't need to do the dance where we first use setInsight to update the insight in insightLogic with the current query and then perform the save action on the insightsLogic.

Contrary to the approach of passing in the query in the action as done in #24024, I found a way for kea to accept circular dependencies between insightLogic and insightDataLogic, so that we can now use the current query natively in insightLogic.

Doing this refactor now to get rid of filters in insightDataLogic.

How did you test this code?

Saved a new and existing insight

Base automatically changed from refactor-save-as to master July 29, 2024 11:25
@thmsobrmlr thmsobrmlr force-pushed the refactor-save-insight branch from 708b959 to 7b9ee75 Compare July 29, 2024 11:28
Copy link
Contributor

github-actions bot commented Jul 29, 2024

Size Change: +40 B (0%)

Total Size: 1.07 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.07 MB +40 B (0%)

compressed-size-action

@thmsobrmlr thmsobrmlr marked this pull request as ready for review July 29, 2024 12:40
@thmsobrmlr thmsobrmlr requested a review from a team July 29, 2024 12:46
@skoob13
Copy link
Contributor

skoob13 commented Jul 30, 2024

@thmsobrmlr saving an insight works well, but there is a bug with saving a data warehouse insight. I can't reproduce it on master.

Reproduction

2024-07-30 10 55 18

Steps to reproduce

  • Save an insight
  • Navigate to the Data Warehouse
  • Save a SQL query as an insight
  • Observe that saved insight is the insight from the step 1, but it should have the insight with a table

@thmsobrmlr
Copy link
Contributor Author

Thanks for catching this @skoob13! I think it's fixed now.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@skoob13 skoob13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works now👍

@thmsobrmlr thmsobrmlr merged commit 31bf450 into master Jul 30, 2024
92 checks passed
@thmsobrmlr thmsobrmlr deleted the refactor-save-insight branch July 30, 2024 15:00
@thmsobrmlr thmsobrmlr restored the refactor-save-insight branch July 30, 2024 18:10
@thmsobrmlr thmsobrmlr deleted the refactor-save-insight branch July 30, 2024 18:10
thmsobrmlr added a commit that referenced this pull request Jul 30, 2024
silentninja pushed a commit to silentninja/posthog that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants