mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
feat(ui): add source links in the alert action menu
This commit is contained in:
@@ -42,6 +42,19 @@ const MenuContent = onClickOutside(
|
||||
>
|
||||
<FontAwesomeIcon icon={faBellSlash} /> Silence this alert
|
||||
</div>
|
||||
<h6 className="dropdown-header">Alert source links:</h6>
|
||||
{alert.alertmanager.map(am => (
|
||||
<a
|
||||
key={am.name}
|
||||
className="dropdown-item"
|
||||
href={am.source}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={afterClick}
|
||||
>
|
||||
{am.name}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,4 +74,10 @@ describe("<MenuContent />", () => {
|
||||
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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user