Skip to content

LIMS-2159: Allow CSV upload of ligands#1065

Merged
ndg63276 merged 3 commits intopre-release/2026-R2.4from
improvement/LIMS-2159/allow-csv-upload-of-ligands
May 1, 2026
Merged

LIMS-2159: Allow CSV upload of ligands#1065
ndg63276 merged 3 commits intopre-release/2026-R2.4from
improvement/LIMS-2159/allow-csv-upload-of-ligands

Conversation

@ndg63276
Copy link
Copy Markdown
Collaborator

JIRA ticket: LIMS-2159

Summary:

Add a CSV uploader for ligands. As ligand info often comes in a fairly rich spreadsheet, we should be quite flexible with column names.

Changes:

  • Fix page count and sorting of ligands on ligand view page, allow searching by fields other than 'name'
  • Allow adding of multiple ligands in a loop in the backend
  • Enforce install of papaparse library to inspect CSV files (previously installed as a dependency of csv-file-validator anyway)
  • Add a radio box to switch between CSV upload and single mode on the ligand add page
  • Make different fields compulsory in each mode
  • Parse the header lines in the CSV to try to get "Name", "Source Well" and "SMILES" columns, or similarly named ones
  • Display errors if found, add notification on upload success, and redirect to the View Ligands page

To test:

  • Go to any proposal (eg mx23694), go to Ligands in the main menu, then click Add Ligand(s) to go to /ligands/add
  • Choose "Add a Single Ligand" and fill in the name field and any others you fancy, click Add Ligand(s) and check you are redirected to a view of your ligand
  • Go back to /ligands/add, and choose CSV Upload. Check only 3 text boxes remain visible (and are compulsory), as well as the file selection box
  • Go to LIMS-1052 and download any of the spreadsheet files (except Euopen_screen_with_smiles.xlsx), then export it to CSV
  • Select the CSV on the /ligands/add page, check no errors occur. Click Add Ligand(s) and check it uploads ok, and you are taken to the View all Ligands page
  • Check searching for Ligands and ordering by clicking on the headers works ok
  • Delete the Name or SMILES code from one line of your CSV, and then try to re-select it on the Add Ligands page, check your are shown an error explaining which line number has a problem

@gfrn
Copy link
Copy Markdown
Collaborator

gfrn commented Apr 28, 2026

It seems to work OK, but it times out whenever I upload a CSV. It still comes through, but I don't get redirected at the end

Comment thread api/src/Page/Sample.php Outdated
Comment thread client/src/js/modules/samples/views/ligandadd.js Outdated
Comment thread client/src/js/modules/samples/views/ligandadd.js Outdated
@ndg63276 ndg63276 changed the base branch from master to pre-release/2026-R2.4 May 1, 2026 13:23
@ndg63276 ndg63276 merged commit cd857c0 into pre-release/2026-R2.4 May 1, 2026
2 checks passed
@ndg63276 ndg63276 deleted the improvement/LIMS-2159/allow-csv-upload-of-ligands branch May 1, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants