Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Restore average/total revenue to top stats (#4716)
Karl-Aksel Puulmannd727ba5ed522
diff --git a/assets/js/dashboard/stats/graph/top-stats.js b/assets/js/dashboard/stats/graph/top-stats.jsindex 4bdd477ed1..3cc6c52e61 100644--- a/assets/js/dashboard/stats/graph/top-stats.js+++ b/assets/js/dashboard/stats/graph/top-stats.js@@ -16,30 +16,14 @@ import {MetricFormatterLong} from '../reports/metric-formatter'-function Maybe({ condition, children }) {- if (condition) {- return children- } else {- return null- }-}-function topStatNumberShort(metric, value) {- if (typeof value == 'number') {- const formatter = MetricFormatterShort[metric]- return formatter(value)- } else {- return null- }+ const formatter = MetricFormatterShort[metric]+ return formatter(value)}function topStatNumberLong(metric, value) {- if (typeof value == 'number') {- const formatter = MetricFormatterLong[metric]- return formatter(value)- } else {- return null- }+ const formatter = MetricFormatterLong[metric]+ return formatter(value)}export default function TopStats({ data, onMetricUpdate, tooltipBoundary }) {@@ -163,22 +147,22 @@ export default function TopStats({ data, onMetricUpdate, tooltipBoundary }) {>{topStatNumberShort(stat.graph_metric, stat.value)}</p>- <Maybe condition={!query.comparison && stat.change != null}>+ {query.comparison && stat.change != null ? (<ChangeArrowmetric={stat.graph_metric}change={stat.change}className="pl-2 text-xs dark:text-gray-100"/>- </Maybe>+ ) : null}</span>- <Maybe condition={query.comparison}>+ {query.comparison ? (<p className="text-xs dark:text-gray-100">{formatDateRange(site, data.from, data.to)}</p>- </Maybe>+ ) : null}</div>- <Maybe condition={query.comparison}>+ {query.comparison ? (<div><p className="font-bold text-xl text-gray-500 dark:text-gray-400">{topStatNumberShort(stat.graph_metric, stat.comparison_value)}@@ -187,7 +171,7 @@ export default function TopStats({ data, onMetricUpdate, tooltipBoundary }) {{formatDateRange(site, data.comparing_from, data.comparing_to)}</p></div>- </Maybe>+ ) : null}</div></Tooltip>)