fields.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. deploy: {
  43. title: t('Deploy Notifications'),
  44. description: t(
  45. 'Control deploy notifications that include release, environment, and commit overviews.'
  46. ),
  47. type: 'select',
  48. options: [
  49. {value: '-1', label: t('Default')},
  50. {value: '2', label: t('Always')},
  51. {value: '3', label: t('Only on deploys with my commits')},
  52. {value: '4', label: t('Never')},
  53. ],
  54. defaultValue: '-1',
  55. defaultFieldName: 'deployNotifications',
  56. },
  57. reports: {
  58. title: t('Weekly Reports'),
  59. description: t(
  60. "Reports contain a summary of what's happened within the organization."
  61. ),
  62. type: 'select',
  63. // API only saves organizations that have this disabled, so we should default to "On"
  64. defaultValue: '1',
  65. options: [
  66. {value: '1', label: t('On')},
  67. {value: '0', label: t('Off')},
  68. ],
  69. defaultFieldName: 'weeklyReports',
  70. },
  71. approval: {
  72. title: t('Nudges'),
  73. description: t('Notifications that require review or approval.'),
  74. type: 'select',
  75. // No choices here because it's going to have dynamic content
  76. // Component will create choices,
  77. },
  78. quota: {
  79. title: t('Quota Notifications'),
  80. description: t(
  81. 'Control the notifications you receive for error, transaction, and attachment quota limits.'
  82. ),
  83. type: 'select',
  84. // No choices here because it's going to have dynamic content
  85. // Component will create choices,
  86. },
  87. spikeProtection: {
  88. title: t('Spike Protection Notifications'),
  89. description: t(
  90. 'Notifications about spikes on projects that you have enabled spike protection for.'
  91. ),
  92. type: 'select',
  93. defaultValue: '1',
  94. options: [
  95. {value: '1', label: t('On')},
  96. {value: '0', label: t('Off')},
  97. ],
  98. defaultFieldName: 'spikeProtection',
  99. },
  100. email: {
  101. title: t('Email Routing'),
  102. description: t(
  103. 'On a per project basis, route emails to an alternative email address.'
  104. ),
  105. type: 'select',
  106. // No choices here because it's going to have dynamic content
  107. // Component will create choices
  108. },
  109. };