From 857da0ebb5db04dd4277179c0acb10507d9dbc8c Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Tue, 13 Feb 2024 17:07:35 +0000 Subject: [PATCH] fix(insights): Update some stuff around refreshing (#20237) Update refresh stuff --- .../src/lib/components/Cards/InsightCard/InsightCard.scss | 2 +- .../lib/components/Cards/InsightCard/InsightDetails.tsx | 8 ++++++++ frontend/src/scenes/dashboard/dashboardLogic.tsx | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightCard.scss b/frontend/src/lib/components/Cards/InsightCard/InsightCard.scss index 684a6d758d5d8..0a83c8efc683b 100644 --- a/frontend/src/lib/components/Cards/InsightCard/InsightCard.scss +++ b/frontend/src/lib/components/Cards/InsightCard/InsightCard.scss @@ -112,7 +112,7 @@ .InsightDetails__footer { display: grid; - grid-template-columns: repeat(2, 1fr); + grid-template-columns: repeat(3, 1fr); .profile-package { vertical-align: middle; diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx index 66751fc6e2ffb..ffc72eae269cc 100644 --- a/frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx +++ b/frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx @@ -353,6 +353,14 @@ function InsightDetailsInternal({ insight }: { insight: InsightModel }, ref: Rea + {insight.last_refresh && ( +
+
Last computed
+
+ +
+
+ )} ) diff --git a/frontend/src/scenes/dashboard/dashboardLogic.tsx b/frontend/src/scenes/dashboard/dashboardLogic.tsx index a956bd2fc0dd5..5c8d9977c4d23 100644 --- a/frontend/src/scenes/dashboard/dashboardLogic.tsx +++ b/frontend/src/scenes/dashboard/dashboardLogic.tsx @@ -1091,6 +1091,7 @@ export const dashboardLogic = kea([ if (values.autoRefresh.enabled) { // Refresh right now after enabling if we haven't refreshed recently if ( + !values.itemsLoading && values.lastRefreshed && values.lastRefreshed.isBefore(now().subtract(values.autoRefresh.interval, 'seconds')) ) {