Skip to content

Detect linked data files in Validate & Preview #252

@kerberizer

Description

@kerberizer

Per Apr 16 meeting:

  • When the user uploads a file via Validate & Preview...
  • use an appropriate JS library for reading Excel files—preferably minimal, but definitely actively and well maintained...
  • look for the TemplateDesigner sheet in the XLS (and show an error message if we don't find that sheet)...
  • extract the JSON from cell B2 in that sheet (and show an error message if we don't find the JSON)...
  • check if there are "file pointer" fields in that JSON...
  • if there are, show a message to the user.

The check for "file pointer" fields should work like this:

  • find the key raw_data_report
  • if found, then look for subkeys with values of:
    • value_file
    • value_image
    • value_spectrum
  • if found, then show the warning message to the user.

JSON example with one subkey having a value of value_spectrum:

  "raw_data_report": [
    {
      "raw_endpoint": "Spectrum filename",
      "raw_aggregate": "RAW_DATA",
      "raw_endpoint_uncertainty": "none",
      "raw_type": "value_spectrum",
      "raw_conditions": [
        "replicate"
      ]
    },

The exact messages and how they are presented to the user wasn't discussed, so let's just just show some placeholder text in the most minimalistic way (even if just alert(), but preferably within the UI):

  • if the file can't be opened as Excel at all: ERROR: The uploaded file doesn't seem to be an Excel file.
  • for missing hidden sheet or JSON in it: ERROR: The uploaded Excel file is not based on a Template Designer blueprint.
  • for an Excel file with file pointers (to data files): WARNING: The uploaded Excel file links to separate data files. This preview is intended only for Excel files containing all the data within them.

Ping: @sergesoroka
CC: @vedina

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions