fields.tsx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import {t} from 'sentry/locale';
  2. import {SelectValue} from 'sentry/types';
  3. export type FineTuneField = {
  4. description: string;
  5. title: string;
  6. type: 'select';
  7. defaultFieldName?: string;
  8. defaultValue?: string;
  9. options?: SelectValue<string>[];
  10. };
  11. // TODO: clean up unused fields
  12. export const ACCOUNT_NOTIFICATION_FIELDS: Record<string, FineTuneField> = {
  13. alerts: {
  14. title: t('Issue Alert Notifications'),
  15. description: t(
  16. 'Notifications from Alert Rules that your team has setup. You’ll always receive notifications from Alerts configured to be sent directly to you.'
  17. ),
  18. type: 'select',
  19. options: [
  20. {value: '-1', label: t('Default')},
  21. {value: '1', label: t('On')},
  22. {value: '0', label: t('Off')},
  23. ],
  24. defaultValue: '-1',
  25. defaultFieldName: 'subscribeByDefault',
  26. },
  27. workflow: {
  28. title: t('Workflow Notifications'),
  29. description: t(
  30. 'Control workflow notifications, e.g. changes in issue assignment, resolution status, and comments.'
  31. ),
  32. type: 'select',
  33. options: [
  34. {value: '-1', label: t('Default')},
  35. {value: '0', label: t('Always')},
  36. {value: '1', label: t('Only on issues I subscribe to')},
  37. {value: '2', label: t('Never')},
  38. ],
  39. defaultValue: '-1',
  40. defaultFieldName: 'workflowNotifications',
  41. },
  42. activeRelease: {
  43. title: t('Release Issues'),
  44. description: t('Notifications sent for issues likely caused by your code changes.'),
  45. type: 'select',
  46. defaultValue: '0',
  47. options: [
  48. {value: '1', label: t('On')},
  49. {value: '0', label: t('Off')},
  50. ],
  51. defaultFieldName: 'activeReleaseNotifications',
  52. },
  53. deploy: {
  54. title: t('Deploy Notifications'),
  55. description: t(
  56. 'Control deploy notifications that include release, environment, and commit overviews.'
  57. ),
  58. type: 'select',
  59. options: [
  60. {value: '-1', label: t('Default')},
  61. {value: '2', label: t('Always')},
  62. {value: '3', label: t('Only on deploys with my commits')},
  63. {value: '4', label: t('Never')},
  64. ],
  65. defaultValue: '-1',
  66. defaultFieldName: 'deployNotifications',
  67. },
  68. reports: {
  69. title: t('Weekly Reports'),
  70. description: t(
  71. "Reports contain a summary of what's happened within the organization."
  72. ),
  73. type: 'select',
  74. // API only saves organizations that have this disabled, so we should default to "On"
  75. defaultValue: '1',
  76. options: [
  77. {value: '1', label: t('On')},
  78. {value: '0', label: t('Off')},
  79. ],
  80. defaultFieldName: 'weeklyReports',
  81. },
  82. approval: {
  83. title: t('Approvals'),
  84. description: t('Notifications from teammates that require review or approval.'),
  85. type: 'select',
  86. // No choices here because it's going to have dynamic content
  87. // Component will create choices,
  88. },
  89. quota: {
  90. title: t('Quota Notifications'),
  91. description: t(
  92. 'Control the notifications you receive for error, transaction, and attachment quota limits.'
  93. ),
  94. type: 'select',
  95. // No choices here because it's going to have dynamic content
  96. // Component will create choices,
  97. },
  98. spikeProtection: {
  99. title: t('Spike Protection Notifications'),
  100. description: t(
  101. 'Notifications about spikes on projects that you have enabled spike protection for.'
  102. ),
  103. type: 'select',
  104. defaultValue: '1',
  105. options: [
  106. {value: '1', label: t('On')},
  107. {value: '0', label: t('Off')},
  108. ],
  109. defaultFieldName: 'spikeProtection',
  110. },
  111. email: {
  112. title: t('Email Routing'),
  113. description: t(
  114. 'On a per project basis, route emails to an alternative email address.'
  115. ),
  116. type: 'select',
  117. // No choices here because it's going to have dynamic content
  118. // Component will create choices
  119. },
  120. };