Skip to content

refactor(tickets): migrate platform ticket list to shared components (#152)#167

Open
b3lz3but wants to merge 2 commits intocaptainpragmatic:masterfrom
b3lz3but:refactor/ticket-list-shared-components
Open

refactor(tickets): migrate platform ticket list to shared components (#152)#167
b3lz3but wants to merge 2 commits intocaptainpragmatic:masterfrom
b3lz3but:refactor/ticket-list-shared-components

Conversation

@b3lz3but
Copy link
Copy Markdown
Contributor

@b3lz3but b3lz3but commented Apr 2, 2026

Summary

Replaces 275 lines of inline HTML in the platform ticket list with shared components, matching the portal's 27-line architecture. Net -241 lines.

Closes #152

What changed

  • Platform list.html: 275 → 28 lines using list_page_header.html, list_page_filters.html, list_page_skeleton.html
  • Platform views.py: Added TICKET_STATUS_TABS constant with staff labels ("Waiting on Customer"), expanded ticket_list context with shared component variables (list_stats, filter_tabs, filter_search_url, etc.)
  • Platform tickets_table.html: Date format standardized to d.m.Y, TK avatar circle removed (show ticket number directly)
  • Portal tickets_table.html: Same TK avatar removal
  • New: tickets/partials/header_action.html for "New Ticket" button

Before/After

Aspect Before After
Platform list.html 275 lines inline HTML 28 lines shared components
Header 90 lines manual list_page_header.html include
Filters Raw select dropdown Tab bar via list_page_filters.html
Skeleton 120 lines duplicated 2x list_page_skeleton.html include
Date format j M Y (24 Mar 2026) d.m.Y (24.03.2026)
Ticket column Redundant "TK" avatar circle Direct ticket number

Test plan

  • All pre-commit hooks pass (including Django template syntax check)
  • DCO sign-off
  • Platform ticket list renders with tab bar, search, skeleton loader
  • HTMX search/filter works with tab switching
  • Staff sees "Customer" column and "Waiting on Customer" tab
  • Mobile responsive layout works
  • Portal ticket list still works (only avatar removal)

🤖 Generated with Claude Code

…aptainpragmatic#152)

Replace 275 lines of inline HTML in the platform ticket list with shared
components (list_page_header, list_page_filters, list_page_skeleton),
matching the portal's 27-line architecture. Add TICKET_STATUS_TABS with
staff-appropriate labels, pass shared component context from views,
standardize date format to d.m.Y, and remove redundant TK avatar circles
from both platform and portal ticket tables.

Closes captainpragmatic#152

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
@b3lz3but
Copy link
Copy Markdown
Contributor Author

b3lz3but commented Apr 2, 2026

@mostlyvirtual — requesting review. Clean refactor: 275→28 lines using existing shared components. No behavior changes beyond date format standardization and TK avatar removal.

gettext_lazy returns _StrPromise, not str, causing mypy dict-item error.
Remove annotation to match portal's untyped pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
@b3lz3but
Copy link
Copy Markdown
Contributor Author

b3lz3but commented Apr 2, 2026

CI update: Fixed the mypy dict-item error (gettext_lazy returns _StrPromise, not str). Removed explicit type annotation to match portal's pattern.

The portal-test failures are pre-existing flaky HMAC integration tests (test_cross_service_hmac.py) — unrelated to our template-only change. Portal passes on master but those specific tests are intermittent.

@mostlyvirtual — this is a clean refactor: 275→28 lines using existing shared components. Would appreciate your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(tickets): migrate platform ticket list to shared components, standardize UX

1 participant