diff --git a/api/src/Page/Sample.php b/api/src/Page/Sample.php index 4c7bdebe7..b9f4bce38 100644 --- a/api/src/Page/Sample.php +++ b/api/src/Page/Sample.php @@ -1177,7 +1177,7 @@ function _samples() $order = $cols[$this->arg('sort_by')] . ' ' . $dir; } - $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 + $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 , $cseq $sseq string_agg(cpr.name) as componentnames, string_agg(cpr.density) as componentdensities ,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 ,count(distinct dc.dataCollectionId) as dcc diff --git a/client/src/js/app/store/modules/store.samples.js b/client/src/js/app/store/modules/store.samples.js index 9341d49a3..d8d07935f 100644 --- a/client/src/js/app/store/modules/store.samples.js +++ b/client/src/js/app/store/modules/store.samples.js @@ -47,7 +47,6 @@ const INITIAL_SAMPLE_STATE = { SAMPLEGROUP: '', INITIALSAMPLEGROUP: '', STATUS: '', - SUBLOCATION: null, } // Use Location as idAttribute for this table @@ -96,35 +95,26 @@ const samplesModule = { setSample(state, { data, index }) { if (index < state.samples.length) state.samples.splice(index, 1, data) }, - // For each sample put it in the correct place, based on location & sublocation, in the capacity array + // For each sample put it in the correct place, based on location, in the capacity array setAllSamples(state, {capacity, samples}) { - const state_samples = Array.from({ length: capacity*10 }, (_, i) => new LocationSample({ + const state_samples = Array.from({ length: capacity }, (_, i) => new LocationSample({ BLSAMPLEID: null, - LOCATION: (parseInt(i/10) + 1).toString(), - INDEX: i, + LOCATION: (i + 1).toString(), PROTEINID: -1, CRYSTALID: -1, new: true })) - if (samples) { for (let sample of samples) { - const index = 10*(Number(sample.LOCATION)-1)+Number(sample.SUBLOCATION) - sample.INDEX = index - if (index < capacity*10) { + const index = Number(sample.LOCATION)-1 + if (index < capacity) { state_samples[index] = sample } } } state.samplesCollection.reset(state_samples) - state.samples = state.samplesCollection.toJSON().filter(function(e, i, a) { - if (e.BLSAMPLEID) { return true } - for (var j of a) { - if (j.BLSAMPLEID && j.LOCATION === e.LOCATION) { return false } - } - return true - }) + state.samples = state.samplesCollection.toJSON().filter(() => { return true }) }, clearSample(state, index) { if (index < state.samples.length) state.samples.splice(index, 1, { @@ -166,7 +156,7 @@ const samplesModule = { // Convert our samples json to a backbone collection state.samples.map(s => { s.CONTAINERID = containerId - let locationIndex = +s.INDEX + let locationIndex = +(s.LOCATION - 1) let proteinId = +s.PROTEINID if (proteinId > 0 && s.NAME !== '') { state.samplesCollection.at(locationIndex).set(s) @@ -184,6 +174,7 @@ const samplesModule = { const oldSamplesCollection = new Samples() state.samples.forEach(sample => { + // const locationIndex = +sample['LOCATION'] - 1 if (sample['PROTEINID'] && sample['NAME'] && sample['BLSAMPLEID']) { oldSamplesCollection.add(sample) } diff --git a/client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue b/client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue index 8b5aafd0d..e6bdc0523 100644 --- a/client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue +++ b/client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue @@ -188,11 +188,6 @@ export default { title: 'Loc', className: 'location-column' }, - { - key: 'SUBLOCATION', - title: 'Sub', - className: 'sublocation-column' - }, { key: 'ACRONYM', title: 'Protein Acronym', @@ -547,4 +542,4 @@ export default { .min-height-8 { min-height: 32px; } - + \ No newline at end of file diff --git a/client/src/js/modules/types/mx/samples/sample-table-mixin.js b/client/src/js/modules/types/mx/samples/sample-table-mixin.js index e1a340547..6e02bdd31 100644 --- a/client/src/js/modules/types/mx/samples/sample-table-mixin.js +++ b/client/src/js/modules/types/mx/samples/sample-table-mixin.js @@ -209,7 +209,7 @@ export default { editRow(row) { this.editingSample = row; this.editingSample.CONTAINERID = this.containerId; - this.$emit('update-editing-row', row.INDEX) + this.$emit('update-editing-row', row.LOCATION) }, formatSelectData(selectData, data, property) { const matchedSelectData = selectData.find(select => select.value === data[property]) diff --git a/client/src/js/modules/types/mx/samples/sample-table-row.vue b/client/src/js/modules/types/mx/samples/sample-table-row.vue index 6c9a7b4db..481a236e6 100644 --- a/client/src/js/modules/types/mx/samples/sample-table-row.vue +++ b/client/src/js/modules/types/mx/samples/sample-table-row.vue @@ -11,21 +11,17 @@ {{ sample.LOCATION || sampleIndex + 1 }} -
- {{ sample.SUBLOCATION }} -
- - + @@ -52,7 +52,7 @@