Jul 9 - Update Dashboard separate open issue by Handler (more viewable)
This commit is contained in:
@@ -1004,7 +1004,7 @@ Rendered in `dashboard.html` for `current_user.role == 'customer'`. Uses a Boots
|
||||
|
||||
### Issues List — ID Filter, Date Filter & PDF Export
|
||||
|
||||
`issues.index()` accepts three additional query params: `issue_id` (exact match on `Issue.id`), `date_from`, `date_to` (ISO date strings applied to `Issue.reported_at`). The `date_to` end is expanded to `23:59:59` so the whole day is included.
|
||||
`issues.index()` accepts additional query params: `issue_id` (exact match on `Issue.id`), `date_from`, `date_to` (ISO date strings applied to `Issue.reported_at`; `date_to` expanded to `23:59:59`), `handler_type` (`internal`/`facility`/`vendor`), and `unassigned` (truthy → `Issue.assigned_to IS NULL`). `handler_type` and `unassigned` are both threaded through the pagination links and shared with `export_list_pdf()`.
|
||||
|
||||
`GET /issues/export-list-pdf` — same scope + filter logic as `index()`, applies SLA post-filter for `?sla=` param (SLA is computed in Python, not stored). Calls `generate_issues_list_pdf()`.
|
||||
|
||||
@@ -1029,13 +1029,15 @@ The dashboard cards are organised into two labelled sections separated by a divi
|
||||
4. Pending Follow-ups — inspections with `follow_up_required=True`; links to `inspections.index?status=follow_up`
|
||||
|
||||
**Issues section** (customers see first 3; staff see all 5):
|
||||
1. Open Issues — `status=open` with severity breakdown badges (C/H/M/L) **and** a "Handled by" split (Janitorial Staff / Facility Staff / External Vendor) from `handler_breakdown`; each handler chip links to `issues.index?status=open&handler_type=...`. Both breakdowns are derived from the already-loaded `open_issues_all` list (no extra queries). The card is no longer a single wrapping anchor — the count and each handler chip are separate links (nested anchors are invalid).
|
||||
2. Issues Opened Today — links to `issues.index` with `date_from=today&date_to=today` (uses the date filter added to `issues.index`)
|
||||
1. Open Issues — `status=open` with severity breakdown badges (C/H/M/L) **and** a "Handled by" split (Janitorial Staff / Facility Staff / External Vendor) from `handler_breakdown`.
|
||||
2. Issues Opened Today — `date_from=today&date_to=today`, with a "Handled by" split from `opened_today_handler`.
|
||||
3. Resolved Today — `status=resolved` + today's date range
|
||||
4. Pending Verification — `status=pending_verification`
|
||||
5. Unassigned Open — `status=open` issues with no `assigned_to`
|
||||
5. Unassigned Open — `status=open&unassigned=1`, with a "Handled by" split from `unassigned_handler`.
|
||||
|
||||
Each card has a subtitle line explaining what it counts. Section dividers use `d-flex align-items-center gap-2` with a `<div style="flex:1;height:1px;background:#e2e8f0;">` rule.
|
||||
**"Handled by" splits (phase35+):** cards 1, 2, and 5 render a handler breakdown via the `handler_chips(bd, base)` **Jinja macro** at the top of `dashboard.html` — full-text labels ("Janitorial N / Facility N / Vendor N") that each link to `issues.index` with the card's own filter (`base`) plus `handler_type=`. Breakdowns come from `_handler_split(list)` over the already-loaded issue lists (`open_issues_all`, `opened_today_all`, `unassigned_all`) — **no extra queries**. These three cards are no longer a single wrapping anchor — the count and each chip are separate links (nested `<a>` is invalid). `issues.index` gained an **`unassigned=1`** filter (`Issue.assigned_to.is_(None)`) so the Unassigned card and its chips link precisely; it is threaded through the list pagination links.
|
||||
|
||||
Each card has a subtitle line (or the handler split) explaining what it counts. Section dividers use `d-flex align-items-center gap-2` with a `<div style="flex:1;height:1px;background:#e2e8f0;">` rule.
|
||||
|
||||
**Inspector Activity table** follows the cards for admin/director/PM: all active inspectors, today's completed inspection count per inspector, progress bar scaled to `max_count`. Green row highlight if count > 0.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user