Clinical-Genomics-Lund / bonsai

Visualize and analyze resistance and outbreak of bacterial pathogen
https://bonsai-wgs.readthedocs.io/en/latest/
GNU General Public License v3.0
4 stars 1 forks source link

Let users set QC status for multiple samples from /groups #106

Closed alkc closed 11 months ago

alkc commented 11 months ago

This update adds a dropdown menu to /groups allowing users to toggle QC status for multiple samples.

bonsai-qc-pr

The QC form is submitted to new route groups.qc_status which updates the QC status for the selected samples and redirects back to /groups.

The sample selection in the sample JS table is retained on page reload through GET args. This is implemented with the assumption that the end-user won't try to set the QC status for so many samples at the same time that the GET request grows too long.

Other changes:

Closes #97

Suggested test sequence:

  1. Setup new bonsai instance from this branch and throw a few samples at it
  2. Go to /groups and verify that the QC button is disabled
  3. Select a few samples and verify that the QC controls can be accessed
  4. Setting QC to passed results in a page reload and a change in the QC status of the samples
  5. Setting QC to failed results in a page reload and a change in the QC status of the samples. The correct follow-up action and comment is added to the affected samples.

TODO:

alkc commented 11 months ago

I've deduplicated all the QC form code back into sample/sidebar.html. Could be moved to some non-blueprint specific template dir, but I'm saving that for some future update.

the /samples sidebar and /groups QC form now use the same macros for both the HTML and JS enhancements.

Demo of QC in /groups:

bonsai-qc-pr-update1

Demo of QC in /samples

bonsai-qc-pr-update2

alkc commented 11 months ago

I've rebased the branch onto master (hopefully w/o breaking anything), incorporated the suggested fixes and deduplicated the QC form templates/macros.

See above for updated demos.