From a300a2804739c844b6ab0e7cfead558ba8a8e387 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 30 Sep 2026 14:01:12 +0200 Subject: [PATCH] Use label instead of value for Aggregator name params if available --- public/js/components/DashboardWidget/Report/Kpi.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/js/components/DashboardWidget/Report/Kpi.js b/public/js/components/DashboardWidget/Report/Kpi.js index 928d59c51..b1d44c9de 100644 --- a/public/js/components/DashboardWidget/Report/Kpi.js +++ b/public/js/components/DashboardWidget/Report/Kpi.js @@ -33,9 +33,17 @@ export default { return this.activeAggregator.label.replace( /\{\s*([^\}]+)\s*\}/g, - (match, key) => this.calledVars[key] === undefined - ? match - : this.calledVars[key] + (match, key) => { + if (this.calledVars[key] === undefined) + return match; + if (this.config.vars[key].detail?.options) { + const options = this.config.vars[key].detail.options; + const res = options.find(opt => opt.value == this.calledVars[key]); + if (res?.label) + return res.label; + } + return this.calledVars[key]; + } ); }, activeAggregator() {