Skip to content
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

Project page - import behavior #43

Open
jacksonjacobs1 opened this issue Nov 14, 2024 · 0 comments
Open

Project page - import behavior #43

jacksonjacobs1 opened this issue Nov 14, 2024 · 0 comments
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch

Comments

@jacksonjacobs1
Copy link
Collaborator

jacksonjacobs1 commented Nov 14, 2024

Description

Implement a file upload feature within the project page that handles file drop events. This feature should support both TSV and individual image/mask/annotation files, with appropriate async handling, error logging, and condition-based processing for existing files. Uploaded data should be reflected in the UI grid.

Feature Details

The file drop event will process each file individually using an async processFile(filename, file) method, which will determine the specific upload method based on file type.

File Processing Logic

  1. TSV Files:

    • processFile() will invoke uploadRemote() once for each row in the TSV file.
  2. Image Files:

    • processFile() will select an upload method based on file suffix:
      1. Standard Image Upload: UploadImage()
      2. Tissue Mask Upload: UploadTissueMask()
      3. Annotations Upload: UploadAnnotations()

Upload Methods and API Calls

Four methods will need to be implemented to interact with the API. Sequences of API calls are listed for each method.

  1. uploadRemote()

    1. GET image/search:
      • If empty: proceed to upload (image does not exist).
      • If non-empty: log “skipping [image name], file already exists.”
    2. POST image:
      • On 500 error: log error and exit method.
    3. POST image/tissue_mask (if available):
      • On 404 error: log error.
    4. POST image/annotation (if available):
      • On 404 error: log error.
    5. GET image after each upload to update the slickgrid.
  2. UploadImage()

    1. GET image/search:
      • If empty: upload image, then retrieve and update slickgrid.
      • If non-empty: log “skipping [image name], file already exists.”
    2. POST image:
      • On 500 error: log error and exit.
    3. GET image after each upload to update the slickgrid.
  3. UploadTissueMask()

    1. GET image/search:
      • If empty: log error and return (image not found).
    2. POST image/tissue_mask:
      • On 200: retrieve and update slickgrid.
      • On 500: log error.
  4. UploadAnnotations()

    1. GET image/search:
      • If empty: log error and return (image not found).
    2. POST image/annotation:
      • On 200: retrieve and update slickgrid.
      • On 500: log error.

Re-Upload Behavior

If a user deletes an image from the project and later re-uploads it using the drag-and-drop method, the backend should allow the image to upload again, even if it already exists in the file system.

Acceptance Criteria

  1. File drop event correctly processes and uploads TSV and image/mask/annotation files.
  2. For each uploaded file, the UI grid accurately reflects updates.
  3. Image re-upload after deletion is supported by the backend.
  4. Error logging is implemented as specified for each upload method.
  5. Duplicate image files are identified, and redundant uploads are logged accordingly.

References:
N/A

@jacksonjacobs1 jacksonjacobs1 added enhancement New feature or request v2.0 Pertains to the v2.0 branch labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch
Projects
None yet
Development

No branches or pull requests

1 participant