feat(fusion_helpdesk): group My Tickets into Critical/New/Solved sections

The flat write_date-sorted list was hard to scan with 50+ tickets — solved
ones were intermixed with active ones, and there was no signal for
priority. Bucket each ticket server-side into 'critical' (open + priority
High/Urgent), 'solved' (stage marked fold=True on central) or 'open'
(everything else), and render three labelled sections in the dialog with
sticky headers, count badges, and per-group accent colours. Backend keeps
its write_date desc order so latest is always at top within each bucket.

Bucketing uses helpdesk.stage.fold (not the stage name) so renaming
"Solved" to "Done" on the central won't quietly mis-categorise rows.
Adds bucket_ticket() in utils.py with unit tests covering the
folded-wins-over-priority precedence and the missing-priority fallback.

Also surfaces a small Urgent (triangle) / High (arrow) icon on each row
so a critical ticket reads at a glance even after a user scrolls past
the section header.

Bumps fusion_helpdesk to 19.0.1.6.0.
This commit is contained in:
gsinghpal
2026-05-27 11:04:31 -04:00
parent aabfc1afe7
commit 3e5ced1655
7 changed files with 172 additions and 10 deletions

View File

@@ -124,6 +124,29 @@ export class FusionHelpdeskDialog extends Component {
await this.loadList();
}
// Bucket tickets into Critical / New & Open / Solved for the section view.
// Backend already sorts by write_date desc, so iterating preserves latest-
// first within each bucket. We only render non-empty sections so the
// dialog doesn't show "0 Critical" noise when the user has none.
get groupedTickets() {
const groups = [
{ key: "critical", title: _t("Critical"),
iconClass: "fa fa-exclamation-circle", className: "o_fhd_group_critical",
tickets: [] },
{ key: "open", title: _t("New & Open"),
iconClass: "fa fa-inbox", className: "o_fhd_group_open",
tickets: [] },
{ key: "solved", title: _t("Solved"),
iconClass: "fa fa-check-circle", className: "o_fhd_group_solved",
tickets: [] },
];
const byKey = Object.fromEntries(groups.map((g) => [g.key, g]));
for (const t of this.state.tickets) {
(byKey[t.group] || byKey.open).tickets.push(t);
}
return groups.filter((g) => g.tickets.length);
}
// ==================================================================
// My Tickets — thread
// ==================================================================