fix: completely disable showError for metrics-grid to prevent error alerts

This commit is contained in:
2025-10-06 15:54:53 -03:00
parent 2ffcb9059e
commit b4249d9b79

View File

@@ -4366,24 +4366,12 @@
function showError(containerId, message) {
const container = document.getElementById(containerId);
// If it's metrics-grid, show error above the cards, not replace them
// Skip metrics-grid completely - don't show any error for it
if (containerId === 'metrics-grid') {
// Find the parent container to add error above
const parentContainer = container.parentElement;
const errorDiv = document.createElement('div');
errorDiv.className = 'pf-c-alert pf-m-danger';
errorDiv.style.marginBottom = '16px';
errorDiv.innerHTML = `
<div class="pf-c-alert__icon">
<i class="fas fa-exclamation-triangle"></i>
</div>
<div class="pf-c-alert__title">Error</div>
<div class="pf-c-alert__description">${message}</div>
`;
console.error('Error for metrics-grid (ignored):', message);
return;
}
// Insert error before the metrics grid
parentContainer.insertBefore(errorDiv, container);
} else {
// For other containers, replace content as before
container.innerHTML = `
<div style="text-align: center; padding: 40px; color: var(--pf-global--danger-color--100);">
@@ -4393,7 +4381,6 @@
</div>
`;
}
}
</script>
<!-- React and Victory.js for PatternFly charts -->