refactor(ui): reorder alert action menu to make it look nicer with the header

This commit is contained in:
Łukasz Mierzwa
2018-09-09 22:20:18 +01:00
parent f9cf770429
commit d7c00213ff
2 changed files with 8 additions and 7 deletions

View File

@@ -38,12 +38,6 @@ const MenuContent = onClickOutside(
style={popperStyle}
data-placement={popperPlacement}
>
<div
className="dropdown-item cursor-pointer"
onClick={() => onSilenceClick(silenceFormStore, group, alert)}
>
<FontAwesomeIcon icon={faBellSlash} /> Silence this alert
</div>
<h6 className="dropdown-header">Alert source links:</h6>
{alert.alertmanager.map(am => (
<a
@@ -57,6 +51,13 @@ const MenuContent = onClickOutside(
{am.name}
</a>
))}
<div className="dropdown-divider" />
<div
className="dropdown-item cursor-pointer"
onClick={() => onSilenceClick(silenceFormStore, group, alert)}
>
<FontAwesomeIcon icon={faBellSlash} /> Silence this alert
</div>
</div>
);
}

View File

@@ -70,7 +70,7 @@ const MountedMenuContent = group => {
describe("<MenuContent />", () => {
it("clicking on 'Silence' icon opens the silence form modal", () => {
const tree = MountedMenuContent(group);
const button = tree.find(".dropdown-item").at(0);
const button = tree.find(".dropdown-item").at(1);
button.simulate("click");
expect(silenceFormStore.toggle.visible).toBe(true);
});