Skip to content

Commit a7b9c85

Browse files
ndg63276Mark Williams
andauthored
LIMS-1952: Add select all button to multicrystal page (#999)
* LIMS-1952: Add select all button to multicrystal page * LIMS-1952: Change cursor to show cell is clickable --------- Co-authored-by: Mark Williams <[email protected]>
1 parent 3eeda06 commit a7b9c85

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

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/js/modules/mc/views/datacollections.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ define(['backbone', 'marionette',
114114
return
115115
}
116116

117+
if (s.length > 1 && this.ui.pipeline.val() == 'fast_dp') {
118+
app.alert({ message: 'Fast DP can only integrate a single sweep' })
119+
return
120+
}
121+
117122
var self = this
118123
var p = this.pipelines.findWhere({ VALUE: self.ui.pipeline.val() })
119124
var reprocessing = new Reprocessing({
@@ -283,7 +288,8 @@ define(['backbone', 'marionette',
283288
this.$el.find('input[name='+f+']').val(ap.get('CELL')['CELL_'+k.toUpperCase()])
284289
}, this)
285290

286-
this.$el.find('select[name=sg]').val(ap.get('SG'))
291+
let sg = ap.get('SG')?.replace(/\s/g, '') ?? "";
292+
this.$el.find('select[name=sg]').val(sg)
287293
},
288294

289295
onDestroy: function() {

client/src/js/modules/mc/views/dcdistl.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,24 @@ define(['marionette',
1919

2020
events: {
2121
'click .cells': 'sendCell',
22+
'click .all': 'selectAll',
2223
},
2324

2425
sendCell: function(e) {
2526
if (!this.aps.length) return
2627
this.trigger('set:cell', this.aps.at(0))
2728
},
2829

30+
selectAll: function(e) {
31+
e.preventDefault()
32+
33+
var si = parseInt(this.model.get('SI'))
34+
var ni = parseInt(this.model.get('NUMIMG'))
35+
36+
this.setSelection(si, si+ni-1)
37+
this.plotview.setSelection(si, si+ni-1)
38+
},
39+
2940

3041
onShow: function() {
3142
var w = 0.175*$(window).width()*0.95
@@ -43,11 +54,13 @@ define(['marionette',
4354

4455

4556
setCell: function() {
57+
let cells = 'N/A'
4658
if (this.aps.length) {
4759
var e = this.aps.at(0)
4860
var c = e.get('CELL')
49-
this.ui.cells.text(c['CELL_A']+','+c['CELL_B']+','+c['CELL_C']+','+c['CELL_AL']+','+c['CELL_BE']+','+c['CELL_GA'])
50-
} else this.ui.cells.text('N/A')
61+
if (c && Object.keys(c).length) cells = c['CELL_A']+','+c['CELL_B']+','+c['CELL_C']+','+c['CELL_AL']+','+c['CELL_BE']+','+c['CELL_GA']
62+
}
63+
this.ui.cells.text(cells)
5164
},
5265

5366

@@ -75,4 +88,4 @@ define(['marionette',
7588

7689

7790

78-
})
91+
})

client/src/js/templates/mc/datacollection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="state"></div>
2-
<h1><%-IMP%>_<%-RUN%></h1>
2+
<h1><%-IMP%>_<%-RUN%><a href="#" title="Select All" class="button all r"><i class="fa fa-arrows"></i></a></h1>
33
<h2><%-DIR%></h2>
44
<div class="distl" title="Per Image Analysis: Number of spots detected for each image. Select which images to integrate by dragging across the graph"></div>
55
<span>&<%-ROTATIONAXIS%>; Start: <%-AXISSTART%>&deg; &<%-ROTATIONAXIS%>; Osc: <%-AXISRANGE%>&deg; | <a title="Click to view diffraction images for this data collection" class="images" href="/dc/view/id/<%-ID%>">Images</a></span>

0 commit comments

Comments
 (0)