From 7da2c66200e78bc41ffe099b899b4f19f1452cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 8 Sep 2018 23:28:10 +0100 Subject: [PATCH] feat(ui): add source links in the alert action menu --- .../Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js | 13 +++++++++++++ .../AlertGrid/AlertGroup/Alert/AlertMenu.test.js | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js index 54338edc4..a2bcf5871 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js @@ -42,6 +42,19 @@ const MenuContent = onClickOutside( > Silence this alert +
Alert source links:
+ {alert.alertmanager.map(am => ( + + {am.name} + + ))} ); } diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js index fe1d72076..963e67be6 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js @@ -74,4 +74,10 @@ describe("", () => { button.simulate("click"); expect(silenceFormStore.toggle.visible).toBe(true); }); + + it("source link points at alert source", () => { + const tree = MountedMenuContent(group); + const link = tree.find("a.dropdown-item[href='localhost/prometheus']"); + expect(link.text()).toBe("default"); + }); });