Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-980: Add all samples to queue should obey filters #707

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/src/Page/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class Sample extends Page
'UNQUEUE' => '\d',
'nodata' => '\d',
'notcompleted' => '\d',
'filter' => '\w+',

// external is a flag to indicate this protein/sample has a user office system id
// whereas externalid is the actual reference
Expand Down Expand Up @@ -594,6 +595,17 @@ function _queue_all_sub_samples()

$args = array($this->proposalid, $this->arg('cid'), $this->arg('cid'), $this->arg('cid'));
$where = ' AND c.containerid=:2 AND cq2.completedtimestamp IS NULL';

if ($this->has_arg('filter')) {
$filters = array(
'manual' => " AND ss.source='manual'",
'auto' => " AND ss.source='auto'",
'point' => " AND dp.experimentkind='SAD'",
'region' => " AND dp.experimentkind='MESH'",
);
$where .= $filters[$this->arg('filter')];
}

$first_inner_select_where = ' AND s.containerid=:3';
$second_inner_select_where = ' AND s.containerid=:4';

Expand Down
8 changes: 7 additions & 1 deletion client/src/js/modules/imaging/views/queuecontainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,18 @@ define(['marionette',
queueAllSamples: function(e) {
e.preventDefault()

const data = {}
current = this.$el.find('.afilt').find('.current')
if (current.length > 0) {
data.filter = current.attr('id')
}

var self = this
this.$el.addClass('loading');
Backbone.ajax({
url: app.apiurl+'/sample/sub/queue/cid/'+this.model.get('CONTAINERID'),
method: "post",
data: {},
data: data,
success: function(resp) {
_.each(resp, function (r) {
var ss = self.subsamples.fullCollection.findWhere({ BLSUBSAMPLEID: r.BLSUBSAMPLEID })
Expand Down
Loading