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

New querying horizontal UI - continuation #4239

Merged
merged 5 commits into from
May 6, 2021
Merged

Conversation

paolodamico
Copy link
Contributor

@paolodamico paolodamico commented May 6, 2021

Changes

This PR continues work towards #4050 (issue still WIP, but working through bite-sized PRs). This PR handles most UI layout changes.

In addition:

  • This PR converts to TS some related insights components.
  • Abstracts the card header of the insights container (where you set the interval, date range, ...) into it's own component InsightDisplayConfig.tsx to be able to return different components in the new UI.
  • To simplify changes and future maintenance if we either keep this new UI or not, TrendTabHorizontal.tsx is introduced as a high-level component to encompass most changes to the layout.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious

@timgl timgl temporarily deployed to posthog-pr-4239 May 6, 2021 19:03 Inactive
@timgl timgl temporarily deployed to posthog-pr-4239 May 6, 2021 20:11 Inactive
@paolodamico paolodamico marked this pull request as ready for review May 6, 2021 20:16
@paolodamico
Copy link
Contributor Author

@samwinslow can you help me with a review when you can? wanted to do a checkpoint before the PR becomes too big.

}
}

const showDateFilter = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering -- why are some of these flag getters objects, and some others are functions? Should we prefer one approach or the other? (I personally prefer the functions with switch)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm that's a good question, not sure actually (it's code quite old), but I guess that we have the functions for logic that requires checking other variables and just plain constants for when it's just a static definition. Will keep in mind for a refactoring.

Copy link
Contributor

@samwinslow samwinslow left a comment

Choose a reason for hiding this comment

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

Nice! It's definitely nice to see TrendTabHorizontal as its own file.

@samwinslow
Copy link
Contributor

Nit- just noticed this. Global filters/ breakdowns column could be full-width on mobile and have extra padding above.
Screen Shot 2021-05-06 at 4 49 33 PM

@paolodamico
Copy link
Contributor Author

Good catch on the mobile-side, I still need to optimize for mobile. Will do that in a subsequent PR.

@paolodamico
Copy link
Contributor Author

Failing test is unrelated (was failing before), merging.

@paolodamico paolodamico merged commit 79a64ba into master May 6, 2021
@paolodamico paolodamico deleted the new-ui-layout-4050 branch May 6, 2021 23:32
@samwinslow samwinslow mentioned this pull request May 6, 2021
5 tasks
@liyiy liyiy mentioned this pull request May 28, 2021
5 tasks
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