fields2.tsx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. import {Field} from 'sentry/components/forms/type';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import {t, tct} from 'sentry/locale';
  4. import {getDocsLinkForEventType} from 'sentry/views/settings/account/notifications/utils';
  5. export const NOTIFICATION_SETTING_FIELDS: Record<string, Field> = {
  6. alerts: {
  7. name: 'alerts',
  8. type: 'select',
  9. label: t('Issue Alerts'),
  10. choices: [
  11. ['always', t('On')],
  12. ['never', t('Off')],
  13. ],
  14. help: t('Notifications sent from Alert rules that your team has set up.'),
  15. },
  16. workflow: {
  17. name: 'workflow',
  18. type: 'select',
  19. label: t('Issue Workflow'),
  20. choices: [
  21. ['always', t('On')],
  22. ['subscribe_only', t('Only Subscribed Issues')],
  23. ['never', t('Off')],
  24. ],
  25. help: t('Changes in issue assignment, resolution status, and comments.'),
  26. },
  27. deploy: {
  28. name: 'deploy',
  29. type: 'select',
  30. label: t('Deploys'),
  31. choices: [
  32. ['always', t('On')],
  33. ['committed_only', t('Only Committed Issues')],
  34. ['never', t('Off')],
  35. ],
  36. help: t('Release, environment, and commit overviews.'),
  37. },
  38. provider: {
  39. name: 'provider',
  40. type: 'select',
  41. label: t('Delivery Method'),
  42. choices: [
  43. ['email', t('Send to Email')],
  44. ['slack', t('Send to Slack')],
  45. ['email+slack', t('Send to Email and Slack')],
  46. ],
  47. },
  48. approval: {
  49. name: 'approval',
  50. type: 'select',
  51. label: t('Approvals'),
  52. choices: [
  53. ['always', t('On')],
  54. ['never', t('Off')],
  55. ],
  56. help: t('Notifications from teammates that require review or approval.'),
  57. },
  58. quota: {
  59. name: 'quota',
  60. type: 'select',
  61. label: t('Quota'),
  62. choices: [
  63. ['always', t('On')],
  64. ['never', t('Off')],
  65. ],
  66. help: t('Error, transaction, and attachment quota limits.'),
  67. },
  68. reports: {
  69. name: 'weekly reports',
  70. type: 'blank',
  71. label: t('Weekly Reports'),
  72. help: t('A summary of the past week for an organization.'),
  73. },
  74. email: {
  75. name: 'email routing',
  76. type: 'blank',
  77. label: t('Email Routing'),
  78. help: t('Change the email address that receives notifications.'),
  79. },
  80. personalActivityNotifications: {
  81. name: 'personalActivityNotifications',
  82. type: 'select',
  83. label: t('My Own Activity'),
  84. choices: [
  85. [true as any, t('On')],
  86. [false as any, t('Off')],
  87. ],
  88. help: t('Notifications about your own actions on Sentry.'),
  89. },
  90. selfAssignOnResolve: {
  91. name: 'selfAssignOnResolve',
  92. type: 'select',
  93. label: t('Claim Unassigned Issues I’ve Resolved'),
  94. choices: [
  95. [true as any, t('On')],
  96. [false as any, t('Off')],
  97. ],
  98. help: t('You’ll receive notifications about any changes that happen afterwards.'),
  99. },
  100. };
  101. // partial field definition for quota sub-categories
  102. export const QUOTA_FIELDS = [
  103. {
  104. name: 'quotaWarnings',
  105. label: t('Set Quota Limit'),
  106. help: t(
  107. 'Receive notifications when your organization exceeeds the following limits.'
  108. ),
  109. choices: [
  110. ['always', t('100% and 80%')],
  111. ['never', t('100%')],
  112. ] as const,
  113. },
  114. {
  115. name: 'quotaErrors',
  116. label: t('Errors'),
  117. help: tct('Receive notifications about your error quotas. [learnMore:Learn more]', {
  118. learnMore: <ExternalLink href={getDocsLinkForEventType('error')} />,
  119. }),
  120. choices: [
  121. ['always', t('On')],
  122. ['never', t('Off')],
  123. ] as const,
  124. },
  125. {
  126. name: 'quotaTransactions',
  127. label: t('Transactions'),
  128. help: tct(
  129. 'Receive notifications about your transaction quota. [learnMore:Learn more]',
  130. {
  131. learnMore: <ExternalLink href={getDocsLinkForEventType('transaction')} />,
  132. }
  133. ),
  134. choices: [
  135. ['always', t('On')],
  136. ['never', t('Off')],
  137. ] as const,
  138. },
  139. {
  140. name: 'quotaAttachments',
  141. label: t('Attachments'),
  142. help: tct(
  143. 'Receive notifications about your attachment quota. [learnMore:Learn more]',
  144. {
  145. learnMore: <ExternalLink href={getDocsLinkForEventType('attachment')} />,
  146. }
  147. ),
  148. choices: [
  149. ['always', t('On')],
  150. ['never', t('Off')],
  151. ] as const,
  152. },
  153. ];