Korjaa tikettiviestiluokittelu: outgoing-tyyppi tunnistetaan nyt lähteviksi

Zammad-synkasta tulevat viestit käyttävät tyyppiä 'outgoing' (ei 'reply_out'),
joten ne näkyivät virheellisesti saapuvina (sininen). Nyt molemmat tyypit
tunnistetaan lähteviksi ja näytetään vihreällä taustalla.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 02:44:10 +02:00
parent 8d5ef864f9
commit 1b5b870ea9
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Noxus HUB</title> <title>Noxus HUB</title>
<link rel="stylesheet" href="style.css?v=20260313n"> <link rel="stylesheet" href="style.css?v=20260313o">
</head> </head>
<body> <body>
<!-- Login --> <!-- Login -->
@@ -2257,6 +2257,6 @@
</div> </div>
</div> </div>
<script src="script.js?v=20260313n"></script> <script src="script.js?v=20260313o"></script>
</body> </body>
</html> </html>

View File

@@ -1480,7 +1480,7 @@ function renderTickets() {
document.getElementById('tickets-table').style.display = 'table'; document.getElementById('tickets-table').style.display = 'table';
const multiCompany = availableCompanies.length > 1; const multiCompany = availableCompanies.length > 1;
ttbody.innerHTML = pageTickets.map(t => { ttbody.innerHTML = pageTickets.map(t => {
const lastType = t.last_message_type === 'reply_out' ? '&#8594;' : (t.last_message_type === 'note' ? '&#128221;' : '&#8592;'); const lastType = (t.last_message_type === 'reply_out' || t.last_message_type === 'outgoing') ? '&#8594;' : (t.last_message_type === 'note' ? '&#128221;' : '&#8592;');
const typeLabel = ticketTypeLabels[t.type] || 'Muu'; const typeLabel = ticketTypeLabels[t.type] || 'Muu';
const rowClass = t.priority === 'urgent' ? 'ticket-row-urgent' : (t.priority === 'tärkeä' ? 'ticket-row-important' : (t.status === 'kasittelyssa' ? 'ticket-row-active' : '')); const rowClass = t.priority === 'urgent' ? 'ticket-row-urgent' : (t.priority === 'tärkeä' ? 'ticket-row-important' : (t.status === 'kasittelyssa' ? 'ticket-row-active' : ''));
const checked = bulkSelectedIds.has(t.id) ? 'checked' : ''; const checked = bulkSelectedIds.has(t.id) ? 'checked' : '';
@@ -1811,11 +1811,11 @@ async function showTicketDetail(id, companyId = '') {
// Thread messages // Thread messages
const thread = document.getElementById('ticket-thread'); const thread = document.getElementById('ticket-thread');
thread.innerHTML = (ticket.messages || []).map(m => { thread.innerHTML = (ticket.messages || []).map(m => {
const isOut = m.type === 'reply_out'; const isOut = m.type === 'reply_out' || m.type === 'outgoing';
const isAutoReply = m.type === 'auto_reply'; const isAutoReply = m.type === 'auto_reply';
const isNote = m.type === 'note'; const isNote = m.type === 'note';
const typeClass = (isOut || isAutoReply) ? 'ticket-msg-out' : (isNote ? 'ticket-msg-note' : 'ticket-msg-in'); const typeClass = (isOut || isAutoReply) ? 'ticket-msg-out' : (isNote ? 'ticket-msg-note' : 'ticket-msg-in');
const typeIcon = isAutoReply ? '&#9889; Automaattinen vastaus' : (isOut ? '&#8594; Vastaus' : (isNote ? '&#128221; Muistiinpano' : '&#8592; Saapunut')); const typeIcon = isAutoReply ? '&#9889; Automaattinen vastaus' : (isOut ? '&#8594; Lähetetty' : (isNote ? '&#128221; Muistiinpano' : '&#8592; Saapunut'));
return `<div class="ticket-message ${typeClass}"> return `<div class="ticket-message ${typeClass}">
<div class="ticket-msg-header"> <div class="ticket-msg-header">
<span class="ticket-msg-type">${typeIcon}</span> <span class="ticket-msg-type">${typeIcon}</span>