diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js
index f90415016..aaff3bad1 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js
@@ -17,13 +17,18 @@ import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash";
import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons/faExternalLinkAlt";
import { APIAlert, APIGroup } from "Models/API";
+import { AlertStore } from "Stores/AlertStore";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { FetchPauser } from "Components/FetchPauser";
import { DropdownSlide } from "Components/Animations/DropdownSlide";
-const onSilenceClick = (silenceFormStore, group, alert) => {
+const onSilenceClick = (alertStore, silenceFormStore, group, alert) => {
silenceFormStore.data.resetProgress();
- silenceFormStore.data.fillMatchersFromGroup(group, [alert]);
+ silenceFormStore.data.fillMatchersFromGroup(
+ group,
+ alertStore.settings.values.silenceForm.strip.labels,
+ [alert]
+ );
silenceFormStore.toggle.show();
};
@@ -35,6 +40,7 @@ const MenuContent = onClickOutside(
group,
alert,
afterClick,
+ alertStore,
silenceFormStore
}) => {
return (
@@ -62,7 +68,9 @@ const MenuContent = onClickOutside(
onSilenceClick(silenceFormStore, group, alert)}
+ onClick={() =>
+ onSilenceClick(alertStore, silenceFormStore, group, alert)
+ }
>
Silence this alert
@@ -86,6 +94,7 @@ const AlertMenu = observer(
static propTypes = {
group: APIGroup.isRequired,
alert: APIAlert.isRequired,
+ alertStore: PropTypes.instanceOf(AlertStore).isRequired,
silenceFormStore: PropTypes.instanceOf(SilenceFormStore).isRequired
};
@@ -108,7 +117,7 @@ const AlertMenu = observer(
});
render() {
- const { group, alert, silenceFormStore } = this.props;
+ const { group, alert, alertStore, silenceFormStore } = this.props;
const uniqueClass = `components-grid-alert-${group.id}-${hash(
alert.labels
@@ -148,6 +157,7 @@ const AlertMenu = observer(
popperStyle={style}
group={group}
alert={alert}
+ alertStore={alertStore}
silenceFormStore={silenceFormStore}
afterClick={this.collapse.hide}
handleClickOutside={this.collapse.hide}
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 4aee57a12..f63b215a3 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.js
@@ -29,6 +29,7 @@ const MountedAlertMenu = group => {
@@ -70,6 +71,7 @@ const MountedMenuContent = group => {
group={group}
alert={alert}
afterClick={MockAfterClick}
+ alertStore={alertStore}
silenceFormStore={silenceFormStore}
/>
diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.js
index 72db47a43..393aef0d2 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.js
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.js
@@ -7,6 +7,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faVolumeMute } from "@fortawesome/free-solid-svg-icons/faVolumeMute";
import { APIAlert, APIGroup } from "Models/API";
+import { AlertStore } from "Stores/AlertStore";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { BorderClassMap } from "Common/Colors";
import { StaticLabels } from "Common/Query";
@@ -26,6 +27,7 @@ const Alert = observer(
showAlertmanagers: PropTypes.bool.isRequired,
showReceiver: PropTypes.bool.isRequired,
afterUpdate: PropTypes.func.isRequired,
+ alertStore: PropTypes.instanceOf(AlertStore).isRequired,
silenceFormStore: PropTypes.instanceOf(SilenceFormStore).isRequired
};
@@ -36,6 +38,7 @@ const Alert = observer(
showAlertmanagers,
showReceiver,
afterUpdate,
+ alertStore,
silenceFormStore
} = this.props;
@@ -87,6 +90,7 @@ const Alert = observer(
{alert.alertmanager
diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.js
index 047ed8aba..0b25cfe59 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.js
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.js
@@ -52,6 +52,7 @@ const MountedAlert = (alert, group, showAlertmanagers, showReceiver) => {
showAlertmanagers={showAlertmanagers}
showReceiver={showReceiver}
afterUpdate={MockAfterUpdate}
+ alertStore={alertStore}
silenceFormStore={silenceFormStore}
/>
diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js
index cd27dd9cc..89255fcbf 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.js
@@ -16,14 +16,18 @@ import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash";
import { APIGroup } from "Models/API";
import { FormatAPIFilterQuery } from "Stores/AlertStore";
+import { AlertStore } from "Stores/AlertStore";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { QueryOperators, StaticLabels, FormatQuery } from "Common/Query";
import { DropdownSlide } from "Components/Animations/DropdownSlide";
import { FetchPauser } from "Components/FetchPauser";
-const onSilenceClick = (silenceFormStore, group) => {
+const onSilenceClick = (alertStore, silenceFormStore, group) => {
silenceFormStore.data.resetProgress();
- silenceFormStore.data.fillMatchersFromGroup(group);
+ silenceFormStore.data.fillMatchersFromGroup(
+ group,
+ alertStore.settings.values.silenceForm.strip.labels
+ );
silenceFormStore.toggle.show();
};
@@ -34,6 +38,7 @@ const MenuContent = onClickOutside(
popperStyle,
group,
afterClick,
+ alertStore,
silenceFormStore
}) => {
let groupFilters = Object.keys(group.labels).map(name =>
@@ -65,7 +70,7 @@ const MenuContent = onClickOutside(
onSilenceClick(silenceFormStore, group)}
+ onClick={() => onSilenceClick(alertStore, silenceFormStore, group)}
>
Silence this group
@@ -86,6 +91,7 @@ const GroupMenu = observer(
class GroupMenu extends Component {
static propTypes = {
group: APIGroup.isRequired,
+ alertStore: PropTypes.instanceOf(AlertStore).isRequired,
silenceFormStore: PropTypes.instanceOf(SilenceFormStore).isRequired,
themed: PropTypes.bool.isRequired
};
@@ -109,7 +115,7 @@ const GroupMenu = observer(
});
render() {
- const { group, silenceFormStore, themed } = this.props;
+ const { group, alertStore, silenceFormStore, themed } = this.props;
return (