Skip to content

Commit ce66546

Browse files
author
David Wang
authored
feat(crons): Add new notification type (#74286)
<img width="1019" alt="image" src="https://github.com/user-attachments/assets/958e3de6-863a-412e-b547-1c1aa0bcf0fa">
1 parent 5c67952 commit ce66546

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

static/app/views/settings/account/accountNotificationFineTuning.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const accountNotifications = [
4646
'quota',
4747
'spikeProtection',
4848
'reports',
49+
'brokenMonitors',
4950
];
5051

5152
type ANBPProps = {

static/app/views/settings/account/notifications/constants.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const NOTIFICATION_SETTINGS_TYPES = [
5656
'reports',
5757
'email',
5858
'spikeProtection',
59+
'brokenMonitors',
5960
] as const;
6061

6162
export const SELF_NOTIFICATION_SETTINGS_TYPES = [
@@ -75,6 +76,7 @@ export const NOTIFICATION_SETTINGS_PATHNAMES: Record<NotificationSettingsType, s
7576
reports: 'reports',
7677
email: 'email',
7778
spikeProtection: 'spike-protection',
79+
brokenMonitors: 'broken-monitors',
7880
};
7981

8082
export const CONFIRMATION_MESSAGE = (

static/app/views/settings/account/notifications/fields.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ export const ACCOUNT_NOTIFICATION_FIELDS: Record<string, FineTuneField> = {
8888
{value: '0', label: t('Off')},
8989
],
9090
},
91+
brokenMonitors: {
92+
title: t('Broken Monitors'),
93+
description: t(
94+
'Notifications for monitors that have been in a failing state for a prolonged period of time'
95+
),
96+
type: 'select',
97+
options: [
98+
{value: '1', label: t('On')},
99+
{value: '0', label: t('Off')},
100+
],
101+
},
91102
email: {
92103
title: t('Email Routing'),
93104
description: t(

static/app/views/settings/account/notifications/fields2.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ export const NOTIFICATION_SETTING_FIELDS: Record<string, Field> = {
104104
],
105105
help: t('Notifications about spikes on a per project basis.'),
106106
},
107+
brokenMonitors: {
108+
name: 'brokenMonitors',
109+
type: 'select',
110+
label: t('Broken Monitors'),
111+
choices: [
112+
['always', t('On')],
113+
['never', t('Off')],
114+
],
115+
help: t(
116+
'Notifications for monitors that have been in a failing state for a prolonged period of time'
117+
),
118+
},
107119
// legacy options
108120
personalActivityNotifications: {
109121
name: 'personalActivityNotifications',

static/app/views/settings/account/notifications/notificationSettingsByType.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class NotificationSettingsByTypeV2 extends DeprecatedAsyncComponent<Props, State
444444
fields={this.getFields()}
445445
/>
446446
</Form>
447-
{notificationType !== 'reports' ? (
447+
{notificationType !== 'reports' && notificationType !== 'brokenMonitors' ? (
448448
<Form
449449
saveOnBlur
450450
apiMethod="PUT"

0 commit comments

Comments
 (0)