Skip to content

Commit 9618abb

Browse files
ndg63276Mark Williams
andauthored
LIMS-2016: Only check snapshot images for data collections (#1017)
* LIMS-2016: Only check snapshot images for data collections * LIMS-2016: Simplify proposal check * LIMS-2016: Add fix for projects view --------- Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent 08afdf0 commit 9618abb

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

api/src/Page/DC.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,13 @@ function _chk_image()
11061106
return;
11071107
}
11081108

1109+
if (!$this->has_arg('pjid')) {
1110+
array_push($ids, $this->proposalid);
1111+
$where .= ' AND p.proposalid=:'.sizeof($ids);
1112+
}
1113+
11091114
$dct = $this->db->pq("SELECT CONCAT(p.proposalcode, p.proposalnumber, '-', s.visit_number) as vis, dc.datacollectionid as id, dc.startimagenumber, dc.filetemplate, dc.xtalsnapshotfullpath1 as x1, dc.xtalsnapshotfullpath2 as x2, dc.xtalsnapshotfullpath3 as x3, dc.xtalsnapshotfullpath4 as x4,dc.imageprefix as imp, dc.datacollectionnumber as run, dc.imagedirectory as dir, s.visit_number
1110-
FROM datacollection dc
1115+
FROM datacollection dc
11111116
INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid
11121117
INNER JOIN blsession s ON s.sessionid = dcg.sessionid
11131118
INNER JOIN proposal p ON p.proposalid = s.proposalid WHERE $where", $ids);

client/src/js/modules/dc/dclist.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
define(['marionette',
2-
//'modules/dc/views/imagestatuscollection',
3-
//'modules/dc/views/apstatuscollection',
42
'modules/dc/collections/imagestatuses',
53
'modules/dc/collections/apstatuses',
64
'modules/dc/collections/apmessagestatuses',
@@ -68,8 +66,16 @@ function(Marionette,
6866
},
6967

7068
_onSync: function() {
71-
var ids = this.collection.pluck('ID')
72-
this.imagestatuses.fetch({ data: { ids: ids }, type: 'POST' })
69+
var ids = this.collection
70+
.filter(m => m.get('TYPE') === 'data' || m.get('TYPE') === 'grid')
71+
.map(m => m.get('ID'));
72+
var data = { ids: ids }
73+
var params = this.getOption('params') || {};
74+
if (params.pjid != null) {
75+
data.pjid = params.pjid
76+
}
77+
if (!ids.length) return
78+
this.imagestatuses.fetch({ data: data, type: 'POST' })
7379
if (this.getOption('apStatus')) this.apstatuses.fetch({ data: { ids: ids }, type: 'POST' })
7480
if (this.getOption('apMessageStatus')) this.apmessagestatuses.fetch({ data: { ids: ids }, type: 'POST' })
7581
},

client/src/js/modules/projects/views/view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ define(['marionette',
105105
edit.create('ACRONYM', 'text')
106106
}
107107

108-
this.dc.show(new DCView({ model: this.model, collection: this.dcs, params: { visit: null }, noPageUrl: true, noFilterUrl: true, noSearchUrl: true }))
108+
this.dc.show(new DCView({ model: this.model, collection: this.dcs, params: { visit: null, pjid: this.model.get('PROJECTID') }, noPageUrl: true, noFilterUrl: true, noSearchUrl: true }))
109109
this.smp.show(new SampleList({ collection: this.samples, noPageUrl: true, noFilterUrl: true, noSearchUrl: true }))
110110
this.prt.show(new ProteinList({ collection: this.proteins, noPageUrl: true, noSearchUrl: true }))
111111

0 commit comments

Comments
 (0)