From e5f7a7d3a6bbc1c9b8ad4ebcc8eb9b42f94c025d Mon Sep 17 00:00:00 2001 From: DevEnv nis2-agile Date: Wed, 24 Jun 2026 03:11:19 +0200 Subject: [PATCH] [FIX] Widget Segnalazioni: cap descrizione 1900 char + contatore, evita errore 'Data too long operative_summary' (ticket #430) La colonna operative_summary lato ticket-ms e' VARCHAR(2000): descrizioni lunghe causavano l'errore SQL grezzo a video. Aggiunto maxlength + contatore live + guard al submit nel widget locale public/js/bug-reporter.js. Cache-buster: bug-reporter.js?v=20260624 in common.js + common.js?v=20260624 su tutte le pagine. Causa radice (dimensione colonna) inoltrata ad AgileHub. Co-Authored-By: Claude Opus 4.8 --- public/_app-bi-demo.html | 2 +- public/admin/index.html | 2 +- public/admin/organizations.html | 2 +- public/admin/users.html | 2 +- public/architecture.html | 2 +- public/assessment.html | 2 +- public/assets.html | 2 +- public/calendario.html | 2 +- public/companies.html | 2 +- public/competenze.html | 2 +- public/controlli-periodici.html | 2 +- public/cross-analysis.html | 2 +- public/dashboard.html | 2 +- public/guida.html | 2 +- public/incidents.html | 2 +- public/integrazioniext.html | 2 +- public/internal-audits.html | 2 +- public/isms.html | 2 +- public/js/bug-reporter.js | 27 +++++++++++++++++++++++++-- public/js/common.js | 2 +- public/kb.html | 2 +- public/login.html | 2 +- public/management-review.html | 2 +- public/misure-requisiti.html | 2 +- public/mktg-api-doc.html | 2 +- public/normative.html | 2 +- public/onboarding.html | 2 +- public/organigramma.html | 2 +- public/policies.html | 2 +- public/raci.html | 2 +- public/register.html | 2 +- public/reports.html | 2 +- public/review-schedule.html | 2 +- public/risks.html | 2 +- public/settings.html | 2 +- public/stakeholder-activities.html | 2 +- public/stakeholders.html | 2 +- public/supply-chain.html | 2 +- public/training.html | 2 +- public/version.json | 2 +- public/whistleblowing.html | 2 +- public/workflow.html | 2 +- 42 files changed, 66 insertions(+), 43 deletions(-) diff --git a/public/_app-bi-demo.html b/public/_app-bi-demo.html index 136c08f..6ee92c0 100644 --- a/public/_app-bi-demo.html +++ b/public/_app-bi-demo.html @@ -71,7 +71,7 @@ - + - + diff --git a/public/admin/organizations.html b/public/admin/organizations.html index 35e8e1f..20e34c1 100644 --- a/public/admin/organizations.html +++ b/public/admin/organizations.html @@ -148,7 +148,7 @@ - + diff --git a/public/admin/users.html b/public/admin/users.html index 967ac0b..77f78dd 100644 --- a/public/admin/users.html +++ b/public/admin/users.html @@ -170,7 +170,7 @@ - + diff --git a/public/architecture.html b/public/architecture.html index ec03b1f..650a3ee 100644 --- a/public/architecture.html +++ b/public/architecture.html @@ -1091,7 +1091,7 @@ - + diff --git a/public/assessment.html b/public/assessment.html index 05bb31c..7d6fdc5 100644 --- a/public/assessment.html +++ b/public/assessment.html @@ -155,7 +155,7 @@ - + diff --git a/public/assets.html b/public/assets.html index 3bcf825..36b7485 100644 --- a/public/assets.html +++ b/public/assets.html @@ -362,7 +362,7 @@ - + diff --git a/public/calendario.html b/public/calendario.html index c5e4f1f..b9b7587 100644 --- a/public/calendario.html +++ b/public/calendario.html @@ -152,7 +152,7 @@ - + diff --git a/public/companies.html b/public/companies.html index 71494fd..2527815 100644 --- a/public/companies.html +++ b/public/companies.html @@ -350,7 +350,7 @@ - + diff --git a/public/competenze.html b/public/competenze.html index a3edd7b..a4fc2e1 100644 --- a/public/competenze.html +++ b/public/competenze.html @@ -184,7 +184,7 @@ - + diff --git a/public/controlli-periodici.html b/public/controlli-periodici.html index 313df2f..323a7f1 100644 --- a/public/controlli-periodici.html +++ b/public/controlli-periodici.html @@ -137,7 +137,7 @@ - + diff --git a/public/cross-analysis.html b/public/cross-analysis.html index 03859e3..d60d249 100644 --- a/public/cross-analysis.html +++ b/public/cross-analysis.html @@ -383,7 +383,7 @@ - + diff --git a/public/dashboard.html b/public/dashboard.html index 1ebbc1b..da57aca 100644 --- a/public/dashboard.html +++ b/public/dashboard.html @@ -144,7 +144,7 @@ - + diff --git a/public/guida.html b/public/guida.html index c79bdaf..c09ad3b 100644 --- a/public/guida.html +++ b/public/guida.html @@ -1143,7 +1143,7 @@ - + diff --git a/public/incidents.html b/public/incidents.html index c8ec191..117faf5 100644 --- a/public/incidents.html +++ b/public/incidents.html @@ -352,7 +352,7 @@ - + diff --git a/public/integrazioniext.html b/public/integrazioniext.html index 4142a37..5638448 100644 --- a/public/integrazioniext.html +++ b/public/integrazioniext.html @@ -912,7 +912,7 @@ curl -H "X-API-Key: nis2_TUA_CHIAVE" \ - + - + diff --git a/public/isms.html b/public/isms.html index 0576237..3cf504f 100644 --- a/public/isms.html +++ b/public/isms.html @@ -185,7 +185,7 @@ - + diff --git a/public/js/bug-reporter.js b/public/js/bug-reporter.js index 6e17931..8b8a4ad 100644 --- a/public/js/bug-reporter.js +++ b/public/js/bug-reporter.js @@ -27,6 +27,10 @@ const script = document.currentScript || document.querySelector('script[data-product]'); const WIDGET_VERSION = '1.4.15'; const WIDGET_BUILD = '20260415d'; + // Limite descrizione: la colonna operative_summary lato ticket-ms e' VARCHAR(2000); + // alla descrizione viene aggiunto il tag versione (~30 char) prima dell'invio, + // quindi cappiamo a 1900 per evitare l'errore "Data too long for column 'operative_summary'". + const NX_DESC_MAX = 1900; const CFG = { apiUrl: (script && script.dataset.apiUrl) || 'http://localhost', apiKey: (script && script.dataset.apiKey) || '', @@ -471,7 +475,8 @@ - + +
0 / ${NX_DESC_MAX}
@@ -487,6 +492,16 @@ // Paste handler const desc = document.getElementById('nx-desc'); + // Contatore caratteri live (limite colonna operative_summary) + const counter = document.getElementById('nx-desc-counter'); + const updateCounter = () => { + if (!counter) return; + const n = desc.value.length; + counter.textContent = n + ' / ' + NX_DESC_MAX; + counter.style.color = n >= NX_DESC_MAX ? '#dc2626' : '#6b7280'; + }; + desc.addEventListener('input', updateCounter); + updateCounter(); desc.addEventListener('paste', handlePaste); // Drag & drop desc.addEventListener('dragover', (e) => { e.preventDefault(); desc.classList.add('drag-over'); }); @@ -613,7 +628,8 @@ btn.style.background = '#fee2e2'; recognition.onresult = (e) => { const desc = document.getElementById('nx-desc'); - desc.value += (desc.value ? '\n' : '') + e.results[0][0].transcript; + desc.value = (desc.value + (desc.value ? '\n' : '') + e.results[0][0].transcript).slice(0, NX_DESC_MAX); + desc.dispatchEvent(new Event('input')); btn.textContent = '🎀 Parla'; btn.style.background = ''; }; recognition.onerror = recognition.onend = () => { btn.textContent = '🎀 Parla'; btn.style.background = ''; }; @@ -629,6 +645,13 @@ const result = document.getElementById('nx-result'); if (!desc && _attachments.length === 0) { alert('Descrivi il problema o allega uno screenshot'); return; } + if (desc && desc.length > NX_DESC_MAX) { + const result0 = document.getElementById('nx-result'); + result0.className = 'nx-result err'; + result0.style.display = 'block'; + result0.textContent = `❌ Descrizione troppo lunga: massimo ${NX_DESC_MAX} caratteri (ne hai ${desc.length}). Accorcia il testo o allega un file.`; + return; + } submitBtn.disabled = true; submitBtn.textContent = 'Invio in corso...'; diff --git a/public/js/common.js b/public/js/common.js index ec94b0f..1ea0219 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -957,7 +957,7 @@ function switchLang(lang) { // ticket con richiedente vuoto β†’ invisibili in "Le mie segnalazioni". Fallback safe = prec. var _injectBugReporter = function (email, name) { var s = document.createElement('script'); - s.src = 'js/bug-reporter.js?v=20260623'; + s.src = 'js/bug-reporter.js?v=20260624'; s.async = true; s.dataset.product = 'NIS2'; s.dataset.tenantId = '7'; diff --git a/public/kb.html b/public/kb.html index 9864d3c..6942aa5 100644 --- a/public/kb.html +++ b/public/kb.html @@ -151,7 +151,7 @@
- + diff --git a/public/login.html b/public/login.html index 5577472..49fc321 100644 --- a/public/login.html +++ b/public/login.html @@ -95,7 +95,7 @@ - + - + diff --git a/public/misure-requisiti.html b/public/misure-requisiti.html index 5cbe123..296b78c 100644 --- a/public/misure-requisiti.html +++ b/public/misure-requisiti.html @@ -168,7 +168,7 @@ - + diff --git a/public/mktg-api-doc.html b/public/mktg-api-doc.html index 39d13ac..5610396 100644 --- a/public/mktg-api-doc.html +++ b/public/mktg-api-doc.html @@ -426,6 +426,6 @@ curl https://nis2.agile.software/api/services/status - + diff --git a/public/normative.html b/public/normative.html index a1996d8..fd6944b 100644 --- a/public/normative.html +++ b/public/normative.html @@ -113,7 +113,7 @@ - + diff --git a/public/onboarding.html b/public/onboarding.html index e8fdaf8..7519de0 100644 --- a/public/onboarding.html +++ b/public/onboarding.html @@ -495,7 +495,7 @@ - + - + diff --git a/public/policies.html b/public/policies.html index c5f98a6..df10351 100644 --- a/public/policies.html +++ b/public/policies.html @@ -334,7 +334,7 @@ - + diff --git a/public/raci.html b/public/raci.html index 140a43e..9e86ed5 100644 --- a/public/raci.html +++ b/public/raci.html @@ -132,7 +132,7 @@ - + diff --git a/public/register.html b/public/register.html index 9a6389d..ae06c8a 100644 --- a/public/register.html +++ b/public/register.html @@ -269,7 +269,7 @@ - + - + diff --git a/public/review-schedule.html b/public/review-schedule.html index 847b838..f484adb 100644 --- a/public/review-schedule.html +++ b/public/review-schedule.html @@ -142,7 +142,7 @@ - + diff --git a/public/risks.html b/public/risks.html index d8c8093..4eb5cd4 100644 --- a/public/risks.html +++ b/public/risks.html @@ -495,7 +495,7 @@ - + diff --git a/public/settings.html b/public/settings.html index 3ec091a..73dc499 100644 --- a/public/settings.html +++ b/public/settings.html @@ -689,7 +689,7 @@ - + diff --git a/public/stakeholder-activities.html b/public/stakeholder-activities.html index 9cadfe7..1996f9f 100644 --- a/public/stakeholder-activities.html +++ b/public/stakeholder-activities.html @@ -195,7 +195,7 @@ - + diff --git a/public/stakeholders.html b/public/stakeholders.html index e8e21f2..0d62b57 100644 --- a/public/stakeholders.html +++ b/public/stakeholders.html @@ -192,7 +192,7 @@ - + diff --git a/public/supply-chain.html b/public/supply-chain.html index ae03593..c7fabdd 100644 --- a/public/supply-chain.html +++ b/public/supply-chain.html @@ -478,7 +478,7 @@ - + diff --git a/public/training.html b/public/training.html index 578193e..7c23b27 100644 --- a/public/training.html +++ b/public/training.html @@ -293,7 +293,7 @@ - + diff --git a/public/version.json b/public/version.json index 174a864..343c0ed 100644 --- a/public/version.json +++ b/public/version.json @@ -1 +1 @@ -{"version": "1.24.11", "build": "2026-06-24-v1.24.11", "date": "2026-06-24", "changelog": "Assistente ARIA β€” Quando chiedi spiegazioni sulle tendine della Β«Valuta Rilevanza NIS2Β» (Inventario), ARIA ora conosce la griglia ESATTA della finestra (i 6 criteri, le opzioni e i relativi punteggi) e risponde in modo corrispondente a cio' che vedi, senza piu' descrizioni generiche o non pertinenti. Risolto ticket #429."} +{"version": "1.24.12", "build": "2026-06-24-v1.24.12", "date": "2026-06-24", "changelog": "Widget Segnalazioni β€” Risolto l'errore \"Data too long for column 'operative_summary'\" quando la descrizione era troppo lunga: ora la casella ha un limite di 1900 caratteri con contatore live e un messaggio chiaro se si supera (al posto dell'errore tecnico). Causa radice (dimensione colonna lato ticket-ms) inoltrata ad AgileHub. Risolto ticket #430."} diff --git a/public/whistleblowing.html b/public/whistleblowing.html index 77b87ac..aa22cd9 100644 --- a/public/whistleblowing.html +++ b/public/whistleblowing.html @@ -208,7 +208,7 @@ - + diff --git a/public/workflow.html b/public/workflow.html index aa8a21f..988f3dd 100644 --- a/public/workflow.html +++ b/public/workflow.html @@ -322,7 +322,7 @@ - +