fix: ora è possibile variare la quantità di risultati dalla pagina ricerca spudorata. feat: aggiunto shortcut ctrl+shift+f per raggiungere la pagina ricerca spudorata.

This commit is contained in:
Gabriele Cimaschi committed 2026-09-11 18:27:12 +02:00
1 parent 6944b02263
commit a15ab7e89d
3 files changed
+57 -2

No files matched your search

+13 -1
View File
@@ -65,6 +65,7 @@ const App = {
create_ticket_submit: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true },
quick_edit_save: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true },
pdf_save_edited: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true },
ricerca_spudorata_open: { ctrl: true, alt: false, shift: true, key: 'f', enabled: true },
};
return defaults[id] || { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true };
},
@@ -261,13 +262,24 @@ const App = {
toggleClearBtn();
}
// Global keyboard shortcuts (e.g. Crea Nuovo Ticket)
// Global keyboard shortcuts (e.g. Crea Nuovo Ticket, Ricerca Spudorata)
document.addEventListener('keydown', (e) => {
if (this.isShortcutTriggered(e, 'create_ticket_open')) {
if (window.location.hash !== '#/tickets/new') {
e.preventDefault();
window.location.hash = '#/tickets/new';
}
} else if (this.isShortcutTriggered(e, 'ricerca_spudorata_open')) {
e.preventDefault();
if (!window.location.hash.startsWith('#/ricerca-spudorata')) {
window.location.hash = '#/ricerca-spudorata';
} else {
const searchInput = document.getElementById('spudorata-search-input');
if (searchInput) {
searchInput.focus();
searchInput.select();
}
}
}
});
+37 -1
View File
@@ -49,6 +49,14 @@ const RicercaSpudorataView = {
this.renderContainer(container);
this.bindEvents();
setTimeout(() => {
const input = document.getElementById('spudorata-search-input');
if (input) {
input.focus();
input.select();
}
}, 50);
},
renderContainer(container) {
@@ -420,17 +428,34 @@ const RicercaSpudorataView = {
},
renderPagination(current, perPage, total, totalPages, isTop = false) {
const limitSelectHtml = `
<div style="display:inline-flex; align-items:center; gap:var(--space-xs); font-size:0.8rem; color:var(--text-secondary);">
<span>Righe:</span>
<select class="form-select spudorata-per-page-select" style="padding: 2px 24px 2px 6px; font-size: 0.75rem; height: 26px; min-width: 65px; margin: 0; background-position: right 6px center; border-color: var(--border-light);">
<option value="10" ${perPage === 10 ? 'selected' : ''}>10</option>
<option value="20" ${perPage === 20 ? 'selected' : ''}>20</option>
<option value="50" ${perPage === 50 ? 'selected' : ''}>50</option>
<option value="100" ${perPage === 100 ? 'selected' : ''}>100</option>
<option value="200" ${perPage === 200 ? 'selected' : ''}>200</option>
<option value="500" ${perPage === 500 ? 'selected' : ''}>500</option>
</select>
</div>
`;
return `
<div class="pagination" style="${isTop ? 'margin-bottom:var(--space-md);' : 'margin-top:var(--space-md);'} align-items:center; justify-content:space-between; display:flex;">
<div class="pagination-info" style="font-size:0.82rem; color:var(--text-tertiary);">
Mostrati ${Math.min(total, (current - 1) * perPage + 1)}-${Math.min(total, current * perPage)} di ${total} ticket
Mostrati ${total > 0 ? Math.min(total, (current - 1) * perPage + 1) : 0}-${Math.min(total, current * perPage)} di ${total} ticket
</div>
<div class="pagination-controls" style="display:flex; align-items:center; gap:var(--space-sm);">
${limitSelectHtml}
<div class="pagination-buttons" style="display:flex; gap:4px;">
<button class="pagination-btn spudorata-page-btn" data-page="${Math.max(1, current - 1)}" ${current === 1 ? 'disabled' : ''}>&laquo;</button>
${this.renderPageNumbers(current, totalPages)}
<button class="pagination-btn spudorata-page-btn" data-page="${Math.min(totalPages, current + 1)}" ${current === totalPages ? 'disabled' : ''}>&raquo;</button>
</div>
</div>
</div>
`;
},
@@ -575,6 +600,17 @@ const RicercaSpudorataView = {
});
});
document.querySelectorAll('.spudorata-per-page-select').forEach(sel => {
sel.addEventListener('change', (e) => {
const val = parseInt(e.target.value, 10);
if (!isNaN(val) && val > 0) {
this.perPage = val;
this.currentPage = 1;
this.renderLocalResults();
}
});
});
document.querySelectorAll('.spudorata-page-btn').forEach(btn => {
btn.addEventListener('click', () => {
const page = parseInt(btn.dataset.page, 10);
+7
View File
@@ -65,6 +65,13 @@ const ShortcutsView = {
context: 'Globale',
defaultCombo: { ctrl: true, alt: true, shift: false, key: 'n', enabled: true }
},
{
id: 'ricerca_spudorata_open',
name: 'Apri Ricerca Spudorata',
description: 'Naviga direttamente alla pagina di Ricerca Spudorata o mette a fuoco il campo di ricerca',
context: 'Globale',
defaultCombo: { ctrl: true, alt: false, shift: true, key: 'f', enabled: true }
},
{
id: 'create_ticket_submit',
name: 'Invia Nuovo Ticket',