-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: allow choose another dashboard template after pressing back #21248
fix: allow choose another dashboard template after pressing back #21248
Conversation
Hi @pauldambra ! I want to start contributing to PostHog, so I'm picking simple tasks to get acquainted with the project. Could you please review this PR as the latest contributor to this file, or assign somebody else? Thank you! |
You could add tests in newDashboardLogic.test.tsx, but it isn't currently testing the kea logic in there so adding a test only for You could add a Cypress test to validate this works. That's the best place for tests that validate the interaction between components and logics We only have a very basic test on top of templates here posthog/cypress/e2e/dashboard.cy.ts Line 90 in 92e17ce
So - since you want to learn how to contribute to posthog - you'd need to add a Cypress intercept so that the template modal had a template with a variable, then test that clicking that new template moves to the variable form in the modal, and finally that click back and selecting a template again works I've manually tested this PR so I'd be happy to accept it without a test, but if you want to learn how to contribute on more complex fixes I'm also happy spending time reviewing changes to Cypress tests :) |
Thanks for the guidance @pauldambra PTAL again, I added a test. What's the best way to request a review once again? Just mentioning a reviewer? I couldn't find it in the tutorials. |
Hi @Twixes! Kind reminder here, could you please review this? |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, thank you for the contribution! Apologies for the delay on this, I 100% dropped the ball on reviewing in a timely manner. Will do better next time!
Thanks for the review @Twixes and no problem! The merge looks stuck though, is there something I should do? The failing tests are probably flakes, as I don't touch the backend part here. |
Problem
Fix #20784.
This was caused by the following:
isLoading
is set to true on selecting a template.onClick
returns early, I confirmed it via debugger.Changes
Listener for the "Back" button is described here, so I set
isLoading
to false onclearActiveDashboardTemplate
.Does this work well for both Cloud and self-hosted?
N/A
How did you test this code?
Here's before, after.
Could you please guide me if I could add tests for this anywhere? I don't think it makes sense to test it in newDashboardLogic.test.tsx, as this functionality is spread across newDashboardLogic.ts and DashboardTemplateChooser.tsx, and I couldn't find tests that cover both of them. I also haven't found tests corresponding to this module in the commit history.