feat: aggiunto campo di testo per nota nell'area della modifica rapida di un ticket (nota rapida)
This commit is contained in:
1 parent
35888400ed
commit
ba23635c7d
3 files changed
+87
-28
No files matched your search
+24
-1
@@ -1355,7 +1355,30 @@ body {
|
||||
box-shadow: 0 0 0 3px var(--accent-primary-glow);
|
||||
}
|
||||
|
||||
.quick-edit-select.changed {
|
||||
.quick-edit-field.full-width {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.quick-edit-textarea {
|
||||
padding: 8px 12px;
|
||||
background: var(--bg-tertiary);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--text-primary);
|
||||
font-family: inherit;
|
||||
font-size: 0.85rem;
|
||||
outline: none;
|
||||
resize: vertical;
|
||||
min-height: 60px;
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.quick-edit-textarea:focus {
|
||||
border-color: var(--accent-primary);
|
||||
box-shadow: 0 0 0 3px var(--accent-primary-glow);
|
||||
}
|
||||
|
||||
.quick-edit-textarea.changed {
|
||||
border-color: var(--success);
|
||||
box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user