feat: aggiunto campo di testo per nota nell'area della modifica rapida di un ticket (nota rapida)

This commit is contained in:
VVER440 committed 2026-08-20 00:05:34 +02:00
1 parent 35888400ed
commit ba23635c7d
3 files changed
+87 -28

No files matched your search

+26 -1
View File
@@ -238,7 +238,11 @@ const TicketDetailView = {
<label class="quick-edit-label">Tempo (minuti)</label>
<input type="number" step="any" min="0" class="form-input" id="qe-time-unit" placeholder="minuti" style="padding: 6px 12px; height: 32px; font-size: 0.85rem;" />
</div>
<div style="margin-top:var(--space-md);display:flex;gap:var(--space-sm);justify-content:flex-end;">
<div class="quick-edit-field full-width">
<label class="quick-edit-label">Nota / Commento</label>
<textarea class="quick-edit-textarea" id="qe-note" placeholder="Inserisci una nota..."></textarea>
</div>
<div style="margin-top:var(--space-md);display:flex;gap:var(--space-sm);justify-content:flex-end;grid-column:1 / -1;">
<button class="btn btn-ghost btn-sm" id="qe-reset">Reset</button>
<button class="btn btn-primary btn-sm" id="qe-save" disabled>Salva Modifiche</button>
</div>
@@ -588,6 +592,7 @@ const TicketDetailView = {
const saveBtn = document.getElementById('qe-save');
const resetBtn = document.getElementById('qe-reset');
const timeUnitInput = document.getElementById('qe-time-unit');
const noteInput = document.getElementById('qe-note');
const checkChanges = () => {
let hasChanges = false;
@@ -610,6 +615,14 @@ const TicketDetailView = {
hasChanges = true;
}
const noteText = noteInput ? noteInput.value.trim() : '';
if (noteInput) {
noteInput.classList.toggle('changed', noteText.length > 0);
}
if (noteText.length > 0) {
hasChanges = true;
}
saveBtn.disabled = !hasChanges;
};
@@ -618,6 +631,10 @@ const TicketDetailView = {
timeUnitInput.addEventListener('input', checkChanges);
timeUnitInput.addEventListener('change', checkChanges);
}
if (noteInput) {
noteInput.addEventListener('input', checkChanges);
noteInput.addEventListener('change', checkChanges);
}
// Queue Autocomplete inside Quick Edit
const queueSearchInput = document.getElementById('qe-queue-search');
@@ -763,6 +780,10 @@ const TicketDetailView = {
if (timeUnitInput) {
timeUnitInput.value = '';
}
if (noteInput) {
noteInput.value = '';
noteInput.classList.remove('changed');
}
saveBtn.disabled = true;
});
@@ -803,6 +824,10 @@ const TicketDetailView = {
}
}
if (noteInput && noteInput.value.trim()) {
updates.note = noteInput.value.trim();
}
if (Object.keys(updates).length === 0) return;
try {