From a6e455311e98860b1cc5ab598a2c2aed5f6cff1a Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Thu, 28 May 2026 14:25:37 -0600 Subject: [PATCH] Improve CARD action error messages and default loader columns Show actual CARD API error messages (e.g., 'Cannot redirect asset because Team is neither confirmed nor pending owner') instead of generic 'Redirect failed.' or 'confirm failed.' messages. Also auto-select IPV4_ADDRESS, EQUIP_NAME, and RESPONSIBLE_TEAM columns by default in the Loader Modal for better initial UX. --- frontend/src/components/LoaderModal.js | 6 +++++- frontend/src/components/pages/ReportingPage.js | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/LoaderModal.js b/frontend/src/components/LoaderModal.js index 58fbf5a..cbe23ca 100644 --- a/frontend/src/components/LoaderModal.js +++ b/frontend/src/components/LoaderModal.js @@ -94,12 +94,16 @@ export default function LoaderModal({ isOpen, onClose, initialDevices }) { setValidationWarnings([]); }, [isOpen, initialDevices]); - // Auto-select required columns when operation type changes + // Auto-select required columns + useful defaults when operation type changes useEffect(() => { const required = getRequiredColumns(operationType); setSelectedColumns(prev => { const next = new Set(prev); required.forEach(id => next.add(id)); + // Always include these useful columns by default + next.add('IPV4_ADDRESS'); + next.add('EQUIP_NAME'); + next.add('RESPONSIBLE_TEAM'); return next; }); }, [operationType]); diff --git a/frontend/src/components/pages/ReportingPage.js b/frontend/src/components/pages/ReportingPage.js index f4a7e17..1952dcb 100644 --- a/frontend/src/components/pages/ReportingPage.js +++ b/frontend/src/components/pages/ReportingPage.js @@ -1669,7 +1669,8 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on }); const data = await res.json(); if (!res.ok) { - setCardActionError(data.error || `${actionType} failed.`); + const errorMsg = data.error || data.message || (typeof data === 'string' ? data : `${actionType} failed.`); + setCardActionError(errorMsg); setCardActionLoading(false); return; } @@ -1703,7 +1704,8 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on }); const data = await res.json(); if (!res.ok) { - setCardActionError(data.error || 'Redirect failed.'); + const errorMsg = data.error || data.message || (typeof data === 'string' ? data : JSON.stringify(data)); + setCardActionError(errorMsg); setCardActionLoading(false); return; }