From aaa76a15b192aba3d0d23dfda59658552c19b726 Mon Sep 17 00:00:00 2001 From: novykh Date: Mon, 20 May 2024 14:19:44 +0300 Subject: [PATCH] v5.0.13 --- package.json | 2 +- src/sdk/makeChart/index.js | 2 ++ src/sdk/plugins/unitConversion/index.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e13a5002..8f551e50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netdata/charts", - "version": "5.0.12", + "version": "5.0.13", "description": "Netdata frontend SDK and chart utilities", "main": "dist/index.js", "module": "dist/es6/index.js", diff --git a/src/sdk/makeChart/index.js b/src/sdk/makeChart/index.js index 34c7b107..44a19fde 100644 --- a/src/sdk/makeChart/index.js +++ b/src/sdk/makeChart/index.js @@ -319,6 +319,8 @@ export default ({ const en = node.getAttribute("en") if (!en?.[key]) return count === 1 ? key : pluralize ? `${key}s` : key + if (typeof en[key] === "string") return en[key] + return count === 1 ? en[key]?.one || key : en[key]?.other || (pluralize ? `${key}s` : key) } diff --git a/src/sdk/plugins/unitConversion/index.js b/src/sdk/plugins/unitConversion/index.js index 178342a8..db3d95b0 100644 --- a/src/sdk/plugins/unitConversion/index.js +++ b/src/sdk/plugins/unitConversion/index.js @@ -23,8 +23,8 @@ const baseConvert = (chart, unitsKey = "units", min, max) => { `${unitsKey}ByContext`, Object.keys(unitsStsByContext).reduce((h, ctx) => { h[ctx] = getConversionAttributes(chart, unitsStsByContext[ctx].units, { - min: unitsStsByContext[ctx].min, - max: unitsStsByContext[ctx].max, + min: min || unitsStsByContext[ctx].min, + max: max || unitsStsByContext[ctx].max, }) return h }, {})