} = this.props;
const { errorData, showIntegrationSettings, showAttachIncidentForm } = this.state;
- const { isNotFoundError, isWrongTeamError } = errorData;
+ const { isNotFoundError, isWrongTeamError, isUnknownError } = errorData;
// const { alertReceiveChannelStore } = store;
const { alerts } = store.alertGroupStore;
const incident = alerts.get(id);
+ if (isUnknownError) {
+ return (
+
+ );
+ }
+
if (!incident && !isNotFoundError && !isWrongTeamError) {
return (
@@ -332,8 +346,8 @@ class IncidentPage extends React.Component
onUnacknowledge={this.getOnActionButtonClick(incident.pk, AlertAction.unAcknowledge)}
onUnresolve={this.getOnActionButtonClick(incident.pk, AlertAction.unResolve)}
onAcknowledge={this.getOnActionButtonClick(incident.pk, AlertAction.Acknowledge)}
- onSilence={this.getSilenceClickHandler(incident)}
- onUnsilence={this.getUnsilenceClickHandler(incident)}
+ onSilence={this.getSilenceClickHandler(incident.pk)}
+ onUnsilence={this.getUnsilenceClickHandler(incident.pk)}
/>
@@ -413,13 +427,13 @@ class IncidentPage extends React.Component
- {getActionButtons(incident, cx, {
+ {getActionButtons(incident, {
onResolve: this.getOnActionButtonClick(incident.pk, AlertAction.Resolve),
onUnacknowledge: this.getOnActionButtonClick(incident.pk, AlertAction.unAcknowledge),
onUnresolve: this.getOnActionButtonClick(incident.pk, AlertAction.unResolve),
onAcknowledge: this.getOnActionButtonClick(incident.pk, AlertAction.Acknowledge),
- onSilence: this.getSilenceClickHandler(incident),
- onUnsilence: this.getUnsilenceClickHandler(incident),
+ onSilence: this.getSilenceClickHandler(incident.pk),
+ onUnsilence: this.getUnsilenceClickHandler(incident.pk),
})}
{incident.grafana_incident_id === null && (
@@ -615,7 +629,7 @@ class IncidentPage extends React.Component
};
};
- getOnActionButtonClick = (incidentId: string, action: AlertAction) => {
+ getOnActionButtonClick = (incidentId: Alert['pk'], action: AlertAction) => {
const { store } = this.props;
return (e: SyntheticEvent) => {
@@ -625,23 +639,23 @@ class IncidentPage extends React.Component
};
};
- getSilenceClickHandler = (alert: AlertType) => {
+ getSilenceClickHandler = (incidentId: Alert['pk']) => {
const { store } = this.props;
return (value: number) => {
- return store.alertGroupStore.doIncidentAction(alert.pk, AlertAction.Silence, false, {
+ return store.alertGroupStore.doIncidentAction(incidentId, AlertAction.Silence, false, {
delay: value,
});
};
};
- getUnsilenceClickHandler = (alert: AlertType) => {
+ getUnsilenceClickHandler = (incidentId: Alert['pk']) => {
const { store } = this.props;
return (event: any) => {
event.stopPropagation();
- return store.alertGroupStore.doIncidentAction(alert.pk, AlertAction.unSilence, false);
+ return store.alertGroupStore.doIncidentAction(incidentId, AlertAction.unSilence, false);
};
};
@@ -825,4 +839,26 @@ function AttachedIncidentsList({
);
}
+const AlertGroupStub = ({ buttons }: { buttons: React.ReactNode }) => {
+ return (
+
+
+
+ An unexpected error happened
+
+ OnCall is not able to receive any information about the current Alert Group. It's unknown if it's firing,
+ acknowledged, silenced, or resolved.
+
+
+ Meanwhile, you could try changing the status of this Alert Group:
+
+ {buttons}
+
+
+
+ );
+};
+
export default withRouter(withMobXProviderContext(IncidentPage));
diff --git a/grafana-plugin/src/pages/incidents/Incidents.module.scss b/grafana-plugin/src/pages/incidents/Incidents.module.scss
index 908029d6..b73e8560 100644
--- a/grafana-plugin/src/pages/incidents/Incidents.module.scss
+++ b/grafana-plugin/src/pages/incidents/Incidents.module.scss
@@ -45,12 +45,6 @@
color: var(--secondary-text-color);
}
-.silence-button-inline {
- font-size: 12px;
- height: 24px;
- margin-right: 0;
-}
-
.pagination {
width: 100%;
margin-top: 20px;