Clinical-Genomics-Lund / bonsai

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

Add button for deleting samples + some fixes #142

Closed mhkc closed 7 months ago

mhkc commented 8 months ago

This PR adds a button to the groups and group view for removing the selected samples. Only admin users can perform this operation.

When a user clicks the button it will call the /samples entry point on the API with the DELETE method. This removes the sample from the database, removes the samples from any groups it have been added to, and triggers jobs on the minhash service to remove the signature file and strip the samples from the index.

This PR also display the a 404 page when trying to access a non existing group or sample.

Close #137

How to setup and perform the tests

  1. Setup a Bonsai instance.
  2. Load a few samples to the database and add them to groups
  3. Try to remove the samples from the /groups and /groups/<group_name> views.

Expected outcome

  1. The samples should be removed
  2. The sample id should be removed from "included samples" and the last modified field should be updated.
  3. The signature should be removed ( check minhash_service mounted volume )