-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(website): Add new form to submit individual sequences #3710
base: main
Are you sure you want to change the base?
Conversation
6e00612
to
5dd4bf5
Compare
website/src/components/Submission/FileUpload/FileUploadComponent.tsx
Outdated
Show resolved
Hide resolved
1a4178f
to
f52fc56
Compare
just quickly tested this. I think that it is a bit surprising to land on the submission form for a single sequence by default. I would keep the default as the file upload and suggest that prominent button something with something like "Single sequence submission via form" takes you to the form. |
website/src/components/Submission/FileUpload/SequenceEntryUploadComponent.tsx
Outdated
Show resolved
Hide resolved
I couldn't reproduce this - my theory is it must have been about some field rather than the sequences
These text fields for sequences are definitely really problematic. I mostly of think they should in the more final version be file upload components (for the one segment). Copying and pasting sequences feels generally bad practice? |
I made some UX suggestions at https://subform2.loculus.org/cchf/submission/1/submit (username: superuser, pw: superuser) for some future version of this (some after this PR), which I've also mentioned on Slack. |
Definitely reproducible for me in CCHF |
Might have been because my sequences included a fasta header. Seems to work without fasta header. |
74a7377
to
5b00d6a
Compare
Thanks for your input! I quite like your suggestions Theo, I think I'd maybe just merge them in? For the sequence fields, maybe we can look into doing already client-side validation, so the users can't submit incorrect characters - or at least, showhow show a better error message. |
OK yeah so I think what's happening here is that the whole sequence is being interpreted as the FASTA header My own preferred way forward on this (and related issues) would be to create a new high priority issue to change all these sequence input text-boxes to |
9346e69
to
0aaf16b
Compare
Since this PR is already quite large, I have made an issue for follow up changes to the form itself: #3740 I want to keep this PR to just the initial creation of the single-sequence submission feature, and the refactoring of the internal components. IMO it'll be easier to review that way. |
1a26723
to
7d81b49
Compare
7d81b49
to
167f747
Compare
|
||
1. Log into your account, and then click 'Submit' in the top-right corner of the website. | ||
2. Select the organism that you'd like to submit sequences for. | ||
3. Click on 'Submit single sequence'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(we should update this)
Co-authored-by: Theo Sanderson <[email protected]>
Co-authored-by: Theo Sanderson <[email protected]>
@@ -6,10 +6,11 @@ import NeedToLogin from '../common/NeedToLogin.astro'; | |||
|
|||
interface Props { | |||
title: string; | |||
disablePageTitle?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nbd but I guess this may not be needed any more? But it's fine if you want to keep it anyway
* In 'form' mode, a form is displayed, and the user can directly enter stuff into the form to upload their | ||
* metadata. In 'bulk' mode, the user needs to upload files containing the sequences and metadata. | ||
* Either way, the component turns the uploaded data into files, so they can be submitted to the API. | ||
* Set the 'fileCreatorSetter' to get the files - have a look at existing usage on how this works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be setFileFactory
?
const [columnMapping, setColumnMapping] = useState<ColumnMapping | null>(null); | ||
|
||
useEffect(() => { | ||
setFileFactory(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I really understand this (which isn't a huge problem). Could you explain a bit about why this works like this (in this thread, not in code necessarily)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be nice to split some of these components into separate files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked a question below about why we've moved to the "factory" model but it may actuallly be easier discussed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together! Looks great
As we've discussed, the sequence input is very suboptimal (as it is on the edit page) but we want to tackle this as the next PR in this theme.
I'd like to understand why we have this slightly concept logic with a "factory" that's the main remaining thing that I'd like to get my head around
resolves #3226
resolves #3722
preview URL: https://submission-via-form.loculus.org/dummy-organism/submission/2/submit?inputMode=form
updated docs page: https://docs-submission-via-form.loculus.org/for-users/submit-sequences/
Summary
inputMode
URL param to thesubmit
endpoint with valuesform
andbulk
. If it is omitted, we default back to the 'bulk' variant.td
was nested in adiv
Tests
FormOrUploadWrapper.spec.tsx
). Test that errors are raised when files or form input is missing. Test that all of the form that gets included in the TSV and also that escaping works.Implementation notes
FormOrUploadWrapper
wraps both and makes it easy to switch between them, returning just files which can then be used for uploadingnoEdit
fields to be in fact edited on initial submission - AFAICT this was only used for submission ID and accession (only the submission ID is shown in the 'submit' form).Screenshot
PR Checklist