update status's on tickets

This commit is contained in:
2026-01-08 13:02:52 -05:00
parent d6dae6825c
commit 1bd329ac1b
4 changed files with 177 additions and 15 deletions

View File

@@ -26,8 +26,9 @@
--priority-4: #66bb6a; --priority-4: #66bb6a;
--priority-5: #9e9e9e; --priority-5: #9e9e9e;
/* Status Colors (Keep existing) */ /* Status Colors */
--status-open: #28a745; --status-open: #28a745;
--status-pending: #9c27b0;
--status-in-progress: #ffc107; --status-in-progress: #ffc107;
--status-closed: #dc3545; --status-closed: #dc3545;
@@ -1149,24 +1150,24 @@ td:nth-child(2) span::after {
margin-left: 4px; margin-left: 4px;
} }
.status-Resolved { .status-Pending {
background-color: transparent !important; background-color: transparent !important;
color: var(--status-open) !important; color: var(--status-pending) !important;
padding: 4px 12px; padding: 4px 12px;
border-radius: 0 !important; border-radius: 0 !important;
border: 2px solid var(--status-open) !important; border: 2px solid var(--status-pending) !important;
font-size: 0.875rem; font-size: 0.875rem;
font-weight: 500; font-weight: 500;
font-family: var(--font-mono); 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 { .status-Pending::before {
content: '['; content: '[';
margin-right: 4px; margin-right: 4px;
} }
.status-Resolved::after { .status-Pending::after {
content: ']'; content: ']';
margin-left: 4px; margin-left: 4px;
} }

View File

@@ -88,26 +88,26 @@
margin-left: 4px; margin-left: 4px;
} }
.status-Resolved { .status-Pending {
background-color: transparent !important; background-color: transparent !important;
color: var(--status-open) !important; color: var(--status-pending) !important;
padding: 8px 16px; padding: 8px 16px;
border-radius: 0 !important; border-radius: 0 !important;
border: 2px solid var(--status-open) !important; border: 2px solid var(--status-pending) !important;
font-weight: 500; font-weight: 500;
text-transform: uppercase; text-transform: uppercase;
font-size: 0.9em; font-size: 0.9em;
letter-spacing: 0.5px; letter-spacing: 0.5px;
font-family: var(--font-mono); 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 { .status-Pending::before {
content: '['; content: '[';
margin-right: 4px; margin-right: 4px;
} }
.status-Resolved::after { .status-Pending::after {
content: ']'; content: ']';
margin-left: 4px; margin-left: 4px;
} }

View File

@@ -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;

View File

@@ -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';
```