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

Bug 1829647: Monitoring: Silence details page: Display - when no Firing Alerts #5206

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
6 changes: 5 additions & 1 deletion frontend/public/components/monitoring.tsx
Expand Up @@ -253,6 +253,10 @@ const SeverityBadge: React.FC<{ severity: string }> = ({ severity }) =>
);

const SeverityCounts: React.FC<{ alerts: Alert[] }> = ({ alerts }) => {
if (_.isEmpty(alerts)) {
return <>-</>;
}

const counts = _.countBy(alerts, (a) => {
const { severity } = a.labels;
return severity === AlertSeverity.Critical || severity === AlertSeverity.Warning
Expand Down Expand Up @@ -418,7 +422,7 @@ const SilenceTableRow: RowFunction<Silence> = ({ index, key, obj, style }) => {
</div>
</TableData>
<TableData className={tableSilenceClasses[1]}>
{_.isEmpty(firingAlerts) ? '-' : <SeverityCounts alerts={firingAlerts} />}
<SeverityCounts alerts={firingAlerts} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- was already shown on the silence list page, so moved that into SeverityCounts so that it also applies to the details page.

</TableData>
<TableData className={classNames(tableSilenceClasses[2], 'co-break-word')}>
<SilenceState silence={obj} />
Expand Down