fields.tsx 2.9 KB

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