DiamondLightSource / SynchWeb

ISPyB web application
http://diamondlightsource.github.io/SynchWeb/
Apache License 2.0
15 stars 31 forks source link

LIMS-1200: CSV file upload ignores first sample #737

Closed ndg63276 closed 4 months ago

ndg63276 commented 6 months ago

JIRA ticket: LIMS-1200

Summary:

One way to create multiple simple samples (for XPDF) is to upload a CSV file. A header row is compulsory and provided in the template, and is stripped by the CSV file library. However, the Synchweb code also strips the first subsequent row, meaning the first user sample is ignored.

Changes:

To test:

gfrn commented 4 months ago

May I suggest we include a change to line 729 of vue-simplesample.vue as well? It throws an error if csvData has a length of one, which also prevents users from uploading a single simple sample.

My suggestion is to make line 729 the following:

if(self.csvData.length < 1 && self.csvErrors.length === 0){
    self.csvErrors.push("Only headers have been submitted, please add some sample information")
}

I'm happy to make a PR for this PR if that's not a problem

(To reproduce this issue, repeat all steps in the original PR description, but use simple_sample_csv_template(1).csv instead)

ndg63276 commented 4 months ago

Yep, good spot! Have added that fix.