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

feat: dashboard templates #14322

Merged
merged 210 commits into from
Feb 28, 2023
Merged

feat: dashboard templates #14322

merged 210 commits into from
Feb 28, 2023

Conversation

lharries
Copy link
Contributor

@lharries lharries commented Feb 20, 2023

Problem

Product context: #12732

Changes

This PR lets staff users at PostHog create dashboard templates that are usable by all our cloud users. A future PR will enable users to create their own dashboards for their team/org.

Main additions:

  1. New "New dashboard" modal display the templates
  2. Ability to have variables in the templates
  3. Ability to edit and save dashboard templates from an existing dashboard
  4. Dashboard templates are now in the db rather than github

Before merging:

  • Put it behind a feature flag
  • Fix "update template" to show "create template" when appropriate
  • Remove the anys
  • Change inline styles to scss files
  • Improving loading when slow internet

Future:

  1. Accept events as well as actions in templates
  2. Ability to have posthog only templates and then make them public
  3. Enable others to create team/org templates
    • needs a no-code UI before general rollout

Video walkthrough: https://share.cleanshot.com/Nggc09JK

Before After
Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 25@2x Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 25 2@2x
Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 27@2x Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 28@2x

Setting up dashboard events

Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 26@2x

Dashboard template editor

Screenshot Dashboards • PostHog (Google Chrome) 2023-02-20 at 22 30@2x

How did you test this code?

  • Automated backed tests
  • Storybook stories

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 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
  • firefox: 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 2)
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 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

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 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
  • firefox: 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 2)
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@pauldambra pauldambra merged commit 4d88163 into master Feb 28, 2023
@pauldambra pauldambra deleted the luke/dashboard-templates branch February 28, 2023 11:45
@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
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

fuziontech added a commit that referenced this pull request Feb 28, 2023
* master: (53 commits)
  fix: cut the undeterministic snapshots (#14461)
  feat(hogql): Events table based on hogql (#14315)
  fix(breakdown): ensure breakdown sort can sort through values of different types (#14459)
  feat(capture): gracefully catch non-string tokens (#14453)
  chore(plugin-server): add healthcheck logging for failure (#14455)
  fix(tests): Safer migrations (#14452)
  revert: "fix(person-overrides): add constraints to catch race conditions" (#14445)
  dev(codespaces): update to python3.10 (#14449)
  chore(deps): Update posthog-js to 1.50.0 (#14448)
  feat(capture): support LIGHTWEIGHT_CAPTURE_ENDPOINT_ENABLED_TOKENS=* (#14421)
  chore: upgrade d3 (#14442)
  fix(person-overrides): add constraints to catch race conditions (#14277)
  feat(cohorts): Remove postgres calculations for flags (#14272)
  feat(capture): check token shape before team resolution too (#14439)
  feat: dashboard templates (#14322)
  feat: add a 'What's New?' button to the dropdown (#14379)
  chore(recordings): don't DLQ on PostgreSQL errors (#14438)
  chore: update autocapture attribute capture (#14435)
  chore(recordings): remove hub dependency on recordings ingestion (#14418)
  chore(deps): Update posthog-js to 1.49.0 (#14436)
  ...
@joethreepwood
Copy link
Contributor

Screenshot 2023-03-01 at 11 38 40

Screenshot 2023-03-01 at 11 38 48

@pauldambra Is this an intended behavior for now, or should I file a bug for this?

@pauldambra
Copy link
Member

Is that EU or US? Can you refresh? I don't see that behaviour

@joethreepwood
Copy link
Contributor

It's US.

I can't replicate it now and it's gone back to the old version. 🤷

Screenshot 2023-03-01 at 11 54 51

Screenshot 2023-03-01 at 11 55 05

@pauldambra
Copy link
Member

I deployed a change today, so maybe I accidentally fixed something I accidentally broke yesterday 🤣

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.

7 participants