v2.5.0: replace keys table with responsive cards

This commit is contained in:
Виталий Литвинов
2026-04-25 15:52:17 +03:00
parent 7b1a79bba9
commit d62991857f
4 changed files with 143 additions and 34 deletions

View File

@@ -129,19 +129,22 @@ class AdminFeatureTests(unittest.TestCase):
self.assertNotIn("client = 3", text)
self.assertNotIn("old = 4", text)
def test_keys_table_keeps_actions_inside_table_cell_wrapper(self):
def test_keys_view_uses_card_layout_without_horizontal_table(self):
app_js = (ROOT / "admin-web" / "static" / "app.js").read_text(encoding="utf-8")
styles = (ROOT / "admin-web" / "static" / "styles.css").read_text(encoding="utf-8")
index = (ROOT / "admin-web" / "static" / "index.html").read_text(encoding="utf-8")
self.assertNotIn('class="actions"', app_js)
self.assertIn('class="key-card', app_js)
self.assertIn('class="key-card-actions"', app_js)
self.assertIn('class="action-buttons"', app_js)
self.assertIn('class="key-name-button"', app_js)
self.assertIn(".keys-table .mini-actions,\n.keys-table .action-buttons", styles)
self.assertIn(".key-card .mini-actions,\n.key-card .action-buttons", styles)
self.assertIn("grid-template-columns: 1fr", styles)
self.assertIn("min-height: 44px", styles)
self.assertNotIn("td.actions", styles)
self.assertRegex(index, r'<table class="keys-table">[\s\S]*?<tbody id="usersTable">')
self.assertIn('class="keys-list" id="usersTable"', index)
self.assertNotIn('class="keys-table"', index)
if __name__ == "__main__":