From 2fdd42b45b806d5dbf2444bcd1124ed68b0076a5 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 29 Mar 2026 21:09:29 -0400 Subject: [PATCH] UX and architecture fixes: bulk-delete, template guard, statuses config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug fixes: - bulk-delete action called undefined bulkDelete() — wired to the existing showBulkDeleteModal() so the confirmation modal actually shows UX: - Template loader now checks for existing title/description and asks for confirmation before overwriting user-typed content - Visibility select shows a dynamic hint paragraph that updates when the user changes the selection (public/internal/confidential) Architecture: - TICKET_STATUSES added to config as single source of truth; all hardcoded ['Open','Pending','In Progress','Closed'] arrays in DashboardView now read from config; bulk-status modal in dashboard.js reads window.TICKET_STATUSES (set from PHP) with array fallback - ASSET_VERSION now auto-computed from max mtime of dashboard/ticket CSS+JS files so browsers always pick up changes on deploy; manual override still available via ASSET_VERSION in .env - Removed 10 dead standalone stat methods from StatsModel (getOpenTicketCount, getClosedTicketCount, getTicketsByPriority, etc.) — all superseded by the consolidated fetchAllStats() queries, never called externally Co-Authored-By: Claude Sonnet 4.6 --- assets/js/dashboard.js | 7 +-- config/config.php | 19 +++++- models/StatsModel.php | 124 ------------------------------------- views/CreateTicketView.php | 19 ++++++ views/DashboardView.php | 10 +-- 5 files changed, 44 insertions(+), 135 deletions(-) diff --git a/assets/js/dashboard.js b/assets/js/dashboard.js index f3fe0fc..7f8b96f 100644 --- a/assets/js/dashboard.js +++ b/assets/js/dashboard.js @@ -130,7 +130,7 @@ document.addEventListener('DOMContentLoaded', function() { if (typeof showBulkPriorityModal === 'function') showBulkPriorityModal(); break; case 'bulk-delete': - if (typeof bulkDelete === 'function') bulkDelete(); + showBulkDeleteModal(); break; case 'clear-selection': clearSelection(); @@ -760,10 +760,7 @@ function showBulkStatusModal() {