mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(ui): use alert fingerprint instead of labels hash
This commit is contained in:
committed by
Łukasz Mierzwa
parent
c74479d435
commit
2c68967928
@@ -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={
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user