fix(ui): don't show receivers twice

This commit is contained in:
Łukasz Mierzwa
2022-12-02 17:30:29 +00:00
committed by Łukasz Mierzwa
parent 8075fc6c32
commit a5dac6c516
3 changed files with 15 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## v0.111
### Fixed
- Fixed duplicated `@receiver` labels showing both on the alert and in the footer.
## v0.110
### Fixed

View File

@@ -17,6 +17,7 @@ const GroupFooter: FC<{
silenceFormStore: SilenceFormStore;
showAnnotations?: boolean;
showSilences?: boolean;
showReceiver?: boolean;
}> = ({
group,
afterUpdate,
@@ -24,6 +25,7 @@ const GroupFooter: FC<{
silenceFormStore,
showAnnotations = true,
showSilences = true,
showReceiver = true,
}) => {
const total =
(showAnnotations
@@ -36,7 +38,7 @@ const GroupFooter: FC<{
(Object.keys(alertStore.data.upstreams.clusters).length > 1
? group.shared.clusters.length
: 0) +
(alertStore.data.receivers.length > 1 ? 1 : 0) +
(alertStore.data.receivers.length > 1 ? (showReceiver ? 1 : 0) : 0) +
(showSilences ? Object.keys(group.shared.silences).length : 0);
if (total === 0) {
return null;

View File

@@ -236,6 +236,12 @@ const AlertGroup: FC<{
silenceFormStore={silenceFormStore}
showAnnotations={!alertStore.ui.isIdle}
showSilences={!alertStore.ui.isIdle}
showReceiver={
!(
alertStore.data.receivers.length > 1 &&
group.alerts.length === 1
)
}
/>
) : null}
</div>