feat(templates): add pagination with total counts to catalog and campaign picker
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Test Catalog's pagination showed only 'Page N' with no way to know how many pages existed, and the campaign 'Add Test' modal's template picker had no pagination at all — with 2800+ templates in the catalog, its flat 100-row fetch made most templates unreachable unless a search happened to match. Adds GET /test-templates/count (open to any authenticated user, mirrors the list endpoint's filters) and wires real 'Page N of M' + total-available counts into both.
This commit is contained in:
@@ -182,11 +182,14 @@ def test_soft_delete():
|
||||
|
||||
|
||||
def test_search_filter():
|
||||
from app.routers.test_templates import list_templates
|
||||
source = inspect.getsource(list_templates)
|
||||
from app.services.test_template_service import _build_template_query, list_templates
|
||||
# The actual filter-building (including search) now lives in the shared
|
||||
# _build_template_query() helper, reused by both list and count.
|
||||
source = inspect.getsource(_build_template_query)
|
||||
assert "search" in source
|
||||
assert "name" in source and "description" in source
|
||||
assert "ilike" in source
|
||||
assert "_build_template_query" in inspect.getsource(list_templates)
|
||||
print(" [PASS] Search filter searches in name and description")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user