Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
403cc5b
1
Parent(s): 46af821
backend stabilization
Browse files
frontend/apps/internal/src/components/TicketDetails.module.css
CHANGED
|
@@ -58,6 +58,90 @@
|
|
| 58 |
position: relative;
|
| 59 |
background: var(--bg-dark);
|
| 60 |
height: calc(100vh - 56px); /* Specific height lock */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
}
|
| 62 |
|
| 63 |
/* --- Center Content (The Focus Area) --- */
|
|
@@ -579,6 +663,7 @@
|
|
| 579 |
border-top: 1px solid var(--border-subtle);
|
| 580 |
}
|
| 581 |
|
|
|
|
| 582 |
.toolGroup {
|
| 583 |
display: flex;
|
| 584 |
gap: 8px;
|
|
|
|
| 58 |
position: relative;
|
| 59 |
background: var(--bg-dark);
|
| 60 |
height: calc(100vh - 56px); /* Specific height lock */
|
| 61 |
+
flex-direction: column;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/* --- Property Quick Strip --- */
|
| 65 |
+
.propertyStrip {
|
| 66 |
+
display: flex;
|
| 67 |
+
background: var(--bg-card);
|
| 68 |
+
border-bottom: 1px solid var(--border-subtle);
|
| 69 |
+
padding: 0 40px;
|
| 70 |
+
min-height: 80px;
|
| 71 |
+
align-items: stretch;
|
| 72 |
+
gap: 0;
|
| 73 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
| 74 |
+
position: relative;
|
| 75 |
+
z-index: 8;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.propertySlot {
|
| 79 |
+
flex: 1;
|
| 80 |
+
padding: 16px 24px;
|
| 81 |
+
display: flex;
|
| 82 |
+
flex-direction: column;
|
| 83 |
+
justify-content: center;
|
| 84 |
+
gap: 4px;
|
| 85 |
+
cursor: pointer;
|
| 86 |
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
| 87 |
+
border-right: 1px solid var(--border-subtle);
|
| 88 |
+
max-width: 300px;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.propertySlot:last-child {
|
| 92 |
+
border-right: none;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.propertySlot:hover {
|
| 96 |
+
background: var(--bg-hover);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.slotLabel {
|
| 100 |
+
font-size: 10px;
|
| 101 |
+
font-weight: 900;
|
| 102 |
+
color: var(--text-dim);
|
| 103 |
+
text-transform: uppercase;
|
| 104 |
+
letter-spacing: 0.1em;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.slotValueArea {
|
| 108 |
+
display: flex;
|
| 109 |
+
align-items: center;
|
| 110 |
+
gap: 10px;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.slotValue {
|
| 114 |
+
font-size: 16px;
|
| 115 |
+
font-weight: 900;
|
| 116 |
+
color: var(--text-main);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.priorityDot {
|
| 120 |
+
width: 10px;
|
| 121 |
+
height: 10px;
|
| 122 |
+
border-radius: 50%;
|
| 123 |
+
flex-shrink: 0;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.assigneeAvatar {
|
| 127 |
+
width: 24px;
|
| 128 |
+
height: 24px;
|
| 129 |
+
border-radius: 8px;
|
| 130 |
+
background: var(--primary-light);
|
| 131 |
+
color: var(--primary);
|
| 132 |
+
display: flex;
|
| 133 |
+
align-items: center;
|
| 134 |
+
justify-content: center;
|
| 135 |
+
font-size: 10px;
|
| 136 |
+
font-weight: 900;
|
| 137 |
+
text-transform: uppercase;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* --- Layout Split --- */
|
| 141 |
+
.horizontalWorkspace {
|
| 142 |
+
display: flex;
|
| 143 |
+
flex: 1;
|
| 144 |
+
overflow: hidden;
|
| 145 |
}
|
| 146 |
|
| 147 |
/* --- Center Content (The Focus Area) --- */
|
|
|
|
| 663 |
border-top: 1px solid var(--border-subtle);
|
| 664 |
}
|
| 665 |
|
| 666 |
+
|
| 667 |
.toolGroup {
|
| 668 |
display: flex;
|
| 669 |
gap: 8px;
|
frontend/apps/internal/src/components/TicketDetails.tsx
CHANGED
|
@@ -138,6 +138,8 @@ export const TicketDetails: React.FC<TicketDetailsProps> = ({ initialTicket, onB
|
|
| 138 |
const [isRightOpen, setIsRightOpen] = useState(false);
|
| 139 |
const [rightActiveTab, setRightActiveTab] = useState<'external' | 'internal'>('external');
|
| 140 |
|
|
|
|
|
|
|
| 141 |
const bottomRef = useRef<HTMLDivElement>(null);
|
| 142 |
const autocompleteRef = useRef<HTMLDivElement>(null);
|
| 143 |
const replyFileInputRef = useRef<HTMLInputElement>(null);
|
|
@@ -194,6 +196,11 @@ export const TicketDetails: React.FC<TicketDetailsProps> = ({ initialTicket, onB
|
|
| 194 |
if (autocompleteRef.current && !autocompleteRef.current.contains(event.target as Node)) {
|
| 195 |
setShowAssigneeSuggestions(false);
|
| 196 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
};
|
| 198 |
|
| 199 |
// Auto-collapse logic for smaller screens
|
|
@@ -484,18 +491,76 @@ export const TicketDetails: React.FC<TicketDetailsProps> = ({ initialTicket, onB
|
|
| 484 |
</header>
|
| 485 |
|
| 486 |
<div className={styles.workspace}>
|
| 487 |
-
{/*
|
| 488 |
-
<
|
| 489 |
-
{/*
|
| 490 |
-
<div className={styles.
|
| 491 |
-
<div className={styles.
|
| 492 |
-
|
| 493 |
-
<div style={{
|
|
|
|
| 494 |
<select
|
| 495 |
-
className={styles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
value={ticket.status}
|
| 497 |
-
|
| 498 |
-
|
|
|
|
| 499 |
>
|
| 500 |
<option value="OPEN">OPEN</option>
|
| 501 |
<option value="ACKNOWLEDGED">ACKNOWLEDGED</option>
|
|
@@ -503,50 +568,37 @@ export const TicketDetails: React.FC<TicketDetailsProps> = ({ initialTicket, onB
|
|
| 503 |
<option value="RESOLVED">RESOLVED</option>
|
| 504 |
<option value="CLOSED">CLOSED</option>
|
| 505 |
</select>
|
|
|
|
| 506 |
<StatusBadge status={ticket.status} />
|
| 507 |
-
|
| 508 |
-
</div>
|
| 509 |
-
|
| 510 |
-
<div className={styles.propertyGroup}>
|
| 511 |
-
<div className={styles.propertyLabel}>PRIORITY LEVEL</div>
|
| 512 |
-
<select
|
| 513 |
-
className={styles.propertyValue}
|
| 514 |
-
value={ticket.priority}
|
| 515 |
-
onChange={(e) => handleUpdatePriority(e.target.value)}
|
| 516 |
-
>
|
| 517 |
-
<option value="P0">P0 - EMERGENCY</option>
|
| 518 |
-
<option value="P1">P1 - CRITICAL</option>
|
| 519 |
-
<option value="P2">P2 - MAJOR</option>
|
| 520 |
-
<option value="P3">P3 - MINOR</option>
|
| 521 |
-
</select>
|
| 522 |
</div>
|
|
|
|
| 523 |
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
|
|
|
|
|
|
|
|
|
| 534 |
/>
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
<div key={u.id} className={styles.suggestionItem} onClick={() => { handleUpdateAssignee(u.id); setShowAssigneeSuggestions(false); }}>
|
| 539 |
-
<div style={{ fontWeight: 700 }}>{u.full_name}</div>
|
| 540 |
-
<div style={{ fontSize: 10, opacity: 0.7 }}>{u.role}</div>
|
| 541 |
-
</div>
|
| 542 |
-
))}
|
| 543 |
-
</div>
|
| 544 |
-
)}
|
| 545 |
-
</div>
|
| 546 |
</div>
|
| 547 |
</div>
|
|
|
|
| 548 |
|
| 549 |
-
|
|
|
|
|
|
|
|
|
|
| 550 |
<div className={styles.sidebarSection}>
|
| 551 |
<div className={styles.propertyLabel}>SLA & METRICS</div>
|
| 552 |
<div className={styles.metricRow}>
|
|
@@ -811,6 +863,7 @@ export const TicketDetails: React.FC<TicketDetailsProps> = ({ initialTicket, onB
|
|
| 811 |
</div>
|
| 812 |
</aside>
|
| 813 |
</div>
|
|
|
|
| 814 |
|
| 815 |
{/* 4. Modals */}
|
| 816 |
{showResolutionModal && (
|
|
|
|
| 138 |
const [isRightOpen, setIsRightOpen] = useState(false);
|
| 139 |
const [rightActiveTab, setRightActiveTab] = useState<'external' | 'internal'>('external');
|
| 140 |
|
| 141 |
+
const [activeEditingSlot, setActiveEditingSlot] = useState<'priority' | 'assignee' | 'status' | null>(null);
|
| 142 |
+
|
| 143 |
const bottomRef = useRef<HTMLDivElement>(null);
|
| 144 |
const autocompleteRef = useRef<HTMLDivElement>(null);
|
| 145 |
const replyFileInputRef = useRef<HTMLInputElement>(null);
|
|
|
|
| 196 |
if (autocompleteRef.current && !autocompleteRef.current.contains(event.target as Node)) {
|
| 197 |
setShowAssigneeSuggestions(false);
|
| 198 |
}
|
| 199 |
+
|
| 200 |
+
// Close property strip slots if clicking outside
|
| 201 |
+
if (activeEditingSlot && !(event.target as HTMLElement).closest(`.${styles.propertySlot}`)) {
|
| 202 |
+
setActiveEditingSlot(null);
|
| 203 |
+
}
|
| 204 |
};
|
| 205 |
|
| 206 |
// Auto-collapse logic for smaller screens
|
|
|
|
| 491 |
</header>
|
| 492 |
|
| 493 |
<div className={styles.workspace}>
|
| 494 |
+
{/* Unified Property Strip */}
|
| 495 |
+
<div className={styles.propertyStrip}>
|
| 496 |
+
{/* Priority Slot */}
|
| 497 |
+
<div className={styles.propertySlot} onClick={() => setActiveEditingSlot(activeEditingSlot === 'priority' ? null : 'priority')}>
|
| 498 |
+
<div className={styles.slotLabel}>TICKET PRIORITY</div>
|
| 499 |
+
<div className={styles.slotValueArea}>
|
| 500 |
+
<div className={styles.priorityDot} style={{ background: ticket.priority === 'P0' ? 'var(--error)' : ticket.priority === 'P1' ? '#f59e0b' : 'var(--primary)' }} />
|
| 501 |
+
{activeEditingSlot === 'priority' ? (
|
| 502 |
<select
|
| 503 |
+
className={styles.propertySelect}
|
| 504 |
+
value={ticket.priority}
|
| 505 |
+
autoFocus
|
| 506 |
+
onChange={(e) => { handleUpdatePriority(e.target.value); setActiveEditingSlot(null); }}
|
| 507 |
+
onClick={(e) => e.stopPropagation()}
|
| 508 |
+
>
|
| 509 |
+
<option value="P0">P0 - EMERGENCY</option>
|
| 510 |
+
<option value="P1">P1 - CRITICAL</option>
|
| 511 |
+
<option value="P2">P2 - MAJOR</option>
|
| 512 |
+
<option value="P3">P3 - MINOR</option>
|
| 513 |
+
</select>
|
| 514 |
+
) : (
|
| 515 |
+
<span className={styles.slotValue}>{ticket.priority}</span>
|
| 516 |
+
)}
|
| 517 |
+
</div>
|
| 518 |
+
</div>
|
| 519 |
+
|
| 520 |
+
{/* Assignee Slot */}
|
| 521 |
+
<div className={styles.propertySlot} onClick={() => setActiveEditingSlot(activeEditingSlot === 'assignee' ? null : 'assignee')}>
|
| 522 |
+
<div className={styles.slotLabel}>ASSIGNED AGENT</div>
|
| 523 |
+
<div className={styles.slotValueArea}>
|
| 524 |
+
<div className={styles.assigneeAvatar}>{ticket.assigned_name?.[0] || 'N'}</div>
|
| 525 |
+
{activeEditingSlot === 'assignee' ? (
|
| 526 |
+
<div style={{ position: 'relative', flex: 1 }} onClick={(e) => e.stopPropagation()} ref={autocompleteRef}>
|
| 527 |
+
<input
|
| 528 |
+
type="text"
|
| 529 |
+
className={styles.propertyInput}
|
| 530 |
+
value={assigneeSearch}
|
| 531 |
+
autoFocus
|
| 532 |
+
onChange={(e) => { setAssigneeSearch(e.target.value); setShowAssigneeSuggestions(true); }}
|
| 533 |
+
onFocus={() => setShowAssigneeSuggestions(true)}
|
| 534 |
+
placeholder="Search analyst..."
|
| 535 |
+
/>
|
| 536 |
+
{showAssigneeSuggestions && (
|
| 537 |
+
<div className={styles.autocompleteSuggestions} style={{ top: 40 }}>
|
| 538 |
+
{internalUsers.filter(u => u.full_name?.toLowerCase().includes(assigneeSearch.toLowerCase())).map(u => (
|
| 539 |
+
<div key={u.id} className={styles.suggestionItem} onClick={() => { handleUpdateAssignee(u.id); setActiveEditingSlot(null); setShowAssigneeSuggestions(false); }}>
|
| 540 |
+
<div style={{ fontWeight: 700, fontSize: 12 }}>{u.full_name}</div>
|
| 541 |
+
<div style={{ fontSize: 9, opacity: 0.7 }}>{u.role}</div>
|
| 542 |
+
</div>
|
| 543 |
+
))}
|
| 544 |
+
</div>
|
| 545 |
+
)}
|
| 546 |
+
</div>
|
| 547 |
+
) : (
|
| 548 |
+
<span className={styles.slotValue}>{ticket.assigned_name || "Unassigned"}</span>
|
| 549 |
+
)}
|
| 550 |
+
</div>
|
| 551 |
+
</div>
|
| 552 |
+
|
| 553 |
+
{/* Status Slot */}
|
| 554 |
+
<div className={styles.propertySlot} onClick={() => setActiveEditingSlot(activeEditingSlot === 'status' ? null : 'status')}>
|
| 555 |
+
<div className={styles.slotLabel}>OPERATIONAL STATUS</div>
|
| 556 |
+
<div className={styles.slotValueArea}>
|
| 557 |
+
{activeEditingSlot === 'status' ? (
|
| 558 |
+
<select
|
| 559 |
+
className={styles.propertySelect}
|
| 560 |
value={ticket.status}
|
| 561 |
+
autoFocus
|
| 562 |
+
onChange={(e) => { handleUpdateStatus(e.target.value); setActiveEditingSlot(null); }}
|
| 563 |
+
onClick={(e) => e.stopPropagation()}
|
| 564 |
>
|
| 565 |
<option value="OPEN">OPEN</option>
|
| 566 |
<option value="ACKNOWLEDGED">ACKNOWLEDGED</option>
|
|
|
|
| 568 |
<option value="RESOLVED">RESOLVED</option>
|
| 569 |
<option value="CLOSED">CLOSED</option>
|
| 570 |
</select>
|
| 571 |
+
) : (
|
| 572 |
<StatusBadge status={ticket.status} />
|
| 573 |
+
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 574 |
</div>
|
| 575 |
+
</div>
|
| 576 |
|
| 577 |
+
{/* ETA Slot */}
|
| 578 |
+
<div className={styles.propertySlot} onClick={() => setActiveEditingSlot(activeEditingSlot === 'eta' ? null : 'eta')}>
|
| 579 |
+
<div className={styles.slotLabel}>ESTIMATED RESOLUTION</div>
|
| 580 |
+
<div className={styles.slotValueArea}>
|
| 581 |
+
{activeEditingSlot === 'eta' ? (
|
| 582 |
+
<input
|
| 583 |
+
className={styles.propertyInput}
|
| 584 |
+
value={ticket.eta || ""}
|
| 585 |
+
autoFocus
|
| 586 |
+
onChange={(e) => handleUpdateField('eta', e.target.value)}
|
| 587 |
+
onBlur={() => setActiveEditingSlot(null)}
|
| 588 |
+
onClick={(e) => e.stopPropagation()}
|
| 589 |
+
placeholder="e.g. 2h"
|
| 590 |
/>
|
| 591 |
+
) : (
|
| 592 |
+
<span className={styles.slotValue}>{ticket.eta || "PENDING"}</span>
|
| 593 |
+
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 594 |
</div>
|
| 595 |
</div>
|
| 596 |
+
</div>
|
| 597 |
|
| 598 |
+
<div className={styles.horizontalWorkspace}>
|
| 599 |
+
{/* Left Sidebar (Operational Properties & Intelligence) */}
|
| 600 |
+
<aside className={`${styles.leftSidebar} ${!isLeftOpen ? styles.leftSidebarCollapsed : ''}`}>
|
| 601 |
+
{/* Operational Properties */}
|
| 602 |
<div className={styles.sidebarSection}>
|
| 603 |
<div className={styles.propertyLabel}>SLA & METRICS</div>
|
| 604 |
<div className={styles.metricRow}>
|
|
|
|
| 863 |
</div>
|
| 864 |
</aside>
|
| 865 |
</div>
|
| 866 |
+
</div>
|
| 867 |
|
| 868 |
{/* 4. Modals */}
|
| 869 |
{showResolutionModal && (
|