Add sites deletion
One condition must be fulfilled for site deletion to be allowed: The site must have no partners.
Additionally, when a site is deleted, all routes that uses this site can be safely deleted too: a route describes a possibility to declare flows to, from or through a site. As a site can only be deleted if there are no partners in it, no file is sent to, from or through this site. Those routes are not used and can be removed transparently.
Scenario
The user has two ways the delete a site :
- From the list of stes
- From the site view
For both ways, when the user click the button to delete a site, it should be verified wether or not the deletion can be done. If it cannot, an error should be shown to explain why it cannot be removed.
If the site can be deleted, a confirmation should be asked to the user. If the user confirms, and only then, the site can be deleted.
After the site has been deleted:
- A success message should be displayed
- If the user was on the view site, she should be redirected to the list after
If the deletion failed on the backend, an error message should be displayed to indicate the reason of the error.
To Do
Backend
-
Add a handler to delete a site to the API and add it to the router (with the DELETE
method). -
If it does not exist, add pre-delete methods to sites to ensure athe site can be deleted. If it cannot (i.e. if there are any partner declared in the site), it should return an error -
If it does not exist, add post-delete methods to sites to remove associated routes -
Add entries to the audit log for site deletion
Frontend
-
add a button on each site row to delete the corresponding site -
add a button on the page to view a sinlgle site to delete the corresponding site -
When the user click the button, show a confirmation modal box: -
When the user confirms, delete the site: -
if the deletion succeeded, show a success message, and redirect the user if needed -
if the deletion failed, show an error message
-
-
when the user cancels, close the modal window!
-
Other
-
Every code change should be covered by an automated test -
The documentation must be changed to reflect this new feature -
The changelog must be updated