Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.7] Bug 1986724: Show the content of Insights widget when there are 0 recommendations for cluster #9655

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const InsightsPopup: React.FC<PrometheusHealthPopupProps> = ({ responses,
([k1], [k2]) => riskSorting[k1] - riskSorting[k2],
);
const numberOfIssues = Object.values(metrics).reduce((acc, cur) => acc + cur, 0);
const hasIssues = riskEntries.length > 0 && numberOfIssues > 0;

const isWaitingOrDisabled = _isWaitingOrDisabled(metrics);
const isError = _isError(metrics);
Expand All @@ -39,7 +38,7 @@ export const InsightsPopup: React.FC<PrometheusHealthPopupProps> = ({ responses,
<div className="co-status-popup__section">Disabled or waiting for results.</div>
)}
<div className="co-status-popup__section">
{hasIssues && !isWaitingOrDisabled && !isError && (
{!isWaitingOrDisabled && !isError && (
<div>
<ChartDonut
data={riskEntries.map(([k, v]) => ({
Expand Down Expand Up @@ -80,7 +79,7 @@ export const InsightsPopup: React.FC<PrometheusHealthPopupProps> = ({ responses,
)}
</div>
<div className="co-status-popup__section">
{hasIssues && !isWaitingOrDisabled && !isError && (
{!isWaitingOrDisabled && !isError && (
<>
<h6 className="pf-c-title pf-m-md">Fixable issues</h6>
<div>
Expand All @@ -91,7 +90,7 @@ export const InsightsPopup: React.FC<PrometheusHealthPopupProps> = ({ responses,
</div>
</>
)}
{!hasIssues && (isWaitingOrDisabled || isError) && (
{(isWaitingOrDisabled || isError) && (
<ExternalLink
href={`${openshiftHelpBase}support/remote_health_monitoring/using-insights-to-identify-issues-with-your-cluster.html`}
text="More about Insights"
Expand Down