fields.tsx 3.2 KB

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