Skip to content

Bulk file revision: reuse existing files without exposing fileMapping to website users#6767

Draft
anna-parker wants to merge 41 commits into
mainfrom
claude_no_fileMapping
Draft

Bulk file revision: reuse existing files without exposing fileMapping to website users#6767
anna-parker wants to merge 41 commits into
mainfrom
claude_no_fileMapping

Conversation

@anna-parker

@anna-parker anna-parker commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Submission flow:

  • user prepares metadata tsv, consensus sequences in fasta and folder with files (one subfolder per submissionId)
  • under the hood (not seen to users backend creates a fileMapping)

Revision flow:

  • user downloads original data (metadata and sequences)
  • user uploads original data with revisions to revision page on website (no file changes or just prepares files to edit potentially recreates folder)
  • website gets fileMapping and populates with existing fileMapping, users can delete and add on page or upload a full new folder

created with claude

Backend (/{organism}/get-file-mapping):

  • New POST endpoint in SubmissionController that accepts {accessions: [...]} and returns Map<Accession,
    FileCategoryFilesMap>
  • New getFileMappingForAccessions method in SubmissionDatabaseService that validates the user can edit these
    accessions, then queries the latest version of each accession and extracts the submitted file mapping
  • Description constant GET_FILE_MAPPING_DESCRIPTION added to SubmissionControllerDescriptions

Website (bulk revision pre-population):

  • backendClient.ts: new getFileMapping(token, organism, accessions) method
  • backend.ts: new filesByAccession schema/type for the response
  • FormOrUploadWrapper.tsx: new onMetadataFileChange prop that fires when the metadata file is selected
  • DataUploadForm.tsx: when revising, parses the uploaded metadata TSV to extract accession/id column pairs, calls the
    file-mapping endpoint, maps the accession-keyed response to submission-ID-keyed, and pre-populates fileMapping state;
    uses a fileMappingKey to force ExtraFilesUpload to re-mount with the fresh mapping
  • FolderUploadComponent.tsx (bulk mode):
    • Delete per file: each file in each submission now has a "Discard" button
    • Add files per submission: each submission group has an "Add files" button with a hidden file input
    • Fixed handleDiscardFile to correctly remove only the specific submission when it becomes empty, rather than
      clearing all submissions

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by appropriate, automated tests.
  • Any manual testing that has been done is documented (i.e. what exactly was tested?)

🚀 Preview: https://claude-no-filemapping.loculus.org

tombch and others added 30 commits May 27, 2026 13:22
…with discard files and accessing default files
…h discard all files not working for revisions
…dit page: if we had an empty file mapping, keyed on submission id, this would display the folder upload. files would then be added, but keyed to dummy submission id. at submit time, the 'first' item in the map was accessed - the empty submission id map. I've decided to update the component to include an optional formSubmissionId, as in the edit/revise case we have the submission id already. this removes the possibility of having a mix of real id and dummy in the single edit/revise case which IMO was a bit of a footgun
@anna-parker anna-parker added the preview Triggers a deployment to argocd label Jun 25, 2026
@claude claude Bot added website Tasks related to the web application backend related to the loculus backend component labels Jun 25, 2026
@claude

claude Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR may be related to: #5820

Base automatically changed from single-submission-revise-files to main June 29, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend related to the loculus backend component preview Triggers a deployment to argocd website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants