Browse Source

feat(ui): Add monitors seats to frontend (#62645)

Adds monitor seats to the notifications UI
Maggie Bauer 1 year ago
parent
commit
a83c6192ce

+ 1 - 1
static/app/constants/chartPalette.tsx

@@ -8,7 +8,7 @@ export const CHART_PALETTE = [
   ['#444674', '#f2b712'],
   ['#444674', '#d6567f', '#f2b712'],
   ['#444674', '#a35488', '#ef7061', '#f2b712'],
-  ['#444674', '#895289', '#d6567f', '#f38150', '#f2b712'],
+  ['#444674', '#895289', '#d6567f', '#f38150', '#f2b712', '#a397f7'],
   ['#444674', '#7a5088', '#b85586', '#e9626e', '#f58c46', '#f2b712'],
   ['#444674', '#704f87', '#a35488', '#d6567f', '#ef7061', '#f59340', '#f2b712'],
   [

+ 1 - 0
static/app/utils/theme.tsx

@@ -421,6 +421,7 @@ const dataCategory = {
   [DATA_CATEGORY_INFO.transaction.plural]: CHART_PALETTE[4][2],
   [DATA_CATEGORY_INFO.attachment.plural]: CHART_PALETTE[4][1],
   [DATA_CATEGORY_INFO.replay.plural]: CHART_PALETTE[4][4],
+  [DATA_CATEGORY_INFO.monitorSeat.plural]: CHART_PALETTE[4][5],
 };
 
 /**

+ 11 - 0
static/app/views/settings/account/notifications/fields2.tsx

@@ -188,6 +188,17 @@ export const QUOTA_FIELDS = [
       ['never', t('Off')],
     ] as const,
   },
+  {
+    name: 'quotaMonitorSeats',
+    label: t('Cron Monitors'),
+    help: tct('Receive notifications about your cron monitors quotas. [learnMore:Learn more]', {
+      learnMore: <ExternalLink href={getDocsLinkForEventType('monitorSeats')} />,
+    }),
+    choices: [
+      ['always', t('On')],
+      ['never', t('Off')],
+    ] as const,
+  },
   {
     name: 'quotaSpendAllocations',
     label: (

+ 1 - 0
static/app/views/settings/account/notifications/notificationSettingsByType.tsx

@@ -52,6 +52,7 @@ const typeMappedChildren = {
     'quotaTransactions',
     'quotaAttachments',
     'quotaReplays',
+    'quotaMonitorSeats',
     'quotaWarnings',
     'quotaSpendAllocations',
   ],

+ 3 - 1
static/app/views/settings/account/notifications/utils.tsx

@@ -36,7 +36,7 @@ export const groupByOrganization = (
  * Returns a link to docs on explaining how to manage quotas for that event type
  */
 export function getDocsLinkForEventType(
-  event: 'error' | 'transaction' | 'attachment' | 'replay'
+  event: 'error' | 'transaction' | 'attachment' | 'replay' | 'monitorSeats'
 ) {
   switch (event) {
     case 'transaction':
@@ -45,6 +45,8 @@ export function getDocsLinkForEventType(
       return 'https://docs.sentry.io/product/accounts/quotas/manage-attachments-quota/#2-rate-limiting';
     case 'replay':
       return 'https://docs.sentry.io/product/session-replay/';
+    case 'monitorSeats':
+      return 'https://docs.sentry.io/product/crons/';
     default:
       return 'https://docs.sentry.io/product/accounts/quotas/manage-event-stream-guide/#common-workflows-for-managing-your-event-stream';
   }