Fix Ivanti panel bugs: Invalid Date, wrong workflow count, crash on archive click, BU scope filtering

This commit is contained in:
Jordan Ramos
2026-05-12 14:21:46 -06:00
parent d093a3d113
commit 8c93e86fe0
6 changed files with 180 additions and 35 deletions

View File

@@ -121,7 +121,7 @@ function hexToRgb(hex) {
return `${r}, ${g}, ${b}`;
}
export default function ArchiveSummaryBar({ onStateClick, activeFilter, refreshKey }) {
export default function ArchiveSummaryBar({ onStateClick, activeFilter, refreshKey, teamsParam }) {
const [stats, setStats] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);
@@ -132,7 +132,10 @@ export default function ArchiveSummaryBar({ onStateClick, activeFilter, refreshK
setLoading(true);
setError(false);
try {
const res = await fetch(`${API_BASE}/ivanti/archive/stats`, { credentials: 'include' });
const url = teamsParam
? `${API_BASE}/ivanti/archive/stats?teams=${encodeURIComponent(teamsParam)}`
: `${API_BASE}/ivanti/archive/stats`;
const res = await fetch(url, { credentials: 'include' });
if (res.ok && !cancelled) {
const data = await res.json();
setStats(data);
@@ -150,7 +153,7 @@ export default function ArchiveSummaryBar({ onStateClick, activeFilter, refreshK
// Re-fetch every 60s so stats stay reasonably fresh after syncs
const interval = setInterval(load, 60000);
return () => { cancelled = true; clearInterval(interval); };
}, [refreshKey]);
}, [refreshKey, teamsParam]);
if (loading) {
return (

View File

@@ -4109,8 +4109,13 @@ function FpEditModal({ open, onClose, submission, queueItems, onSuccess }) {
)) : null;
})()}
{history.length === 0 ? (
<div style={{ fontFamily: 'monospace', fontSize: '0.72rem', color: '#475569', textAlign: 'center', padding: '2rem 0' }}>
No history entries.
<div style={{ fontFamily: 'monospace', fontSize: '0.72rem', color: '#64748B', textAlign: 'center', padding: '2rem 0' }}>
{/* ⚠️ CONVENTION: Use lucide-react icons instead of raw HTML entities/emoji */}
<div style={{ fontSize: '1.5rem', marginBottom: '0.5rem', opacity: 0.4 }}>&#128203;</div>
No history entries yet.
<div style={{ fontSize: '0.65rem', color: '#475569', marginTop: '0.35rem' }}>
Changes to this submission will appear here.
</div>
</div>
) : history.map((entry, idx) => {
const details = (() => {
@@ -5773,7 +5778,7 @@ export default function VulnerabilityTriagePage({ filterDate, filterEXC }) {
}, [buildExportRows]);
const syncedDisplay = syncedAt
? `Synced ${new Date(syncedAt.replace(' ', 'T') + 'Z').toLocaleString()}`
? `Synced ${new Date(syncedAt).toLocaleString()}`
: 'Never synced';
// -------------------------------------------------------------------------