DiamondLightSource / SynchWeb

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

LIMS-1341: Allow entry of SMILES codes #793

Closed ndg63276 closed 1 month ago

ndg63276 commented 2 months ago

JIRA ticket: LIMS-1341

Summary:

Add an editable box for SMILES code. Regex is fun as lots of characters are allowed, see https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system

Changes:

To test:

gfrn commented 2 months ago

All tests pass! However, there is no indication to the user that a name is invalid, that is, the PATCH request goes through "fine" (200 from something like &28*&£%abc), but the SMILES field gets ignored in the backend. Would it be useful to add a frontend check as well, or return a 400/422 from the backend if the SMILES code is bad?

ndg63276 commented 2 months ago

Good point, I was so focussed on what was allowed I forgot to check what wasn't.

Have added a front end validation step.