From 870c0e247a07f20c4352a2bc1d1e2fddb97a2729 Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Wed, 13 May 2026 12:01:52 -0600 Subject: [PATCH] Fix History tab crash: coerce Ivanti note fields to strings before rendering PostgreSQL + Ivanti API enrichment can return non-string values (objects/arrays) for currentStateUserNotes and similar fields. React crashes silently (blank page, no console error) when trying to render non-string values as children. Same root cause pattern as Bug 3 in ivanti-panel-bugs-2026-05-12. Added safeText() wrapper that coerces any non-string truthy value to a JSON string before rendering in the History tab notes section. --- frontend/src/components/pages/ReportingPage.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/pages/ReportingPage.js b/frontend/src/components/pages/ReportingPage.js index 463db18..c0d7755 100644 --- a/frontend/src/components/pages/ReportingPage.js +++ b/frontend/src/components/pages/ReportingPage.js @@ -4087,11 +4087,16 @@ function FpEditModal({ open, onClose, submission, queueItems, onSuccess }) {
{/* Ivanti reviewer notes (rework/approval/previous state feedback) */} {(() => { + const safeText = (val) => { + if (!val) return null; + if (typeof val === 'string') return val; + try { return JSON.stringify(val); } catch { return String(val); } + }; const notes = [ - submission.ivanti_rework_note && { label: 'Rework Note', text: submission.ivanti_rework_note }, - submission.ivanti_approval_note && { label: 'Approval Note', text: submission.ivanti_approval_note }, - submission.ivanti_current_state_notes && { label: 'Current State Notes', text: submission.ivanti_current_state_notes }, - submission.ivanti_previous_state_notes && { label: 'Previous State Notes', text: submission.ivanti_previous_state_notes }, + safeText(submission.ivanti_rework_note) && { label: 'Rework Note', text: safeText(submission.ivanti_rework_note) }, + safeText(submission.ivanti_approval_note) && { label: 'Approval Note', text: safeText(submission.ivanti_approval_note) }, + safeText(submission.ivanti_current_state_notes) && { label: 'Current State Notes', text: safeText(submission.ivanti_current_state_notes) }, + safeText(submission.ivanti_previous_state_notes) && { label: 'Previous State Notes', text: safeText(submission.ivanti_previous_state_notes) }, ].filter(Boolean); return notes.length > 0 ? notes.map((note, idx) => (