Bulk Delete Snippets
Description
House cleaning is something that everyone should do in a period basis. Sometimes you will create snippets that are required for a limited time and then, they aren't useful anymore. If you happen to have created a lot of snippets you can be facing deleting several of them at given time and this process right now is made one by one.
Truthfully one could do it one by one but it is a mundane operation and give up during the process. This generates a longer snippet list and, although doubtful, possible storage issues.
Proposal
Create a feature where the snippet owner (or admin) could select one, several or all snippets and the selected snippets would be the ones selected for deletion. Similar features are available through the web using checkboxes and buttons.
Links / references
- /dashboard/snippets
Security Testing
- Ensure one cannot delete other people's snippets. (@lulalala)
- Coverage for bulk deleting personal snippets with/without access (@vij)
- Coverage for bulk deleting project snippets with/without access (@vij)
- Non-authenticated users won't see the option to bulk delete (@a_luna)
- :admin_snippet ability on all selected snippets is required for bulk delete (@a_luna)
Testing
- Test that we can delete the snippets in bulk in unit tests and also feature specs (@fjsanpedro)
- Bulk delete should work when several snippets are passed (@a_luna)
- Bulk delete should work when one snippet is passed, too (@a_luna)
MR Breakdown
- MR with the controller changes.