|
@@ -173,6 +173,7 @@ function isSavedAlertRule(rule: State['rule']): rule is IssueAlertRule {
|
|
|
|
|
|
class IssueRuleEditor extends AsyncView<Props, State> {
|
|
|
pollingTimeout: number | undefined = undefined;
|
|
|
+ trackIncompatibleAnalytics: boolean = false;
|
|
|
|
|
|
get isDuplicateRule(): boolean {
|
|
|
const {location} = this.props;
|
|
@@ -432,10 +433,19 @@ class IssueRuleEditor extends AsyncView<Props, State> {
|
|
|
// As more incompatible combinations are added, we will need a more generic way to check for incompatibility.
|
|
|
checkIncompatibleRule = debounce(() => {
|
|
|
if (this.props.organization.features.includes('issue-alert-incompatible-rules')) {
|
|
|
- const incompatibleRule = findIncompatibleRules(this.state.rule);
|
|
|
+ const {conditionIndices, filterIndices} = findIncompatibleRules(this.state.rule);
|
|
|
+ if (
|
|
|
+ !this.trackIncompatibleAnalytics &&
|
|
|
+ (conditionIndices !== null || filterIndices !== null)
|
|
|
+ ) {
|
|
|
+ this.trackIncompatibleAnalytics = true;
|
|
|
+ trackAdvancedAnalyticsEvent('edit_alert_rule.incompatible_rule', {
|
|
|
+ organization: this.props.organization,
|
|
|
+ });
|
|
|
+ }
|
|
|
this.setState({
|
|
|
- incompatibleConditions: incompatibleRule.conditionIndices,
|
|
|
- incompatibleFilters: incompatibleRule.filterIndices,
|
|
|
+ incompatibleConditions: conditionIndices,
|
|
|
+ incompatibleFilters: filterIndices,
|
|
|
});
|
|
|
}
|
|
|
}, 500);
|
|
@@ -492,9 +502,17 @@ class IssueRuleEditor extends AsyncView<Props, State> {
|
|
|
})
|
|
|
.then(() => {
|
|
|
addSuccessMessage(tn('Notification sent!', 'Notifications sent!', actions));
|
|
|
+ trackAdvancedAnalyticsEvent('edit_alert_rule.notification_test', {
|
|
|
+ organization,
|
|
|
+ success: true,
|
|
|
+ });
|
|
|
})
|
|
|
.catch(() => {
|
|
|
addErrorMessage(tn('Notification failed', 'Notifications failed', actions));
|
|
|
+ trackAdvancedAnalyticsEvent('edit_alert_rule.notification_test', {
|
|
|
+ organization,
|
|
|
+ success: false,
|
|
|
+ });
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.setState({sendingNotification: false});
|