mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(ui): don't show receivers twice
This commit is contained in:
committed by
Łukasz Mierzwa
parent
8075fc6c32
commit
a5dac6c516
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v0.111
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed duplicated `@receiver` labels showing both on the alert and in the footer.
|
||||
|
||||
## v0.110
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user