From 5c592295268e002da9f63c8dadd67a7699cbdc7f Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Thu, 9 Jan 2025 16:52:56 +0100 Subject: [PATCH] [FIX] runbot: properly sort by alphabetical order --- runbot/static/src/stats/stats_chart.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runbot/static/src/stats/stats_chart.js b/runbot/static/src/stats/stats_chart.js index 94c9c91e3..883d65c54 100644 --- a/runbot/static/src/stats/stats_chart.js +++ b/runbot/static/src/stats/stats_chart.js @@ -175,7 +175,12 @@ export class StatsChart extends Component { return dict; }, {}, ); - keys.sort((k1, k2) => sortValues[k2] - sortValues[k1]); + keys.sort((k1, k2) => { + if (mode === 'alpha') { + return sortValues[k1].localeCompare(sortValues[k2]); + } + return sortValues[k2] - sortValues[k1] + }); let visibleKeys; if (this.config.nb_dataset !== -1) { visibleKeys = new Set(keys.slice(0, this.config.nb_dataset));