Commit Graph
6 Commits
Author SHA1 Message Date
kawa 59fc8b1e9c feat(12-02): wire all template strings to Alpine i18n store
- dashboard.html: headings, quick actions, empty states wired to x-text
- printers.html: h1, add button, h2 wired to x-text
- printers_new.html: all form labels (span pattern), options, submit buttons wired
- clients.html: headings, label, submit button wired
- client_detail.html: back link, section heading wired
- drivers.html: all headings, label, buttons, spinner wired
- packages.html: heading, description, table headers, empty state wired
- printer_detail.html: all dt/dd, section headings, copy buttons, script/export links wired with conditional Jinja2 for color/collate/client
- partials/printer_list.html: table headers, Yes/No cells (Alpine ternary), delete button wired
- partials/printer_edit_modal.html: edit trigger, modal title, all labels (span pattern), options, save/cancel wired
- partials/client_list.html: empty state, table headers wired
- partials/driver_list.html: table headers, unknown values, empty state wired
- Fix test_printers_library_no_form: check form element attribute instead of UI label string (now in i18n dict)
2026-04-15 15:50:35 +02:00
kawa 3d2cdc4e77 feat(11-01): UIE-02 — dedicated Add Printer page at GET /printers/new
- Create imptune/templates/printers_new.html: full page extending base.html
  with plain <form action="/printers" method="post"> (no HTMX, browser follows 303)
  and inline driver upload sub-form
- Update imptune/templates/printers.html: remove inline Add Printer form,
  add <a href="/printers/new" role="button">Add Printer</a> link
- Add GET /printers/new route in imptune/api/pages.py (placed before /{printer_id})
- Change POST /printers to always return RedirectResponse(url='/printers', status_code=303)
- Update existing POST /printers tests to assert 303 + follow_redirects=False
- Update test_printer_form.py to check /printers/new instead of /printers (UIE-02 arch)
- UIE-02 tests GREEN; UIE-01/03 scaffolds remain RED (expected — not yet implemented)
2026-04-15 11:03:41 +02:00
kawa a02df7d292 test(11-01): add Wave 0 RED scaffolds for UIE-01/02/03
- Add 8 new test functions: printers_new_returns_200, create_printer_redirects,
  printers_library_no_form, patch_printer, patch_printer_not_found,
  client_detail_returns_200, client_detail_not_found, client_links_in_printer_list
- Add FIXME comments on existing POST /printers tests noting upcoming 303 change
- All new tests FAIL against current code (proper RED TDD state)
- Existing 13 tests remain GREEN
2026-04-15 11:00:55 +02:00
kawa 6e7892e862 test(03-02): add failing tests for printer detail page
- test_printer_detail_shows_driver: asserts driver name appears on detail page
- test_printer_detail_not_found: asserts 404 for missing printer ID
- test_printer_detail_no_driver: asserts graceful display when driver is None
2026-04-10 13:04:01 +02:00
kawa 356c2ee690 feat(03-01): implement printer and client CRUD with HTMX/Alpine.js UI
- imptune/api/printers.py: POST /printers (all form fields, checkbox->bool,
  FK resolution), DELETE /printers/{id}, grouped list renderer with LEFT JOIN
- imptune/api/clients.py: POST /clients with duplicate-name handling
- imptune/api/pages.py: GET /printers and GET /clients page routes
- imptune/main.py: register printers + clients routers; close db on shutdown
- imptune/db/database.py: close existing connection before re-init (test isolation)
- templates: printers.html, clients.html, printer_form.html (Alpine.js port
  auto-derivation), printer_list.html (grouped by client), client_list.html
- tests/conftest.py: close test-thread db connection in fixture teardown
- tests/test_printer_crud.py: updated to use list(select().where()) for DB
  queries (avoids Peewee thread-local cursor caching across test boundaries)

Auto-fix [Rule 1 - Bug]: DB test isolation — Peewee thread-local connections
persisted across tests causing stale DB reads; fixed via conftest teardown and
lifespan db.close() on shutdown.
2026-04-10 12:56:09 +02:00
kawa 9bc26e377b test(03-01): add failing integration tests for printer and client CRUD
- test_create_printer_persisted: POST /printers + GET /printers
- test_create_printer_duplex/color_mode/paper_size/collate: field persistence
- test_create_client: POST /clients + GET /clients
- test_printer_grouped_by_client: client group heading in list
- test_create_printer_missing_name/invalid_ip: validation 400s
- test_delete_printer: DELETE /printers/{id} removes record
2026-04-10 12:50:00 +02:00