Loris
Loris copied to clipboard
[dataquery] Restrict filter CSV to visit labels for session
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)
- Add fields for a query
- Go to add filters and click "Import from CSV"
- 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
- 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
generally, this fix works.
I used the following 2 column csv file
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:
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:
seems confusing because I selected 'Sessions', uploaded a csv with two columns, and I'm getting a single column
updated my comment a few times, here.