Skip to content

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

@mostlyvirtual

Description

@mostlyvirtual

Summary

The portal ticket list was refactored to use shared components (list_page_header, list_page_filters, list_page_skeleton from shared/ui/templates/components/), resulting in a clean 27-line template. The platform ticket list was never migrated — it's 275 lines of inline HTML with divergent UX patterns. This issue standardizes both pages.

Current State

Aspect Portal (27 lines) Platform (275 lines)
Header Shared list_page_header.html 90 lines inline HTML
Filters Tab bar via shared list_page_filters.html Raw select dropdown
Skeleton Shared list_page_skeleton.html Duplicated 2x inline (~100 lines each)
Status badges badge tag with status_label/status_variant/status_icon filters Inline if/elif chains (30+ lines)
Date format d.m.Y (24.03.2026) j M Y (24 Mar 2026)
Ticket column "TK" avatar circle (redundant — all tickets start with TK) Same redundant "TK" avatar
Tab labels "Waiting on You" (customer-facing) "Waiting on Customer" (staff dropdown)

Tasks

Platform list.html migration

  • Replace inline header card (lines 10-90) with shared list_page_header.html include — pass page_title, page_subtitle, header_stats, list_action_include
  • Replace inline filter form + select (lines 104-132) with shared list_page_filters.html include — pass filter_tabs with staff-appropriate labels ("Waiting on Customer" not "Waiting on You")
  • Replace inline skeletons (lines 134-254, duplicated) with shared list_page_skeleton.html include
  • Add TICKET_STATUS_TABS constant to platform ticket views (similar to portal views.py:23-38) with staff-specific labels
  • Pass shared component context vars from ticket_list and ticket_search_htmx views

Platform tickets_table.html standardization

  • Replace inline if/elif badge chains with badge template tag using status_label/status_variant/status_icon filters (already used in other platform tables: users, billing, provisioning)
  • Standardize date format to d.m.Y (matching portal and platform billing tables)

Remove redundant TK avatar from both tables

  • Portal tickets_table.html — remove the avatar circle that shows ticket_number slice :2 (always "TK"). Just show the ticket number directly
  • Platform tickets_table.html — same removal
  • Both mobile card layouts — same cleanup

Verify

  • Platform ticket list renders with tab bar, search, skeleton loader
  • HTMX search/filter works with tab switching
  • Staff sees "Customer" column, "Waiting on Customer" tab
  • Date format consistent d.m.Y on both portal and platform
  • No console errors, server errors
  • Mobile responsive layout works

Key Files

Shared components (already exist):

  • shared/ui/templates/components/list_page_header.html
  • shared/ui/templates/components/list_page_filters.html
  • shared/ui/templates/components/list_page_skeleton.html

Portal (reference implementation):

  • services/portal/templates/tickets/ticket_list.html — 27-line template using shared components
  • services/portal/apps/tickets/views.py:23-38 — TICKET_STATUS_TABS definition

Platform (to migrate):

  • services/platform/templates/tickets/list.html — 275 lines to ~30 lines
  • services/platform/templates/tickets/partials/tickets_table.html — badge standardization
  • services/platform/apps/tickets/views.py:55-108 — ticket_list view context
  • services/platform/apps/tickets/views.py:110-148 — ticket_search_htmx view context
  • services/platform/apps/tickets/urls.py:13 — search endpoint already exists as search_htmx

Both tables (TK avatar removal):

  • services/portal/templates/tickets/partials/tickets_table.html
  • services/platform/templates/tickets/partials/tickets_table.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions