Skip to content

Commit feca5b6

Browse files
authored
Merge pull request #669 from DiamondLightSource/revert-648-improvement/LIMS-759/show-multipin-sublocations
Revert "LIMS-759: Show multipin samples and their sublocations"
2 parents 6178a92 + 3ed619b commit feca5b6

File tree

6 files changed

+36
-57
lines changed

6 files changed

+36
-57
lines changed

api/src/Page/Sample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ function _samples()
11771177
$order = $cols[$this->arg('sort_by')] . ' ' . $dir;
11781178
}
11791179

1180-
$rows = $this->db->paginate("SELECT distinct b.blsampleid, b.crystalid, b.screencomponentgroupid, ssp.blsampleid as parentsampleid, ssp.name as parentsample, b.blsubsampleid, count(distinct si.blsampleimageid) as inspections, CONCAT(p.proposalcode,p.proposalnumber) as prop, b.code, b.location, b.sublocation, pr.acronym, pr.proteinid, cr.spacegroup,b.comments,b.name,s.shippingname as shipment,s.shippingid,d.dewarid,d.code as dewar, c.code as container, c.containerid, c.samplechangerlocation as sclocation, count(distinct IF(dc.overlap != 0,dc.datacollectionid,NULL)) as sc, count(distinct IF(dc.overlap = 0 AND dc.axisrange = 0,dc.datacollectionid,NULL)) as gr, count(distinct IF(dc.overlap = 0 AND dc.axisrange > 0,dc.datacollectionid,NULL)) as dc, count(distinct IF(dcg.experimenttype LIKE 'XRF map', dc.datacollectionid, NULL)) as xm, count(distinct IF(dcg.experimenttype LIKE 'XRF spectrum', dc.datacollectionid, NULL)) as xs, count(distinct IF(dcg.experimenttype LIKE 'Energy scan', dc.datacollectionid, NULL)) as es, count(distinct so.screeningid) as ai, count(distinct app.autoprocprogramid) as ap, count(distinct r.robotactionid) as r, round(min(st.rankingresolution),2) as scresolution, max(ssw.completeness) as sccompleteness, round(min(apss.resolutionlimithigh),2) as dcresolution, round(max(apss.completeness),1) as dccompleteness, dp.anomalousscatterer, dp.requiredresolution, cr.cell_a, cr.cell_b, cr.cell_c, cr.cell_alpha, cr.cell_beta, cr.cell_gamma, b.packingfraction, b.dimension1, b.dimension2, b.dimension3, b.shape, cr.color, cr.theoreticaldensity, cr.name as crystal, pr.name as protein, b.looptype, dp.centringmethod, dp.experimentkind, cq.containerqueueid, TO_CHAR(cq.createdtimestamp, 'DD-MM-YYYY HH24:MI') as queuedtimestamp
1180+
$rows = $this->db->paginate("SELECT distinct b.blsampleid, b.crystalid, b.screencomponentgroupid, ssp.blsampleid as parentsampleid, ssp.name as parentsample, b.blsubsampleid, count(distinct si.blsampleimageid) as inspections, CONCAT(p.proposalcode,p.proposalnumber) as prop, b.code, b.location, pr.acronym, pr.proteinid, cr.spacegroup,b.comments,b.name,s.shippingname as shipment,s.shippingid,d.dewarid,d.code as dewar, c.code as container, c.containerid, c.samplechangerlocation as sclocation, count(distinct IF(dc.overlap != 0,dc.datacollectionid,NULL)) as sc, count(distinct IF(dc.overlap = 0 AND dc.axisrange = 0,dc.datacollectionid,NULL)) as gr, count(distinct IF(dc.overlap = 0 AND dc.axisrange > 0,dc.datacollectionid,NULL)) as dc, count(distinct IF(dcg.experimenttype LIKE 'XRF map', dc.datacollectionid, NULL)) as xm, count(distinct IF(dcg.experimenttype LIKE 'XRF spectrum', dc.datacollectionid, NULL)) as xs, count(distinct IF(dcg.experimenttype LIKE 'Energy scan', dc.datacollectionid, NULL)) as es, count(distinct so.screeningid) as ai, count(distinct app.autoprocprogramid) as ap, count(distinct r.robotactionid) as r, round(min(st.rankingresolution),2) as scresolution, max(ssw.completeness) as sccompleteness, round(min(apss.resolutionlimithigh),2) as dcresolution, round(max(apss.completeness),1) as dccompleteness, dp.anomalousscatterer, dp.requiredresolution, cr.cell_a, cr.cell_b, cr.cell_c, cr.cell_alpha, cr.cell_beta, cr.cell_gamma, b.packingfraction, b.dimension1, b.dimension2, b.dimension3, b.shape, cr.color, cr.theoreticaldensity, cr.name as crystal, pr.name as protein, b.looptype, dp.centringmethod, dp.experimentkind, cq.containerqueueid, TO_CHAR(cq.createdtimestamp, 'DD-MM-YYYY HH24:MI') as queuedtimestamp
11811181
, $cseq $sseq string_agg(cpr.name) as componentnames, string_agg(cpr.density) as componentdensities
11821182
,string_agg(cpr.proteinid) as componentids, string_agg(cpr.acronym) as componentacronyms, string_agg(cpr.global) as componentglobals, string_agg(chc.abundance) as componentamounts, string_agg(ct.symbol) as componenttypesymbols, b.volume, pct.symbol,ROUND(cr.abundance,3) as abundance, TO_CHAR(b.recordtimestamp, 'DD-MM-YYYY') as recordtimestamp, dp.radiationsensitivity, dp.energy, dp.userpath, dp.strategyoption, dp.minimalresolution as minimumresolution
11831183
,count(distinct dc.dataCollectionId) as dcc

client/src/js/app/store/modules/store.samples.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const INITIAL_SAMPLE_STATE = {
4747
SAMPLEGROUP: '',
4848
INITIALSAMPLEGROUP: '',
4949
STATUS: '',
50-
SUBLOCATION: null,
5150
}
5251

5352
// Use Location as idAttribute for this table
@@ -96,35 +95,26 @@ const samplesModule = {
9695
setSample(state, { data, index }) {
9796
if (index < state.samples.length) state.samples.splice(index, 1, data)
9897
},
99-
// For each sample put it in the correct place, based on location & sublocation, in the capacity array
98+
// For each sample put it in the correct place, based on location, in the capacity array
10099
setAllSamples(state, {capacity, samples}) {
101100

102-
const state_samples = Array.from({ length: capacity*10 }, (_, i) => new LocationSample({
101+
const state_samples = Array.from({ length: capacity }, (_, i) => new LocationSample({
103102
BLSAMPLEID: null,
104-
LOCATION: (parseInt(i/10) + 1).toString(),
105-
INDEX: i,
103+
LOCATION: (i + 1).toString(),
106104
PROTEINID: -1,
107105
CRYSTALID: -1,
108106
new: true
109107
}))
110-
111108
if (samples) {
112109
for (let sample of samples) {
113-
const index = 10*(Number(sample.LOCATION)-1)+Number(sample.SUBLOCATION)
114-
sample.INDEX = index
115-
if (index < capacity*10) {
110+
const index = Number(sample.LOCATION)-1
111+
if (index < capacity) {
116112
state_samples[index] = sample
117113
}
118114
}
119115
}
120116
state.samplesCollection.reset(state_samples)
121-
state.samples = state.samplesCollection.toJSON().filter(function(e, i, a) {
122-
if (e.BLSAMPLEID) { return true }
123-
for (var j of a) {
124-
if (j.BLSAMPLEID && j.LOCATION === e.LOCATION) { return false }
125-
}
126-
return true
127-
})
117+
state.samples = state.samplesCollection.toJSON().filter(() => { return true })
128118
},
129119
clearSample(state, index) {
130120
if (index < state.samples.length) state.samples.splice(index, 1, {
@@ -166,7 +156,7 @@ const samplesModule = {
166156
// Convert our samples json to a backbone collection
167157
state.samples.map(s => {
168158
s.CONTAINERID = containerId
169-
let locationIndex = +s.INDEX
159+
let locationIndex = +(s.LOCATION - 1)
170160
let proteinId = +s.PROTEINID
171161
if (proteinId > 0 && s.NAME !== '') {
172162
state.samplesCollection.at(locationIndex).set(s)
@@ -184,6 +174,7 @@ const samplesModule = {
184174
const oldSamplesCollection = new Samples()
185175

186176
state.samples.forEach(sample => {
177+
// const locationIndex = +sample['LOCATION'] - 1
187178
if (sample['PROTEINID'] && sample['NAME'] && sample['BLSAMPLEID']) {
188179
oldSamplesCollection.add(sample)
189180
}

client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ export default {
188188
title: 'Loc',
189189
className: 'location-column'
190190
},
191-
{
192-
key: 'SUBLOCATION',
193-
title: 'Sub',
194-
className: 'sublocation-column'
195-
},
196191
{
197192
key: 'ACRONYM',
198193
title: 'Protein Acronym',
@@ -547,4 +542,4 @@ export default {
547542
.min-height-8 {
548543
min-height: 32px;
549544
}
550-
</style>
545+
</style>

client/src/js/modules/types/mx/samples/sample-table-mixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default {
209209
editRow(row) {
210210
this.editingSample = row;
211211
this.editingSample.CONTAINERID = this.containerId;
212-
this.$emit('update-editing-row', row.INDEX)
212+
this.$emit('update-editing-row', row.LOCATION)
213213
},
214214
formatSelectData(selectData, data, property) {
215215
const matchedSelectData = selectData.find(select => select.value === data[property])

client/src/js/modules/types/mx/samples/sample-table-row.vue

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@
1111
{{ sample.LOCATION || sampleIndex + 1 }}
1212
</div>
1313

14-
<div class="sublocation-column tw-text-center tw-py-1">
15-
{{ sample.SUBLOCATION }}
16-
</div>
17-
1814
<validation-provider
1915
v-slot="{ errors }"
2016
class="tw-px-2 protein-column tw-py-1"
2117
tag="div"
22-
:rules="sample['NAME'] && (!containerId || editingRow === sample['INDEX']) ? 'required' : ''"
18+
:rules="sample['NAME'] && (!containerId || editingRow === sample['LOCATION']) ? 'required' : ''"
2319
:name="`Sample ${sampleIndex + 1} Protein`"
2420
:vid="`sample ${sampleIndex + 1} protein`"
2521
>
2622
<combo-box
2723
v-model="PROTEINID"
28-
:is-disabled="!canEditRow(sample['INDEX'], editingRow) || isContainerProcessing || sampleHasDataCollection"
24+
:is-disabled="!canEditRow(sample['LOCATION'], editingRow) || isContainerProcessing || sampleHasDataCollection"
2925
:data="proteinsOptionsList"
3026
class="tw-w-full protein-select"
3127
dataTestId="add-container-protein-select"
@@ -54,12 +50,12 @@
5450
v-slot="{ errors }"
5551
tag="div"
5652
class="name-column tw-py-1 tw-px-2"
57-
:rules="sample['PROTEINID'] > -1 && (!containerId || editingRow === sample['INDEX']) ? 'required|alpha_dash|max:25|' : ''"
53+
:rules="sample['PROTEINID'] > -1 && (!containerId || editingRow === sample['LOCATION']) ? 'required|alpha_dash|max:25|' : ''"
5854
:name="`Sample ${sampleIndex + 1} Name`"
5955
:vid="`sample ${sampleIndex + 1} name`"
6056
>
6157
<base-input-text
62-
:disabled="!canEditRow(sample['INDEX'], editingRow) || isContainerProcessing || sampleHasDataCollection"
58+
:disabled="!canEditRow(sample['LOCATION'], editingRow) || isContainerProcessing || sampleHasDataCollection"
6359
v-model.trim="NAME"
6460
input-class="tw-w-full tw-h-8"
6561
:error-message="errors[0]"
@@ -79,7 +75,7 @@
7975
<template #default="{ errors, inputChanged }">
8076
<combo-box
8177
v-model="SAMPLEGROUP"
82-
:is-disabled="!canEditRow(sample['INDEX'], editingRow) || sampleGroupInputDisabled"
78+
:is-disabled="!canEditRow(sample['LOCATION'], editingRow) || sampleGroupInputDisabled"
8379
:data="sampleGroups"
8480
text-field="text"
8581
value-field="value"
@@ -106,7 +102,7 @@
106102

107103
<div class="actions-column tw-py-1 tw-text-right">
108104
<span v-if="containerId">
109-
<span v-if="editingRow === sample['INDEX']">
105+
<span v-if="editingRow === sample['LOCATION']">
110106
<a
111107
class="button tw-cursor-pointer "
112108
@click="$emit('save-sample', sampleIndex)"
@@ -218,9 +214,6 @@ export default {
218214
.location-column {
219215
width: 30px;
220216
}
221-
.sublocation-column {
222-
width: 30px;
223-
}
224217
.protein-column {
225218
width: 15%;
226219
}

client/src/js/modules/types/mx/samples/tabbed-columns-view.vue

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<template #default="{ errors, inputChanged }">
1515
<base-input-select
1616
v-model="ANOMALOUSSCATTERER"
17-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
17+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
1818
:options="anomalousOptionsList"
1919
input-class="tw-w-full tw-h-8"
2020
option-value-key="value"
@@ -36,7 +36,7 @@
3636
<template #default="{ errors, inputChanged }">
3737
<base-input-text
3838
v-model="CODE"
39-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
39+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
4040
input-class="tw-w-full tw-h-8"
4141
@value-changed="inputChanged"
4242
/>
@@ -52,7 +52,7 @@
5252
<template #default="{ errors, inputChanged }">
5353
<base-input-text
5454
v-model="COMMENTS"
55-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
55+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
5656
input-class="tw-w-full tw-h-8"
5757
@value-changed="inputChanged"
5858
dataTestId="add-container-sample-comment"
@@ -89,7 +89,7 @@
8989
<template #default="{ errors, inputChanged }">
9090
<base-input-text
9191
v-model="USERPATH"
92-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
92+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
9393
input-class="tw-w-full tw-h-8"
9494
:error-message="errors[0]"
9595
:quiet="true"
@@ -108,7 +108,7 @@
108108
<template #default="{errors, inputChanged}">
109109
<base-input-select
110110
v-model="SPACEGROUP"
111-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
111+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
112112
:options="spaceGroupList"
113113
option-value-key="value"
114114
option-text-key="text"
@@ -134,7 +134,7 @@
134134
<template #default="{errors, inputChanged}">
135135
<base-input-text
136136
v-model="CELL_A"
137-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
137+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
138138
placeholder-text="A"
139139
:quiet="true"
140140
type="number"
@@ -157,7 +157,7 @@
157157
<template #default="{ errors, inputChanged }">
158158
<base-input-text
159159
v-model="CELL_B"
160-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
160+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
161161
placeholder-text="B"
162162
:quiet="true"
163163
type="number"
@@ -180,7 +180,7 @@
180180
<template #default="{errors, inputChanged}">
181181
<base-input-text
182182
v-model="CELL_C"
183-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
183+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
184184
placeholder-text="C"
185185
input-class="tw-w-12 tw-h-8 tabbed-sample-column"
186186
type="number"
@@ -206,7 +206,7 @@
206206
<template #default="{errors, inputChanged}">
207207
<base-input-text
208208
v-model="CELL_ALPHA"
209-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
209+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
210210
placeholder-text="α"
211211
input-class="tw-w-12 tw-h-8 tabbed-sample-column"
212212
:quiet="true"
@@ -229,7 +229,7 @@
229229
<template #default="{ errors, inputChanged }">
230230
<base-input-text
231231
v-model="CELL_BETA"
232-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
232+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
233233
placeholder-text="β"
234234
input-class="tw-w-12 tw-h-8 tabbed-sample-column"
235235
type="number"
@@ -252,7 +252,7 @@
252252
<template #default="{errors, inputChanged}">
253253
<base-input-text
254254
v-model="CELL_GAMMA"
255-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
255+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
256256
placeholder-text="γ"
257257
input-class="tw-w-12 tw-h-8 tabbed-sample-column"
258258
type="number"
@@ -282,7 +282,7 @@
282282
<template #default="{errors, inputChanged }">
283283
<base-input-select
284284
v-model="CENTRINGMETHOD"
285-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
285+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
286286
:options="centringMethodList"
287287
option-value-key="value"
288288
option-text-key="text"
@@ -305,7 +305,7 @@
305305
<template #default="{errors, inputChanged}">
306306
<base-input-select
307307
v-model="EXPERIMENTKIND"
308-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
308+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
309309
:options="experimentKindList"
310310
input-class="tw-w-full tw-h-8"
311311
option-value-key="value"
@@ -328,7 +328,7 @@
328328
<template #default="{errors, inputChanged }">
329329
<base-input-text
330330
v-model="ENERGY"
331-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
331+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
332332
input-class="tw-w-full tw-h-8 tabbed-sample-column"
333333
type="number"
334334
:step="1"
@@ -350,7 +350,7 @@
350350
<template #default="{ errors, inputChanged }">
351351
<base-input-select
352352
v-model="ANOMALOUSSCATTERER"
353-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
353+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
354354
:options="anomalousOptionsList"
355355
option-value-key="value"
356356
input-class="tw-w-full tw-h-8"
@@ -372,7 +372,7 @@
372372
<template #default="{ errors, inputChanged }">
373373
<base-input-select
374374
v-model="SCREENINGMETHOD"
375-
:is-disabled="!canEditRow(sample['INDEX'], currentEditingRow)"
375+
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
376376
:options="screeningMethodList"
377377
option-value-key="value"
378378
option-text-key="text"
@@ -395,7 +395,7 @@
395395
<template #default="{ errors, inputChanged}">
396396
<base-input-text
397397
v-model="REQUIREDRESOLUTION"
398-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'none'"
398+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'none'"
399399
type="number"
400400
:step="1"
401401
input-class="tw-w-full tw-h-8 tabbed-sample-column"
@@ -417,7 +417,7 @@
417417
<template #default="{ errors, inputChanged }">
418418
<base-input-text
419419
v-model="MINIMUMRESOLUTION"
420-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'all'"
420+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'all'"
421421
type="number"
422422
:step="1"
423423
input-class="tw-w-full tw-h-8 tabbed-sample-column"
@@ -439,7 +439,7 @@
439439
<template #default="{ errors, inputChanged}">
440440
<base-input-text
441441
v-model="SCREENINGCOLLECTVALUE"
442-
:disabled="!canEditRow(sample['INDEX'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'best'"
442+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow) || sample['SCREENINGMETHOD'] !== 'best'"
443443
type="number"
444444
:step="1"
445445
input-class="tw-w-full tw-h-8 tabbed-sample-column"

0 commit comments

Comments
 (0)