Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[dataquery] Restrict filter CSV to visit labels for session

Open CamilleBeau opened this issue 9 months ago • 2 comments

Brief summary of changes

This PR adds validation to the CSV upload for filters so that when "session" is selected the second column must only contain visit labels.

  • [ ] Have you updated related documentation?

Testing instructions (if applicable)

  1. Add fields for a query
  2. Go to add filters and click "Import from CSV"
  3. Click "Sessions" and try uploading a CSV with 2 columns where the second column does not contain valid or relevant visit labels. Make sure an error SWAL shows up
  4. Click "Sessions" and try uploading a CSV with 2 columns where the second column does contain valid and relevant visit labels. Make sure no error SWAL pops up and the filters are properly loaded

Link(s) to related issue(s)

  • Resolves #9723

CamilleBeau avatar Mar 26 '25 14:03 CamilleBeau

generally, this fix works.

I used the following 2 column csv file

ddcid_pscid.csv

I selected

  • Candidate identifier fields: CandID
  • csv containing list of Sessions
  • Candidate Id type: DCCID
  • header line: Yes

the change sucessfully fires the sweetalert error message as follows:

Screenshot from 2025-04-01 10-38-14

However, when I selected

  • Candidate identifier fields: CandID
  • csv containing list of Sessions
  • Candidate Id type: PSCCID
  • headerline: yes

the file loaded successfully

and, after I ran the query, I see this: Screenshot from 2025-04-01 10-45-27

seems confusing because I selected 'Sessions', uploaded a csv with two columns, and I'm getting a single column

adamdaudrich avatar Apr 01 '25 15:04 adamdaudrich

updated my comment a few times, here.

adamdaudrich avatar Apr 01 '25 15:04 adamdaudrich