Skip to content

Commit 1107d6e

Browse files
authored
Revert "LIMS-128: Add plate view to queue page (#839)"
This reverts commit 92289a0.
1 parent cda9303 commit 1107d6e

File tree

10 files changed

+71
-103
lines changed

10 files changed

+71
-103
lines changed

api/src/Page/Imaging.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ function _get_inspection_images()
610610
array_push($args, $this->arg('sid'));
611611
}
612612

613-
$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
613+
$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
614614
FROM blsampleimage si
615615
LEFT OUTER JOIN blsampleimagescore sc ON sc.blsampleimagescoreid = si.blsampleimagescoreid
616616
INNER JOIN containerinspection i ON i.containerinspectionid = si.containerinspectionid
@@ -620,7 +620,6 @@ function _get_inspection_images()
620620
INNER JOIN dewar d ON d.dewarid = c.dewarid
621621
INNER JOIN shipping s ON s.shippingid = d.shippingid
622622
INNER JOIN proposal p ON p.proposalid = s.proposalid
623-
INNER JOIN blsample b ON b.blsampleid = si.blsampleid
624623
625624
LEFT OUTER JOIN (SELECT blsampleid, max(score) as maxscore
626625
FROM BLSampleImageScore sc

api/src/Page/Sample.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -635,22 +635,6 @@ function _sub_samples()
635635
$third_inner_select_where = '';
636636
$args = array($this->proposalid);
637637

638-
if ($this->has_arg('s')) {
639-
$st = sizeof($args) + 1;
640-
$where .= " AND s.name LIKE CONCAT('%',:" . $st . ",'%')";
641-
array_push($args, $this->arg('s'));
642-
}
643-
644-
if ($this->has_arg('filter')) {
645-
$filters = array(
646-
'manual' => " AND ss.source='manual'",
647-
'auto' => " AND ss.source='auto'",
648-
'point' => " AND dp.experimentkind='SAD'",
649-
'region' => " AND dp.experimentkind='MESH'",
650-
);
651-
$where .= $filters[$this->arg('filter')];
652-
}
653-
654638
if ($this->has_arg('sid')) {
655639
$where .= ' AND s.blsampleid=:' . (sizeof($args) + 1);
656640
$first_inner_select_where .= ' AND s.blsampleid=:' . (sizeof($args) + 2);

client/src/css/partials/_imaging.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,3 @@ input[name=gap] {
226226
text-align: center;
227227
box-sizing: content-box;
228228
}
229-
230-
.plate-max-width {
231-
max-width: 700px;
232-
}

client/src/js/modules/imaging/views/queuecontainer.js

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ define(['marionette',
1212

1313
'modules/imaging/models/plan',
1414
'modules/imaging/collections/plans',
15-
'modules/shipment/views/plate',
1615

1716
'collections/beamlinesetups',
1817

@@ -28,7 +27,6 @@ define(['marionette',
2827
SubSamples,
2928
TableView, table, FilterView, utils,
3029
DiffractionPlan, DiffractionPlans,
31-
PlateView,
3230
BeamlineSetups,
3331
template, pointemplate, gridtemplate, xfetemplate,
3432
VMXiPoint, VMXiGrid, VMXiXFE,
@@ -362,6 +360,53 @@ define(['marionette',
362360
{id: 'manual', name: 'Manual' },
363361
],
364362

363+
initialize: function(options) {
364+
ClientFilterView.__super__.initialize.call(this, options)
365+
366+
this.filterablecollection = options.collection.fullCollection// || options.collection
367+
this.shadowCollection = this.filterablecollection.clone()
368+
369+
this.listenTo(this.filterablecollection, 'add', function (model, collection, options) {
370+
this.shadowCollection.add(model, options)
371+
})
372+
this.listenTo(this.filterablecollection, 'remove', function (model, collection, options) {
373+
this.shadowCollection.remove(model, options)
374+
})
375+
this.listenTo(this.filterablecollection, 'sort', function (col) {
376+
if (!this.query()) this.shadowCollection.reset(col.models)
377+
})
378+
this.listenTo(this.filterablecollection, 'reset', function (col, options) {
379+
options = _.extend({reindex: true}, options || {})
380+
if (options.reindex && options.from == null && options.to == null) {
381+
this.shadowCollection.reset(col.models)
382+
if (this.selected()) this._filter()
383+
}
384+
})
385+
},
386+
387+
_filter: function() {
388+
var id = this.selected()
389+
this.trigger('selected:change', id, this.selectedName())
390+
if (id) {
391+
this.filterablecollection.reset(this.shadowCollection.filter(function(m) {
392+
if (id === 'region') {
393+
return m.get('X2') && m.get('Y2')
394+
395+
} else if (id === 'point') {
396+
return m.get('X') && m.get('Y') && !m.get('X2')
397+
}
398+
else if (id === 'auto') {
399+
return m.get('SOURCE') == 'auto'
400+
401+
} else if (id === 'manual') {
402+
return m.get('SOURCE') == 'manual'
403+
}
404+
}), {reindex: false})
405+
} else {
406+
console.log('reset', this.shadowCollection)
407+
this.filterablecollection.reset(this.shadowCollection.models, {reindex: false})
408+
}
409+
}
365410
})
366411

367412

@@ -472,7 +517,6 @@ define(['marionette',
472517
qfilt: '.qfilt',
473518
afilt: '.afilt',
474519
rimg: '.image',
475-
plate: '.plate',
476520
},
477521

478522
events: {
@@ -729,20 +773,11 @@ define(['marionette',
729773
return this.ui.notcompleted.is(':checked') ? 1 : null
730774
},
731775

732-
getSearch: function() {
733-
return this.table.filter.query() || null
734-
},
735-
736-
getFilter: function() {
737-
return this.afilt.$el.find('.current').attr('id') || null
738-
},
739-
740776
refreshSubSamples: function() {
741777
this.subsamples.fetch().done(this.onSubsamplesReady.bind(this))
742778
},
743779

744-
initialize: function(options) {
745-
this.params = options.params
780+
initialize: function() {
746781
this._lastSample = null
747782
this._subsamples_ready = []
748783

@@ -752,9 +787,8 @@ define(['marionette',
752787
this.unfilteredSubsamples = null
753788
this.subsamples = new SubSamples()
754789
this.subsamples.queryParams.cid = this.model.get('CONTAINERID')
755-
if (this.params.s) this.subsamples.queryParams.s = this.params.s
756-
757790
this.subsamples.state.pageSize = 10
791+
758792
this._subsamples_ready.push(this.subsamples.fetch())
759793

760794
this.inspections = new ContainerInspections()
@@ -808,12 +842,6 @@ define(['marionette',
808842
}
809843
},
810844

811-
onSubsamplesReady: function() {
812-
this.getInspectionImages()
813-
this.refreshQSubSamples()
814-
this.listenTo(this.subsamples, 'change:isSelected', this.selectSubSample, this)
815-
this.listenTo(this.subsamples, 'sync add remove change:READYFORQUEUE', this.refreshQSubSamples, this)
816-
},
817845

818846
populatePresets: function() {
819847
this.ui.preset.html(this.plans.opts())
@@ -850,7 +878,7 @@ define(['marionette',
850878
},
851879

852880
selectSample: function() {
853-
if (this.subsamples.at(0)) this.subsamples.at(0).set({ isSelected: true })
881+
this.subsamples.at(0).set({ isSelected: true })
854882
},
855883

856884
refreshQSubSamples: function() {
@@ -874,8 +902,6 @@ define(['marionette',
874902
this.ui.unqueuebutton.hide()
875903
this.subsamples.queryParams.nodata = this.getNoData.bind(this)
876904
this.subsamples.queryParams.notcompleted = this.getNotCompleted.bind(this)
877-
this.subsamples.queryParams.s = this.getSearch.bind(this)
878-
this.subsamples.queryParams.filter = this.getFilter.bind(this)
879905
this._ready.done(this.doOnRender.bind(this))
880906
},
881907

@@ -901,8 +927,6 @@ define(['marionette',
901927
collection: this.subsamples,
902928
columns: subSamplesColumns,
903929
tableClass: 'subsamples',
904-
filter: 's',
905-
search: this.params.s,
906930
loading: true,
907931
backgrid: { row: ClickableRow, emptyText: 'No sub samples found' },
908932
noPageUrl: true,
@@ -968,29 +992,11 @@ define(['marionette',
968992
})
969993

970994
this.qsmps.show(this.table2)
971-
972-
this.plateView = new PlateView({ collection: this.subsamples.fullCollection, type: this.type, inspectionimages: this.inspectionimages, showMaxScore: true })
973-
this.listenTo(this.plateView, 'dropClicked', this.filterByLocation, this)
974-
this.plate.show(this.plateView)
975995
},
976996

977997
onShow: function() {
978998
this.rimg.show(this.image)
979999
},
980-
981-
filterByLocation: function(pos) {
982-
if (!pos) return;
983-
var namedrop = this.type.getName(pos)+'d'+this.type.getDrop(pos)
984-
if (this.table.filter.query() === namedrop) {
985-
this.table.filter.clearSearchBox()
986-
} else {
987-
this.table.filter.searchBox().val(namedrop)
988-
}
989-
this.table.filter._updateUrl()
990-
this.subsamples.fetch().done(this.selectSample.bind(this))
991-
var i = this.inspectionimages.findWhere({ LOCATION: pos.toString() })
992-
this.image.setModel(i)
993-
},
9941000

9951001
})
9961002

client/src/js/modules/shipment/components/container-queue-wrapper.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export default {
4343
},
4444
props: {
4545
'cid': Number,
46-
'search': String,
4746
},
4847
data: function() {
4948
return {
@@ -60,7 +59,6 @@ export default {
6059
options: function() {
6160
return {
6261
model: this.model,
63-
params: { s: this.search }
6462
}
6563
},
6664
proposalType : function() {
@@ -108,4 +106,4 @@ export default {
108106
}
109107
110108
}
111-
</script>
109+
</script>

client/src/js/modules/shipment/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ define(['utils/lazyrouter'], function(LazyRouter) {
1010
'shipments/pickup/sid/:sid': 'rebook_pickup',
1111

1212
'containers/cid/:cid(/iid/:iid)(/sid/:sid)': 'view_container',
13-
'containers/queue/:cid(/s/:s)': 'queue_container',
13+
'containers/queue/:cid': 'queue_container',
1414
'containers/add/did/:did': 'add_container',
1515
'containers/add/visit/:visit': 'add_container_visit',
1616
'containers(/s/:s)(/ty/:ty)(/page/:page)': 'container_list',
@@ -46,4 +46,4 @@ define(['utils/lazyrouter'], function(LazyRouter) {
4646
// controller: c
4747
rjsController: 'modules/shipment/controller',
4848
})
49-
})
49+
})

client/src/js/modules/shipment/routes.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,11 @@ const routes = [
353353
}
354354
},
355355
{
356-
path: '/containers/queue/:cid([0-9]+)(/s/)?:s([a-zA-Z0-9_-]+)?',
356+
path: '/containers/queue/:cid([0-9]+)',
357357
name: 'container-queue',
358358
component: ContainerQueueWrapper,
359359
props: route => ({
360360
cid: +route.params.cid,
361-
search: route.params.s || '',
362361
}),
363362
},
364363
{
@@ -538,4 +537,4 @@ const routes = [
538537
},
539538
]
540539

541-
export default routes
540+
export default routes

client/src/js/modules/shipment/views/plate.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,23 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
2929
e.preventDefault()
3030
var pos = this._xy_to_drop(utils.get_xy(e,this.$el))
3131
if (pos) {
32-
this.lastClickedDrop = pos
3332
var drop = this.collection.findWhere({ LOCATION: pos.toString() })
3433

3534
this.trigger('plate:select')
36-
this.trigger('dropClicked', pos)
3735
if (drop) drop.set('isSelected', true)
3836
this.drawPlate()
3937
}
4038
},
4139

4240
initialize: function(options) {
4341
this.pt = this.getOption('type')
44-
this.lastClickedDrop = null
4542
this.inspectionimages = options && options.inspectionimages
4643
if (this.inspectionimages) this.listenTo(this.inspectionimages, 'sync', this.render, this)
4744

4845
this.hover = {}
4946
this.showImageStatus = this.getOption('showImageStatus')
5047
this.showSampleStatus = this.getOption('showSampleStatus')
51-
this.showMaxScore = this.getOption('showMaxScore')
48+
this.showMaxScore = false
5249

5350
Backbone.Validation.bind(this, {
5451
collection: this.collection
@@ -190,7 +187,7 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
190187
var did = (k*this.pt.get('drop_per_well_x'))+j
191188
if (this.pt.get('well_drop') > -1) {
192189
if (did == this.pt.get('well_drop')) continue
193-
if (did > this.pt.get('well_drop')) did--;
190+
if (did > this.pt.get('well_drop')) did--;
194191
}
195192

196193
var sampleid = i*this.pt.dropTotal()+did+1
@@ -201,7 +198,6 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
201198

202199
this.ctx.beginPath()
203200
this.ctx.lineWidth = 1;
204-
205201
if (sample && sample.get('isSelected')) {
206202
this.ctx.strokeStyle = 'cyan'
207203

@@ -217,12 +213,7 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
217213
} else this.ctx.strokeStyle = '#ddd'
218214

219215
this.ctx.rect(this.pt.get('drop_offset_x')+this.pt.get('offset_x')+row*(this.pt.get('well_width')+this.pt.get('well_pad'))+(j*this.pt.get('drop_widthpx')+this.pt.get('drop_pad')), this.pt.get('drop_offset_y')+this.pt.get('offset_y')+col*(this.pt.get('well_height')+this.pt.get('well_pad'))+(k*this.pt.get('drop_heightpx')+this.pt.get('drop_pad')), this.pt.get('drop_widthpx'), this.pt.get('drop_heightpx'))
220-
221-
// Highlight last clicked drop
222-
if (sampleid == this.lastClickedDrop) {
223-
this.ctx.fillStyle = '#dddddd'
224-
this.ctx.fill()
225-
}
216+
226217

227218
// Highlight Hovered Sample
228219
if (this.hover == sampleid) {
@@ -243,7 +234,7 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
243234
this.ctx.fill()
244235
}
245236
}
246-
237+
247238
// Show status
248239
if (sample && this.showSampleStatus) {
249240
if (this.rankOption) {

client/src/js/templates/imaging/queuecontainer.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>Prepare Container for Data Collection</h1>
1818
<ul>
1919
<li>
2020
<span class="label">Container</span>
21-
<span class="NAME"><a href="/containers/cid/<%-CONTAINERID%>"><%-NAME%></a></span>
21+
<span class="NAME"><%-NAME%></span>
2222
</li>
2323

2424
<li>
@@ -28,8 +28,6 @@ <h1>Prepare Container for Data Collection</h1>
2828
</ul>
2929
</div>
3030

31-
<div class="plate plate-max-width"></div>
32-
3331
<h2>Available Samples</h2>
3432
<div class="filter">
3533
<span class="r">
@@ -40,7 +38,9 @@ <h2>Available Samples</h2>
4038
<li><label><input type="checkbox" name="nodata" /> Without Data</label></li>
4139
<li><label><input type="checkbox" name="notcompleted" /> Not Completed</label></li>
4240
</ul>
43-
<span class="filter filter-nohide afilt"></span>
41+
</div>
42+
<div class="filter">
43+
<div class="filter filter-nohide afilt"></div>
4444
</div>
4545
<div class="asamples"></div>
4646
</div>

0 commit comments

Comments
 (0)