From 3999f282a5c3a2bbc36f4e0b63daa521cfdf2816 Mon Sep 17 00:00:00 2001 From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:30:22 +0200 Subject: [PATCH] Last updated tooltip (#2576) * extract blinkingDot function * position pulsating-circle with tailwind instead * remove unused function * extract renderStatName function * display seconds since last realtime update Adds a 'Last updated X seconds ago' label to the Current Visitors tooltip. * small refactor: avoid duplication of this.props and this.state * show the 'last updated ...' tooltip in historical * changelog update * use className utility function --- CHANGELOG.md | 7 +-- assets/css/app.css | 2 - assets/js/dashboard/historical.js | 6 ++- assets/js/dashboard/index.js | 18 ++++++- assets/js/dashboard/realtime.js | 2 +- assets/js/dashboard/stats/current-visitors.js | 25 ++++++--- assets/js/dashboard/stats/graph/top-stats.js | 52 ++++++++++++------- .../js/dashboard/stats/graph/visitor-graph.js | 4 +- .../dashboard/util/seconds-since-last-load.js | 15 ++++++ .../stats/waiting_first_pageview.html.eex | 2 +- 10 files changed, 94 insertions(+), 39 deletions(-) create mode 100644 assets/js/dashboard/util/seconds-since-last-load.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0689addb3..a7d83e61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,11 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Added +- 'Last updated X seconds ago' info to 'current visitors' tooltips + ### Fixed +- Cascade delete sent_renewal_notifications table when user is deleted plausible/analytics#2549 - Show appropriate top-stat metric labels on the realtime dashboard when filtering by a goal - Fix breakdown API pagination when using event metrics plausible/analytics#2562 - Automatically update all visible dashboard reports in the realtime view @@ -14,9 +18,6 @@ All notable changes to this project will be documented in this file. - Always show direct traffic in sources reports plausible/analytics#2531 - Stop recording XX and T1 country codes plausible/analytics#2556 -## Fixed -- Cascade delete sent_renewal_notifications table when user is deleted plausible/analytics#2549 - ## v1.5.1 - 2022-12-06 ### Fixed diff --git a/assets/css/app.css b/assets/css/app.css index 55b09f4ad..939d8e531 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -135,8 +135,6 @@ blockquote { .pulsating-circle { position: absolute; - left: 50%; - top: 50%; width: 10px; height: 10px; } diff --git a/assets/js/dashboard/historical.js b/assets/js/dashboard/historical.js index 8c97ca0d0..486a5ecf4 100644 --- a/assets/js/dashboard/historical.js +++ b/assets/js/dashboard/historical.js @@ -13,6 +13,8 @@ import Conversions from './stats/conversions' import { withPinnedHeader } from './pinned-header-hoc'; function Historical(props) { + const tooltipBoundary = React.useRef(null) + function renderConversions() { if (props.site.hasGoals) { return ( @@ -30,9 +32,9 @@ function Historical(props) {
Last updated
Click to view realtime dashboard
+Last updated
Need to see the snippet again? <%= link("Click here", to: "/#{URI.encode_www_form(@site.domain)}/snippet", class: "text-indigo-600 dark:text-indigo-500 text-underline")%>
Not working? <%= link("Troubleshoot the integration", to: "https://plausible.io/docs/troubleshoot-integration#keep-seeing-a-blinking-green-dot", class: "text-indigo-600 dark:text-indigo-500 text-underline", rel: "noreferrer") %> with our guide