feat: gestione gruppi di ticket. feat: miglioramento filtri ticket a mio carico e ticket. feat: possiblità di copiare il numero del tocket con pulsante copia
This commit is contained in:
@@ -142,6 +142,11 @@ const App = {
|
||||
titleEl.textContent = 'Apertura Massiva Ticket';
|
||||
TicketBulkView.render();
|
||||
|
||||
} else if (hash === '#/tickets/groups') {
|
||||
document.getElementById('nav-ticket-groups')?.classList.add('active');
|
||||
titleEl.textContent = 'Gruppi ticket';
|
||||
TicketGroupsView.render();
|
||||
|
||||
} else if (hash === '#/activity') {
|
||||
document.getElementById('nav-activity')?.classList.add('active');
|
||||
titleEl.textContent = 'Storico Attività';
|
||||
@@ -721,6 +726,93 @@ const App = {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/** Custom prompt dialog in the center of the screen */
|
||||
prompt(title, message, options = {}) {
|
||||
return new Promise((resolve) => {
|
||||
const overlay = document.createElement('div');
|
||||
overlay.style.position = 'fixed';
|
||||
overlay.style.top = '0';
|
||||
overlay.style.left = '0';
|
||||
overlay.style.width = '100vw';
|
||||
overlay.style.height = '100vh';
|
||||
overlay.style.background = 'rgba(0, 0, 0, 0.6)';
|
||||
overlay.style.backdropFilter = 'blur(4px)';
|
||||
overlay.style.display = 'flex';
|
||||
overlay.style.alignItems = 'center';
|
||||
overlay.style.justifyContent = 'center';
|
||||
overlay.style.zIndex = '99999';
|
||||
overlay.style.opacity = '0';
|
||||
overlay.style.transition = 'opacity 0.2s ease';
|
||||
|
||||
const card = document.createElement('div');
|
||||
card.style.background = 'var(--bg-card, #1e1e2e)';
|
||||
card.style.border = '1px solid var(--border-subtle, #313244)';
|
||||
card.style.borderRadius = 'var(--radius-lg, 12px)';
|
||||
card.style.padding = 'var(--space-lg, 24px)';
|
||||
card.style.width = '100%';
|
||||
card.style.maxWidth = '400px';
|
||||
card.style.boxShadow = 'var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.5))';
|
||||
card.style.transform = 'scale(0.9)';
|
||||
card.style.transition = 'transform 0.2s ease';
|
||||
card.className = 'prompt-dialog-card';
|
||||
|
||||
card.innerHTML = `
|
||||
<h3 style="margin-top: 0; margin-bottom: var(--space-xs, 8px); color: var(--text-primary, #cdd6f4); font-size: 1.2rem; font-weight: 600;">${title}</h3>
|
||||
<p style="margin-bottom: var(--space-sm, 12px); color: var(--text-muted, #a6adc8); font-size: 0.95rem; line-height: 1.5;">${message}</p>
|
||||
<input type="text" id="prompt-input-field" class="form-input" value="${options.defaultValue || ''}" placeholder="${options.placeholder || ''}" style="width: 100%; margin-bottom: var(--space-md, 16px); box-sizing: border-box;" />
|
||||
<div style="display: flex; gap: var(--space-sm, 12px); justify-content: flex-end;">
|
||||
<button id="prompt-btn-cancel" class="btn btn-ghost" style="height: 36px; font-size: 0.9rem; padding: 0 16px; border-radius: var(--radius-md, 6px);">${options.cancelText || 'Annulla'}</button>
|
||||
<button id="prompt-btn-ok" class="btn btn-primary" style="height: 36px; font-size: 0.9rem; padding: 0 16px; border-radius: var(--radius-md, 6px); font-weight: 500; cursor: pointer;">${options.confirmText || 'Salva'}</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
overlay.appendChild(card);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
const input = card.querySelector('#prompt-input-field');
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
overlay.style.opacity = '1';
|
||||
card.style.transform = 'scale(1)';
|
||||
setTimeout(() => {
|
||||
if (input) input.focus();
|
||||
}, 50);
|
||||
});
|
||||
|
||||
const cleanUp = (resultValue) => {
|
||||
overlay.style.opacity = '0';
|
||||
card.style.transform = 'scale(0.9)';
|
||||
setTimeout(() => {
|
||||
overlay.remove();
|
||||
resolve(resultValue);
|
||||
}, 200);
|
||||
};
|
||||
|
||||
const btnCancel = card.querySelector('#prompt-btn-cancel');
|
||||
const btnOk = card.querySelector('#prompt-btn-ok');
|
||||
|
||||
btnCancel.addEventListener('click', () => cleanUp(null));
|
||||
btnOk.addEventListener('click', () => {
|
||||
const val = input ? input.value : '';
|
||||
cleanUp(val);
|
||||
});
|
||||
|
||||
if (input) {
|
||||
input.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
btnOk.click();
|
||||
} else if (e.key === 'Escape') {
|
||||
btnCancel.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
overlay.addEventListener('click', (e) => {
|
||||
if (e.target === overlay) cleanUp(null);
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// Start the app when DOM is ready
|
||||
|
||||
Reference in New Issue
Block a user