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: '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: '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: 'Issues in My Releases',
  44. description: t(
  45. 'Get a notification when an issue happens shortly after your release.'
  46. ),
  47. type: 'select',
  48. defaultValue: '0',
  49. options: [
  50. {value: '1', label: t('On')},
  51. {value: '0', label: t('Off')},
  52. ],
  53. defaultFieldName: 'activeReleaseNotifications',
  54. },
  55. deploy: {
  56. title: t('Deploy Notifications'),
  57. description: t(
  58. 'Control deploy notifications that include release, environment, and commit overviews.'
  59. ),
  60. type: 'select',
  61. options: [
  62. {value: '-1', label: t('Default')},
  63. {value: '2', label: t('Always')},
  64. {value: '3', label: t('Only on deploys with my commits')},
  65. {value: '4', label: t('Never')},
  66. ],
  67. defaultValue: '-1',
  68. defaultFieldName: 'deployNotifications',
  69. },
  70. reports: {
  71. title: t('Weekly Reports'),
  72. description: t(
  73. "Reports contain a summary of what's happened within the organization."
  74. ),
  75. type: 'select',
  76. // API only saves organizations that have this disabled, so we should default to "On"
  77. defaultValue: '1',
  78. options: [
  79. {value: '1', label: t('On')},
  80. {value: '0', label: t('Off')},
  81. ],
  82. defaultFieldName: 'weeklyReports',
  83. },
  84. approval: {
  85. title: t('Approvals'),
  86. description: t('Notifications from teammates that require review or approval.'),
  87. type: 'select',
  88. // No choices here because it's going to have dynamic content
  89. // Component will create choices,
  90. },
  91. quota: {
  92. title: t('Quota Notifications'),
  93. description: t(
  94. 'Control the notifications you receive for error, transaction, and attachment quota limits.'
  95. ),
  96. type: 'select',
  97. // No choices here because it's going to have dynamic content
  98. // Component will create choices,
  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. };