fix(ui): use alert fingerprint instead of labels hash

This commit is contained in:
Łukasz Mierzwa
2020-05-30 16:11:18 +01:00
committed by Łukasz Mierzwa
parent c74479d435
commit 2c68967928
3 changed files with 3 additions and 3 deletions

View File

@@ -4,8 +4,6 @@ import PropTypes from "prop-types";
import { observer } from "mobx-react";
import { observable, action, toJS } from "mobx";
import hash from "object-hash";
import { Fade } from "react-reveal";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -260,7 +258,7 @@ const AlertGroup = observer(
.slice(0, this.renderConfig.alertsToRender)
.map((alert) => (
<Alert
key={hash(alert.labels)}
key={alert.id}
group={group}
alert={alert}
showAlertmanagers={

View File

@@ -20,6 +20,7 @@ const APIAlertAlertmanagerState = PropTypes.exact({
});
const APIAlert = PropTypes.exact({
id: PropTypes.string.isRequired,
annotations: PropTypes.arrayOf(Annotation).isRequired,
labels: PropTypes.object.isRequired,
startsAt: PropTypes.string.isRequired,

View File

@@ -6,6 +6,7 @@ const MockAnnotation = (name, value, visible, isLink) => ({
});
const MockAlert = (annotations, labels, state) => ({
id: Math.random().toString(36),
annotations: annotations,
labels: labels,
startsAt: "2018-08-14T17:36:40.017867056Z",