fields.tsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import {t} from 'sentry/locale';
  2. import type {SelectValue} from 'sentry/types/core';
  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. // TODO(isabella): Once GA, replace the following with Spend Notifications
  68. quota: {
  69. title: t('Quota Notifications'),
  70. description: t(
  71. 'Control the notifications you receive for error, transaction, and attachment quota limits.'
  72. ),
  73. type: 'select',
  74. // No choices here because it's going to have dynamic content
  75. // Component will create choices,
  76. },
  77. spikeProtection: {
  78. title: t('Spike Protection Notifications'),
  79. description: t(
  80. 'Notifications about spikes on projects that you have enabled spike protection for.'
  81. ),
  82. type: 'select',
  83. defaultValue: '1',
  84. options: [
  85. {value: '1', label: t('On')},
  86. {value: '0', label: t('Off')},
  87. ],
  88. },
  89. email: {
  90. title: t('Email Routing'),
  91. description: t(
  92. 'On a per project basis, route emails to an alternative email address.'
  93. ),
  94. type: 'select',
  95. // No choices here because it's going to have dynamic content
  96. // Component will create choices
  97. },
  98. };