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

fix(product-analytics): Hide filtering by dashboard if there are none #19530

Conversation

baristaGeek
Copy link
Contributor

@baristaGeek baristaGeek commented Dec 27, 2023

Problem

If there are no dashboards, users can select from an empty list: #19519

Changes

I added a conditional render to fix this. This is how it looks:

noDashboardsSelector8MBs.mov

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

Other than manually testing on my local env, I ran the tests for scenes/insights and everything seems to be fine:

ranTestsForInsights

Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

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

Hi @baristaGeek, thank you very much for your contribution!

Peeking into this PR it looks like all filters are hidden when there are no dashboards. It would be great to only hide the dashboards filter in this case.

It seems you also made some changes to the persons dropdown. Would you mind moving this to a separate PR or at least explaining the changes there?

@baristaGeek
Copy link
Contributor Author

@thmsobrmlr gotcha! I'll do the change and re-run the tests later today. Regarding the change in the selector, it's probably like that because I mixed up something.

@baristaGeek
Copy link
Contributor Author

Hi @baristaGeek, thank you very much for your contribution!

Peeking into this PR it looks like all filters are hidden when there are no dashboards. It would be great to only hide the dashboards filter in this case.

It seems you also made some changes to the persons dropdown. Would you mind moving this to a separate PR or at least explaining the changes there?

I made the update to only hide the dashboards selector. Please lmk what you think

Screenshot 2024-01-02 at 8 01 56 PM

@baristaGeek baristaGeek requested a review from thmsobrmlr January 3, 2024 01:08
@Twixes Twixes changed the title Feature/product analytics hide dashboard dropdown if dashboard count is 0 fix(product-analytics): Hide filtering by dashboard if there are no dashboards Jan 5, 2024
@Twixes Twixes changed the title fix(product-analytics): Hide filtering by dashboard if there are no dashboards fix(product-analytics): Hide filtering by dashboard if there are none Jan 5, 2024
@Twixes Twixes enabled auto-merge (squash) January 5, 2024 15:22
@Twixes Twixes merged commit c2fe711 into PostHog:master Jan 9, 2024
94 of 95 checks passed
jacobwgillespie pushed a commit to jacobwgillespie/posthog that referenced this pull request Jan 12, 2024
…PostHog#19530)

* Add conditional rendering based on the length of the sorted dashboards array

* Add conditional rendering to dashboard selection

* Only hide the dashboards filter

---------

Co-authored-by: Michael Matloka <[email protected]>
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.

4 participants