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

Dashboard item page view #4142

Merged
merged 26 commits into from
May 5, 2021
Merged

Dashboard item page view #4142

merged 26 commits into from
May 5, 2021

Conversation

liyiy
Copy link
Contributor

@liyiy liyiy commented Apr 28, 2021

Changes

Updating the dashboard item view page first before adding edit mode and then history panel for #3551

When you click on a dashboard item from the dashboards page, it's now clearer that it's a dedicated dashboard item page

BEFORE:

Screen Shot 2021-04-28 at 9 28 06 AM

AFTER:

Screen Shot 2021-04-28 at 9 33 20 AM

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

@liyiy liyiy changed the title Dashboard item view Dashboard item page view Apr 28, 2021
@liyiy liyiy requested review from EDsCODE and paolodamico April 28, 2021 13:35
@liyiy liyiy self-assigned this Apr 28, 2021
@timgl timgl temporarily deployed to posthog-pr-4142 April 28, 2021 13:36 Inactive
@liyiy liyiy added the feature/dashboards Feature Tag: Dashboards label Apr 28, 2021
@timgl timgl temporarily deployed to posthog-pr-4142 April 28, 2021 13:46 Inactive
@liyiy liyiy requested a review from Twixes April 28, 2021 18:19
@liyiy liyiy removed the feature/dashboards Feature Tag: Dashboards label Apr 28, 2021
@timgl timgl temporarily deployed to posthog-pr-4142 April 28, 2021 22:02 Inactive
Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

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

Nice stuff! Code-wise looks pretty solid, just made a comment on the way we pass params in the query string and one nit comment. Pushed a very minor commit with some comment clarifications, seemed faster than adding a review comment.

Functionality wise just found a problem. When you open a saved insight from the History tab, it shows like this (as in it says "On dashboard" but it's not actually part of a dashboard).

UI wise we had this design, sorry if we missed linking it in the original issue, which I think would be pretty nice to add (let me know if you want me to help here). One small change, I do love what you did of replacing the "Insights" title with the name of the item, I would keep that.

frontend/src/scenes/insights/insightLogic.ts Outdated Show resolved Hide resolved
frontend/src/scenes/dashboard/DashboardItem.tsx Outdated Show resolved Hide resolved
frontend/src/scenes/dashboard/DashboardItem.tsx Outdated Show resolved Hide resolved
@liyiy
Copy link
Contributor Author

liyiy commented Apr 28, 2021

Closing while I implement changes :D

@liyiy liyiy closed this Apr 28, 2021
@liyiy liyiy reopened this Apr 30, 2021
@timgl timgl temporarily deployed to posthog-pr-4142 April 30, 2021 21:33 Inactive
@EDsCODE
Copy link
Member

EDsCODE commented Apr 30, 2021

Not sure if you meant for review yet but was taking a look at the implementation and leaving my 2 🪙. Overall looks great only 2 points for a UI perspective

  1. The CTA button "add to dashboard" should be context aware and only say "Save changes". The changes should be saved to the dashboard_item in view
  2. +1 to Paolo's comment about urls. I thought about it and I think it'd be really concise if we could get specific insights that already exist as tracked entities to just have a url of /insights/{dashboard_item_id} (e.g. /insisghts/25)

Great work so far

@timgl timgl temporarily deployed to posthog-pr-4142 May 3, 2021 21:03 Inactive
@timgl timgl temporarily deployed to posthog-pr-4142 May 3, 2021 22:45 Inactive
return `/insights/${id}`
}

export const displayHistoryItemLink = ({ id, dashboard, filters }: DashboardItemType): string => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a bit of a pain to reroute the Insights History with the new insights/${id} links so I'm leaving it as it was originally (for now) to maintain functionality.

@liyiy
Copy link
Contributor Author

liyiy commented May 3, 2021

Updates include:

  1. Fixing the dashboard item "Update Dashboard" button
  2. Rerouting the dashboard item links to go to /insights/${id}

@paolodamico
Copy link
Contributor

Hey @liyiy! Let me know if you want me to re-review

@liyiy liyiy requested a review from paolodamico May 4, 2021 14:57
@liyiy
Copy link
Contributor Author

liyiy commented May 4, 2021

My PR is getting huge, so I would like to clean/touch up what I have now if it's working fine and then open a new PR to make more updates 😅 Otherwise feel free to lay any suggestions if the high level approach doesn't seem correct

@timgl timgl temporarily deployed to posthog-pr-4142 May 4, 2021 15:07 Inactive
@timgl timgl temporarily deployed to posthog-pr-4142 May 5, 2021 03:51 Inactive
@timgl timgl temporarily deployed to posthog-pr-4142 May 5, 2021 04:04 Inactive
Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

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

Honestly this looks amazing! A few comments but nothing blocking. Feel free to address what you think makes sense.

UX wise I did notice an issue.

  1. When visiting an insight from the history panel, the back button will not work as expected (as we do some URL changes that add an extra step to the history state). You would have to click back twice for it to work.

frontend/src/scenes/trends/trendsLogic.ts Outdated Show resolved Hide resolved
frontend/src/scenes/trends/viz/ActionsLineGraph.tsx Outdated Show resolved Hide resolved
frontend/src/scenes/trends/trendsLogic.ts Show resolved Hide resolved
frontend/src/scenes/insights/insightLogic.ts Outdated Show resolved Hide resolved
frontend/src/scenes/insights/insightLogic.ts Outdated Show resolved Hide resolved
frontend/src/scenes/insights/Insights.tsx Outdated Show resolved Hide resolved
@timgl timgl temporarily deployed to posthog-pr-4142 May 5, 2021 17:12 Inactive
@timgl timgl temporarily deployed to posthog-pr-4142 May 5, 2021 17:39 Inactive
@liyiy liyiy merged commit 19d3042 into master May 5, 2021
@liyiy liyiy deleted the dashboard-item-view branch May 5, 2021 17:58
@liyiy liyiy mentioned this pull request May 10, 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.

4 participants