Skip to content

Commit 8a1117d

Browse files
ndg63276Mark Williams
andauthored
LIMS-1951: Fix reprocessing on Auto Processing Status Summary page (#996)
* LIMS-1951: Fix reprocessing on Auto Processing Status Summary page * LIMS_1951: consolidate unti cell checks into function --------- Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent a7b9c85 commit 8a1117d

File tree

5 files changed

+439
-715
lines changed

5 files changed

+439
-715
lines changed

client/src/js/modules/dc/views/apstatussummary.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ define(['marionette',
5050
initialize: function(options) {
5151
APItemCell.__super__.initialize.call(this,options)
5252
this.listenTo(this.model, 'change reset', this.render, this)
53-
this.template = '<i class="fa fa-spin fa-spinner"></i>'
5453
},
5554

5655
render: function() {
@@ -65,15 +64,16 @@ define(['marionette',
6564
'<i class="fa icon red fa-times alt="Failed"></i>']
6665

6766
var label = this.column.get('program')
68-
this.$el.html(_.template(this.template))
6967
if (this.model.get('APLOADED') == true) {
70-
var ap = res[this.column.get('group')][label]
71-
var ress = {}
72-
_.each(ap, function(a) {
73-
if (!(a in ress)) ress[a] = 0
74-
ress[a]++
75-
})
76-
this.$el.html(_.map(ress, function(c, st) { return c > 1 ? '<span class="count">'+c+'x</span> '+val[st] : val[st]}))
68+
if (this.column.get('group') in res) {
69+
var ap = res[this.column.get('group')][label]
70+
var ress = {}
71+
_.each(ap, function(a) {
72+
if (!(a in ress)) ress[a] = 0
73+
ress[a]++
74+
})
75+
this.$el.html(_.map(ress, function(c, st) { return c > 1 ? '<span class="count">'+c+'x</span> '+val[st] : val[st]}))
76+
}
7777
}
7878
this.delegateEvents();
7979
return this;
@@ -119,7 +119,7 @@ define(['marionette',
119119

120120
updateColumns: function() {
121121
var states = this.statuses.pluck('STATES')
122-
var group_names = _.keys(states[0])
122+
var group_names = _.chain(states).map(_.keys).flatten().uniq().value();
123123
var groups = {}
124124
_.each(group_names, function(group) {
125125
groups[group] = _.unique(_.map(states, function(state) { return _.keys(state[group]) }).flat())
@@ -159,4 +159,4 @@ define(['marionette',
159159
this.wrap.show(this.table)
160160
}
161161
})
162-
})
162+
})

client/src/js/modules/dc/views/dc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ define(['marionette',
1111
'modules/dc/views/apstatusitem',
1212
'modules/dc/views/apmessagestatusitem',
1313
'modules/dc/views/apmessages',
14-
'modules/dc/views/reprocess2',
14+
'modules/dc/views/reprocess',
1515
'modules/dc/views/dcbase',
1616
'templates/dc/dc.html', 'backbone-validation'], function(Marionette,
1717
DialogView, TabView, DCDISTLView,

0 commit comments

Comments
 (0)