From be5fff3a002bd425770dd9ca33464b3016924eb2 Mon Sep 17 00:00:00 2001 From: Dean Keeble Date: Fri, 23 Aug 2024 17:26:19 +0100 Subject: [PATCH] bonus fix of apstatus not handling multiple results for sm --- .../modules/types/sm/dc/views/apstatusitem.js | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/client/src/js/modules/types/sm/dc/views/apstatusitem.js b/client/src/js/modules/types/sm/dc/views/apstatusitem.js index 9a70f5650..b87f2ebdf 100644 --- a/client/src/js/modules/types/sm/dc/views/apstatusitem.js +++ b/client/src/js/modules/types/sm/dc/views/apstatusitem.js @@ -9,14 +9,25 @@ define(['modules/dc/views/apstatusitem'], function(APStatusItem) { '', ''] - _.each(['autoproc','downstream'], function(ty, id) { - this.ui.holder.eq(id).empty() - _.each(res[ty], function(ap, n) { - if(ap != 0) - this.ui.holder.eq(id).append(n+' '+val[ap]+' ') - }, this) + _.each({ap: 'autoproc',dp: 'downstream'}, function(ty, id) { + this.ui[id].empty() + var allResults = [] + if (res[ty]) { + _.each(res[ty], function(ap, n) { + var ress = {} + _.each(ap, function(a) { + if (!(a in ress)) ress[a] = 0 + ress[a]++ + }) + allResults.push(n+': '+_.map(ress, function(c, st) { return c > 1 ? ''+c+'x '+val[st] : val[st]}).join(' ')) + }, this) + + this.ui[id].append(allResults.join('|')) + } else { + this.ui[id].append('No processing results') + } }, this) }, }) -}) \ No newline at end of file +})