Skip to content

Commit e80bd1e

Browse files
authored
Merge pre-release/2025-R5.2 into master (#1008)
* LIMS-1957: Fix fault report URLs for beamlines with hyphens (#997) * LIMS-1952: Add select all button to multicrystal page (#999) * LIMS-1951: Fix reprocessing on Auto Processing Status Summary page (#996) * LIMS-1753: View of all inspection images for a plate (#980) * LIMS-598: Show Anode maps if attached (#995) * LIMS-1951: Fix link to Multi Crystal reprocessing
1 parent 3ade510 commit e80bd1e

File tree

22 files changed

+645
-738
lines changed

22 files changed

+645
-738
lines changed

api/src/Downstream/DownstreamProcessing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function _get_attachments(
113113
}
114114

115115
$rows = $this->db->pq(
116-
"SELECT appa.filename, appa.filepath, appa.filetype, CONCAT(appa.filepath, '/', appa.filename) as file
116+
"SELECT appa.autoprocprogramattachmentid, appa.filename, appa.filepath, appa.filetype, CONCAT(appa.filepath, '/', appa.filename) as file
117117
FROM autoprocprogramattachment appa
118118
WHERE appa.autoprocprogramid = :1 $where
119119
ORDER BY appa.importancerank,appa.filename",

api/src/Downstream/Type/Dimple.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function results() {
121121
}
122122

123123
$dat['ANODE_PEAKS'] = $this->_get_anode_peaks($this->process['PARAMETERS']['scaling_id']);
124+
$dat['ANODE_MODEL'] = $this->_get_anode_model();
124125

125126
$results = new DownstreamResult($this);
126127
$results->data = $dat;
@@ -199,4 +200,12 @@ function _get_anode_peaks($scaling_id) {
199200
}
200201
return array('TABLE' => $peaks, 'PLOT' => $plot);
201202
}
203+
204+
function _get_anode_model() {
205+
$model = $this->_get_attachments('anode.html');
206+
if ($model) {
207+
return $model['AUTOPROCPROGRAMATTACHMENTID'];
208+
}
209+
return;
210+
}
202211
}

api/src/Page/Imaging.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,25 @@ function _get_inspection_images()
611611
array_push($args, $this->arg('sid'));
612612
}
613613

614-
$images = $this->db->pq("SELECT i.containerid, si.containerinspectionid, ROUND(TIMESTAMPDIFF('HOUR', min(i2.bltimestamp), i.bltimestamp)/24,1) as delta, si.blsampleimageid, si.blsampleid, si.micronsperpixelx, si.micronsperpixely, si.blsampleimagescoreid, si.comments, TO_CHAR(si.bltimestamp, 'DD-MM-YYYY HH24:MI') as bltimestamp, sc.name as scorename, sc.score, sc.colour as scorecolour, max.maxscore, scorecolours.colour as maxscorecolour
614+
$order = 'i.bltimestamp';
615+
616+
if ($this->has_arg('sort_by')) {
617+
$cols = array(
618+
'BLTIMESTAMP' => 'i.bltimestamp',
619+
'LOCATION' => 'b.location+0'
620+
);
621+
$dir = $this->has_arg('order') ? ($this->arg('order') == 'asc' ? 'ASC' : 'DESC') : 'ASC';
622+
if (array_key_exists($this->arg('sort_by'), $cols))
623+
$order = $cols[$this->arg('sort_by')] . ' ' . $dir;
624+
}
625+
626+
$images = $this->db->pq("SELECT i.containerid, si.containerinspectionid, ROUND(TIMESTAMPDIFF('HOUR', min(i2.bltimestamp), i.bltimestamp)/24,1) as delta, si.blsampleimageid, si.blsampleid, si.micronsperpixelx, si.micronsperpixely, si.blsampleimagescoreid, si.comments, TO_CHAR(si.bltimestamp, 'DD-MM-YYYY HH24:MI') as bltimestamp, sc.name as scorename, sc.score, sc.colour as scorecolour, max.maxscore, scorecolours.colour as maxscorecolour, b.location
615627
FROM blsampleimage si
616628
LEFT OUTER JOIN blsampleimagescore sc ON sc.blsampleimagescoreid = si.blsampleimagescoreid
617629
INNER JOIN containerinspection i ON i.containerinspectionid = si.containerinspectionid
618630
LEFT OUTER JOIN containerinspection i2 ON i.containerid = i2.containerid
619631
632+
INNER JOIN blsample b ON b.blsampleid = si.blsampleid
620633
INNER JOIN container c ON c.containerid = i.containerid
621634
INNER JOIN dewar d ON d.dewarid = c.dewarid
622635
INNER JOIN shipping s ON s.shippingid = d.shippingid
@@ -631,7 +644,7 @@ function _get_inspection_images()
631644
632645
WHERE p.proposalid = :1 $where
633646
GROUP BY i.containerid, si.containerinspectionid, i.bltimestamp, si.blsampleimageid, si.blsampleid, si.micronsperpixelx, si.micronsperpixely, si.blsampleimagescoreid, si.comments, TO_CHAR(si.bltimestamp, 'DD-MM-YYYY HH24:MI'), sc.name, sc.score, sc.colour
634-
ORDER BY i.bltimestamp", $args);
647+
ORDER BY $order", $args);
635648

636649

637650
if ($this->has_arg('imid')) {

client/src/css/partials/_base.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ body {
2121
}
2222
}
2323

24+
body.dialog-open {
25+
overflow: hidden;
26+
position: fixed;
27+
width: 100%;
28+
height: 100%;
29+
}
30+
2431
a {
2532
color: $link-color;
2633

client/src/css/partials/_mc.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ span.run_state {
132132
.yAxis .tickLabel.selected {
133133
font-weight: bold;
134134
}
135+
136+
span.cells {
137+
cursor: pointer;
138+
}

client/src/css/partials/_utility.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
flex: 0 0 auto
7373
}
7474

75+
.wrap {
76+
flex-wrap: wrap;
77+
}
78+
7579
/* TODO: If we can ever get rid of this class, we can also remove the
7680
work-around in plotly support which needs to circumvent it */
7781
.active {

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ define(['marionette',
4141
e.preventDefault()
4242

4343
if (app.dialog.currentView instanceof ReprocessView) app.dialog.currentView.collection.add(this.model)
44-
else app.dialog.show(new ReprocessView({ model: this.model, visit: this.model.get('VISIT') }))
44+
else app.dialog.show(new ReprocessView({ model: this.model, visit: this.column.get('visit') }))
4545
}
4646

4747
})
@@ -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;
@@ -99,7 +99,7 @@ define(['marionette',
9999
]
100100

101101
this.columns.push.apply(this.columns, [
102-
{ label: '', cell: RPCell, template: '<a href="#" class="reprocess button button-notext" title="Reprocess"><i class="fa fa-cog"></i> <span>Reprocess</span></a>', editable: false },
102+
{ label: '', cell: RPCell, template: '<a href="#" class="reprocess button button-notext" title="Reprocess"><i class="fa fa-cog"></i> <span>Reprocess</span></a>', editable: false, visit: this.model.get('VISIT') },
103103
{ label: '', cell: APCell, template: '<a href="/dc/visit/'+this.model.escape('VISIT')+'/id/<%-ID%>" class="button button-notext dll" title="Open data collection"><i class="fa fa-arrow-right"></i> <span>Open data collection</span></a>', editable: false },
104104
])
105105

@@ -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,

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ define([
1313
rstats_div: '.rstats_div',
1414
blob: '.blobs img',
1515
blobs: '.blobs',
16+
viewer: '.viewer',
1617
},
1718

1819
showBlob: function() {
@@ -31,6 +32,12 @@ define([
3132

3233
this.ui.blob.hide()
3334

35+
if (this.model.get('ANODE_MODEL')) {
36+
this.ui.viewer.attr('href', app.apiurl+'/download/ap/attachments/' + this.model.get('ANODE_MODEL') + '/dl/2');
37+
} else {
38+
this.ui.viewer.hide()
39+
}
40+
3441
if (this.model.get('BLOBS') > 0) {
3542
this.blob = new XHRImage()
3643
this.blob.onload = this.showBlob.bind(this)
@@ -44,10 +51,10 @@ define([
4451
this.ui.rstats.width(0.25*(this.options.holderWidth-14))
4552
this.ui.plot.width(0.42*(this.options.holderWidth-14))
4653
this.ui.plot.height(this.ui.plot.width()*0.41-80)
47-
this.ui.rstats_div.height(this.ui.plot.width()*0.41-80)
54+
this.ui.rstats_div.height(this.ui.plot.height())
4855
}
4956

50-
this.ui.blobs.css('min-height', this.ui.plot.width()*0.41-80)
57+
this.ui.blobs.css('min-height', this.ui.plot.height())
5158

5259
var data = [{ data: this.model.get('PLOTS').FVC, label: 'Rfree vs. Cycle' },
5360
{ data: this.model.get('PLOTS').RVC, label: 'R vs. Cycle' }]
@@ -56,8 +63,9 @@ define([
5663

5764
const anodePeaks = this.model.get('ANODE_PEAKS');
5865
if (anodePeaks && anodePeaks.TABLE && anodePeaks.TABLE.length > 0) {
59-
this.ui.plot_anode.width(0.42 * (this.options.holderWidth - 14))
60-
this.ui.plot_anode.height(this.ui.plot.width() * 0.41 - 80)
66+
this.ui.plot_anode.width(this.ui.plot.width())
67+
this.ui.plot_anode.height(this.ui.plot.height())
68+
this.ui.blobs.css('min-height', this.ui.plot.height() + this.ui.plot_anode.height())
6169

6270
var anode_data = [{ data: anodePeaks.PLOT, label: 'Peak Height (sig)' }]
6371
var anode_pl = $.extend({}, utils.default_plot, { series: { lines: { show: true }}});

0 commit comments

Comments
 (0)