From 1bd329ac1bdfe64ecf5b07e9f6ea074b8ff5d9bb Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 8 Jan 2026 13:02:52 -0500 Subject: [PATCH] update status's on tickets --- assets/css/dashboard.css | 17 +-- assets/css/ticket.css | 14 +-- migrations/009_simplify_status_workflow.sql | 43 +++++++ migrations/MIGRATION_009_INSTRUCTIONS.md | 118 ++++++++++++++++++++ 4 files changed, 177 insertions(+), 15 deletions(-) create mode 100644 migrations/009_simplify_status_workflow.sql create mode 100644 migrations/MIGRATION_009_INSTRUCTIONS.md diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css index 811ad56..f95f290 100644 --- a/assets/css/dashboard.css +++ b/assets/css/dashboard.css @@ -26,8 +26,9 @@ --priority-4: #66bb6a; --priority-5: #9e9e9e; - /* Status Colors (Keep existing) */ + /* Status Colors */ --status-open: #28a745; + --status-pending: #9c27b0; --status-in-progress: #ffc107; --status-closed: #dc3545; @@ -1149,24 +1150,24 @@ td:nth-child(2) span::after { margin-left: 4px; } -.status-Resolved { +.status-Pending { background-color: transparent !important; - color: var(--status-open) !important; + color: var(--status-pending) !important; padding: 4px 12px; border-radius: 0 !important; - border: 2px solid var(--status-open) !important; + border: 2px solid var(--status-pending) !important; font-size: 0.875rem; font-weight: 500; font-family: var(--font-mono); - text-shadow: 0 0 5px var(--status-open), 0 0 10px var(--status-open); + text-shadow: 0 0 5px var(--status-pending), 0 0 10px var(--status-pending); } -.status-Resolved::before { - content: '[✓'; +.status-Pending::before { + content: '[⏸'; margin-right: 4px; } -.status-Resolved::after { +.status-Pending::after { content: ']'; margin-left: 4px; } diff --git a/assets/css/ticket.css b/assets/css/ticket.css index cb2150d..4197be9 100644 --- a/assets/css/ticket.css +++ b/assets/css/ticket.css @@ -88,26 +88,26 @@ margin-left: 4px; } -.status-Resolved { +.status-Pending { background-color: transparent !important; - color: var(--status-open) !important; + color: var(--status-pending) !important; padding: 8px 16px; border-radius: 0 !important; - border: 2px solid var(--status-open) !important; + border: 2px solid var(--status-pending) !important; font-weight: 500; text-transform: uppercase; font-size: 0.9em; letter-spacing: 0.5px; font-family: var(--font-mono); - text-shadow: 0 0 5px var(--status-open), 0 0 10px var(--status-open); + text-shadow: 0 0 5px var(--status-pending), 0 0 10px var(--status-pending); } -.status-Resolved::before { - content: '['; +.status-Pending::before { + content: '[⏸'; margin-right: 4px; } -.status-Resolved::after { +.status-Pending::after { content: ']'; margin-left: 4px; } diff --git a/migrations/009_simplify_status_workflow.sql b/migrations/009_simplify_status_workflow.sql new file mode 100644 index 0000000..5929f63 --- /dev/null +++ b/migrations/009_simplify_status_workflow.sql @@ -0,0 +1,43 @@ +-- Migration 009: Simplify status workflow +-- Removes "Resolved" status and adds "Pending" status +-- Keeps only: Open, Pending, In Progress, Closed + +-- First, update any existing tickets with "Resolved" status to "Closed" +UPDATE tickets SET status = 'Closed' WHERE status = 'Resolved'; + +-- Delete all existing transitions with "Resolved" +DELETE FROM status_transitions WHERE from_status = 'Resolved' OR to_status = 'Resolved'; + +-- Clear all existing transitions to rebuild clean workflow +DELETE FROM status_transitions; + +-- Define new simplified workflow with Pending status +-- OPEN transitions +INSERT INTO status_transitions (from_status, to_status, requires_comment, requires_admin) VALUES + ('Open', 'Pending', FALSE, FALSE), -- Waiting on external dependency + ('Open', 'In Progress', FALSE, FALSE), -- Start work + ('Open', 'Closed', TRUE, FALSE); -- Close without work (duplicate, won't fix, etc.) + +-- PENDING transitions +INSERT INTO status_transitions (from_status, to_status, requires_comment, requires_admin) VALUES + ('Pending', 'Open', FALSE, FALSE), -- Unblock and reopen + ('Pending', 'In Progress', FALSE, FALSE), -- Start work while pending + ('Pending', 'Closed', TRUE, FALSE); -- Close while pending + +-- IN PROGRESS transitions +INSERT INTO status_transitions (from_status, to_status, requires_comment, requires_admin) VALUES + ('In Progress', 'Open', FALSE, FALSE), -- Stop work, back to queue + ('In Progress', 'Pending', FALSE, FALSE), -- Blocked by external dependency + ('In Progress', 'Closed', TRUE, FALSE); -- Complete and close + +-- CLOSED transitions +INSERT INTO status_transitions (from_status, to_status, requires_comment, requires_admin) VALUES + ('Closed', 'Open', TRUE, FALSE), -- Reopen (requires explanation) + ('Closed', 'In Progress', FALSE, FALSE); -- Reopen and start work immediately + +-- Verify new transitions +SELECT 'New Status Transitions:' as info; +SELECT from_status, to_status, requires_comment, requires_admin +FROM status_transitions +WHERE is_active = TRUE +ORDER BY from_status, to_status; diff --git a/migrations/MIGRATION_009_INSTRUCTIONS.md b/migrations/MIGRATION_009_INSTRUCTIONS.md new file mode 100644 index 0000000..52d3574 --- /dev/null +++ b/migrations/MIGRATION_009_INSTRUCTIONS.md @@ -0,0 +1,118 @@ +# Migration 009: Simplify Status Workflow + +This migration removes the "Resolved" status and adds a "Pending" status to the ticket system. + +## Status Changes + +### Before (4 statuses): +- Open +- In Progress +- **Resolved** ❌ (being removed) +- Closed + +### After (4 statuses): +- Open +- **Pending** ✅ (new) +- In Progress +- Closed + +## What "Pending" Means + +**Pending** status indicates a ticket is waiting on: +- External dependencies +- Third-party responses +- Parts/equipment to arrive +- Customer information +- Approval from another team + +Unlike "In Progress" which means active work is happening, "Pending" means the ticket is blocked and waiting. + +## Running the Migration + +On the tinkertickets server, run: + +```bash +cd /var/www/html/tinkertickets/migrations +mysql -h 10.10.10.50 -u tinkertickets -p'&*woX!5R$x8Tyrm7zNxC' ticketing_system < 009_simplify_status_workflow.sql +``` + +## What the Migration Does + +1. Updates any existing tickets with status "Resolved" to "Closed" +2. Deletes all status transitions involving "Resolved" +3. Creates new workflow with "Pending" status +4. Sets up the following allowed transitions: + +### New Workflow Transitions: + +**From Open:** +- → Pending (no comment required) +- → In Progress (no comment required) +- → Closed (requires comment) + +**From Pending:** +- → Open (no comment required) +- → In Progress (no comment required) +- → Closed (requires comment) + +**From In Progress:** +- → Open (no comment required) +- → Pending (no comment required) +- → Closed (requires comment) + +**From Closed:** +- → Open (requires comment - explain why reopening) +- → In Progress (no comment required) + +## CSS Updates + +The following CSS files have been updated: +- ✅ `/assets/css/dashboard.css` - Added `.status-Pending` styling with purple color (#9c27b0) and pause icon +- ✅ `/assets/css/ticket.css` - Added `.status-Pending` styling + +## Visual Appearance + +The Pending status will display as: +``` +[⏸ PENDING] +``` +- Purple color border and text +- Pause icon (⏸) to indicate waiting state +- Terminal-style glow effect + +## Verification + +After running the migration, verify: + +1. Check that all tickets previously marked "Resolved" are now "Closed": + ```sql + SELECT COUNT(*) FROM tickets WHERE status = 'Resolved'; -- Should be 0 + SELECT COUNT(*) FROM tickets WHERE status = 'Closed'; + ``` + +2. Check new transitions exist: + ```sql + SELECT from_status, to_status FROM status_transitions + WHERE from_status = 'Pending' OR to_status = 'Pending' + ORDER BY from_status, to_status; + ``` + +3. Test creating a new ticket and changing its status to Pending in the UI + +## Rollback (if needed) + +If you need to rollback this migration: + +```sql +-- Restore Resolved status transitions +DELETE FROM status_transitions WHERE from_status = 'Pending' OR to_status = 'Pending'; + +INSERT INTO status_transitions (from_status, to_status, requires_comment) VALUES + ('In Progress', 'Resolved', FALSE), + ('Resolved', 'Closed', FALSE), + ('Resolved', 'In Progress', TRUE), + ('Open', 'Resolved', FALSE); + +-- Update any Pending tickets to Open +UPDATE tickets SET status = 'Open' WHERE status = 'Pending'; +```