diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js index 26943ca88..0908b0533 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js @@ -114,7 +114,7 @@ const GroupMenu = observer( {({ ref }) => ( - - + )} diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.js index 80b20234c..5f5f1e58a 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.js @@ -39,7 +39,7 @@ describe("", () => { it("clicking toggle sets collapse value to 'false'", () => { const group = MockAlertGroup({ alertname: "Fake Alert" }, [], [], {}); const tree = MountedGroupMenu(group); - const toggle = tree.find("a.cursor-pointer"); + const toggle = tree.find(".cursor-pointer"); toggle.simulate("click"); expect(tree.instance().collapse.value).toBe(false); }); @@ -48,7 +48,7 @@ describe("", () => { const group = MockAlertGroup({ alertname: "Fake Alert" }, [], [], {}); const tree = MountedGroupMenu(group); - const toggle = tree.find("a.cursor-pointer"); + const toggle = tree.find(".cursor-pointer"); toggle.simulate("click"); expect(tree.instance().collapse.value).toBe(false); diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.js index 9bc6f68ad..9d8c182ac 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.js @@ -48,14 +48,14 @@ const GroupHeader = observer( value="active" counter={group.stateCount.active} /> - - + {Object.keys(group.labels).map(name => ( diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/__snapshots__/index.test.js.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/__snapshots__/index.test.js.snap index db0afc1d1..45c7a1302 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/__snapshots__/index.test.js.snap @@ -17,7 +17,7 @@ exports[` matches snapshot when data is present in alertStore 1`] = ` Fake silence - + matches snapshot when data is present in alertStore 1`] = ` > - + me@example.com @@ -65,7 +65,7 @@ exports[` matches snapshot with expaned details 1`] = ` Fake silence - + matches snapshot with expaned details 1`] = ` > - + me@example.com diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js index dff6dbb45..bd1c82d61 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js @@ -295,14 +295,14 @@ const Silence = inject("alertStore")( - - + {silence.createdBy} diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.test.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.test.js index e54a0c0bf..23ee9dc11 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.test.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.test.js @@ -148,7 +148,7 @@ describe("", () => { it("clicking on expand toggle shows silence details", () => { const tree = MountedSilence(alertmanager); - const toggle = tree.find("a.float-right.cursor-pointer"); + const toggle = tree.find(".float-right.cursor-pointer"); toggle.simulate("click"); const details = tree.find("SilenceDetails"); expect(details).toHaveLength(1); @@ -204,7 +204,7 @@ describe("", () => { const tree = MountedSilence(alertmanager); // expand silence - tree.find("a.float-right.cursor-pointer").simulate("click"); + tree.find(".float-right.cursor-pointer").simulate("click"); const button = tree.find(".badge-secondary.components-label-with-hover"); expect(button.text()).toBe("Edit"); @@ -216,7 +216,7 @@ describe("", () => { const tree = MountedSilence(alertmanager); // expand silence - tree.find("a.float-right.cursor-pointer").simulate("click"); + tree.find(".float-right.cursor-pointer").simulate("click"); const button = tree.find(".badge-secondary.components-label-with-hover"); expect(button.text()).toBe("Edit"); diff --git a/ui/src/Components/Labels/FilteringCounterBadge/index.js b/ui/src/Components/Labels/FilteringCounterBadge/index.js index 271ea4ae3..66c9312ee 100644 --- a/ui/src/Components/Labels/FilteringCounterBadge/index.js +++ b/ui/src/Components/Labels/FilteringCounterBadge/index.js @@ -3,6 +3,7 @@ import PropTypes from "prop-types"; import { inject, observer } from "mobx-react"; +import { AlertStore } from "Stores/AlertStore"; import { BaseLabel } from "Components/Labels/BaseLabel"; // Same as FilteringLabel but for labels that are counters (usually @state) @@ -12,7 +13,9 @@ const FilteringCounterBadge = inject("alertStore")( observer( class FilteringCounterBadge extends BaseLabel { static propTypes = { - ...BaseLabel.propTypes, + alertStore: PropTypes.instanceOf(AlertStore).isRequired, + name: PropTypes.string.isRequired, + value: PropTypes.string.isRequired, counter: PropTypes.number.isRequired }; diff --git a/ui/src/Components/Labels/HistoryLabel/index.js b/ui/src/Components/Labels/HistoryLabel/index.js index 79ef08d31..c2c10e877 100644 --- a/ui/src/Components/Labels/HistoryLabel/index.js +++ b/ui/src/Components/Labels/HistoryLabel/index.js @@ -5,6 +5,7 @@ import { observer } from "mobx-react"; import { DefaultLabelClass } from "Common/Colors"; import { QueryOperators } from "Common/Query"; +import { AlertStore } from "Stores/AlertStore"; import { BaseLabel } from "Components/Labels/BaseLabel"; import "./index.css"; @@ -12,7 +13,9 @@ import "./index.css"; const HistoryLabel = observer( class HistoryLabel extends BaseLabel { static propTypes = { - ...BaseLabel.propTypes, + alertStore: PropTypes.instanceOf(AlertStore).isRequired, + name: PropTypes.string.isRequired, + value: PropTypes.string.isRequired, matcher: PropTypes.string.isRequired }; diff --git a/ui/src/Components/MainModal/MainModalContent.js b/ui/src/Components/MainModal/MainModalContent.js index c9468bb82..33c58d4f7 100644 --- a/ui/src/Components/MainModal/MainModalContent.js +++ b/ui/src/Components/MainModal/MainModalContent.js @@ -13,14 +13,14 @@ import { Configuration } from "./Configuration"; import { Help } from "./Help"; const Tab = ({ title, active, onClick }) => ( - {title} - + ); Tab.propTypes = { title: PropTypes.string.isRequired, diff --git a/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.js.snap b/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.js.snap index 6902d90f2..19bf61b7c 100644 --- a/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.js.snap +++ b/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.js.snap @@ -11,12 +11,12 @@ exports[` matches snapshot 1`] = `