Lisää saatavuus-tikettityyppi + fallback-väri käsin lisätyille tyypeille

- Saatavuus-tyyppi oletuksiin (teal-väri)
- Fallback CSS: tuntemattomat tyypit saavat violetin taustan
- TypeLabel näyttää tyypin nimen isolla alkukirjaimella jos ei löydy labelista

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 09:24:52 +02:00
parent 6bbd224104
commit 79ec93b293
3 changed files with 15 additions and 3 deletions

View File

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

View File

@@ -1374,6 +1374,7 @@ let ticketTypeLabels = {
tekniikka: 'Tekniikka',
vika: 'Vika',
abuse: 'Abuse',
saatavuus: 'Saatavuus',
muu: 'Muu',
};
@@ -1486,7 +1487,7 @@ function renderTickets() {
const multiCompany = availableCompanies.length > 1;
ttbody.innerHTML = pageTickets.map(t => {
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] || (t.type ? t.type.charAt(0).toUpperCase() + t.type.slice(1) : 'Muu');
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 companyBadge = multiCompany && t.company_name ? `<span class="company-badge">${esc(t.company_name)}</span> ` : '';

View File

@@ -1379,6 +1379,17 @@ span.empty {
color: #e65100;
}
.ticket-type-saatavuus {
background: #e0f2f1;
color: #00695c;
}
/* Fallback: käsin lisätyt tyypit ilman omaa väriä */
.ticket-type[class*="ticket-type-"]:not(.ticket-type-laskutus):not(.ticket-type-tekniikka):not(.ticket-type-vika):not(.ticket-type-muu):not(.ticket-type-abuse):not(.ticket-type-saatavuus) {
background: #ede7f6;
color: #4527a0;
}
.ticket-type-item {
display: flex;
align-items: center;