(ui) Clarify destructive action flows

Make retention apply, incomplete cleanup, and SSH key deletion visibly
destructive with warning copy, danger styling, and consistent cancel actions
while keeping the existing confirmation requirements intact.

Refs #25
This commit is contained in:
2026-05-21 14:17:07 +02:00
parent af548f11c4
commit 1604f0f6f4
3 changed files with 23 additions and 5 deletions

View File

@@ -554,6 +554,8 @@ class ViewTests(TestCase):
self.assertEqual(response.status_code, 200)
self.assertContains(response, "Cancel")
self.assertContains(response, reverse("ssh_credentials"))
self.assertContains(edit_response, "Delete SSH key")
self.assertContains(edit_response, 'class="danger"', html=False)
def test_ssh_credentials_view_generates_filesystem_key(self) -> None:
self.client.force_login(self.staff_user)
@@ -1835,6 +1837,9 @@ class ViewTests(TestCase):
self.assertNotContains(response, "<div class=\"label\">Source</div>", html=True)
self.assertContains(response, "Confirm delete count")
self.assertContains(response, "Type 1 to confirm the current number of planned deletions.")
self.assertContains(response, "This permanently deletes the snapshot directories listed in Would Delete.")
self.assertContains(response, 'class="danger"', html=False)
self.assertContains(response, "Cancel")
def test_retention_plan_warns_when_scheduled_prune_limit_is_exceeded(self) -> None:
self.client.force_login(self.staff_user)
@@ -1910,6 +1915,8 @@ class ViewTests(TestCase):
self.assertContains(response, "excluded from retention cleanup")
self.assertContains(response, "Delete incomplete snapshots")
self.assertContains(response, "Type 1 to confirm the current number of incomplete snapshots.")
self.assertContains(response, "This deletes only incomplete snapshot directories")
self.assertContains(response, 'class="danger"', html=False)
def test_incomplete_cleanup_deletes_incomplete_snapshot_after_confirmation(self) -> None:
self.client.force_login(self.staff_user)