fields.tsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {t} from 'app/locale';
  2. export type FineTuneField = {
  3. title: string;
  4. description: string;
  5. type: 'select';
  6. choices?: string[][];
  7. defaultValue?: string;
  8. defaultFieldName?: string;
  9. };
  10. export const ACCOUNT_NOTIFICATION_FIELDS: Record<string, FineTuneField> = {
  11. alerts: {
  12. title: 'Project Alerts',
  13. description: t('Control alerts that you receive per project.'),
  14. type: 'select',
  15. choices: [
  16. ['-1', t('Default')],
  17. ['1', t('On')],
  18. ['0', t('Off')],
  19. ],
  20. defaultValue: '-1',
  21. defaultFieldName: 'subscribeByDefault',
  22. },
  23. workflow: {
  24. title: 'Workflow Notifications',
  25. description: t(
  26. 'Control workflow notifications, e.g. changes in issue assignment, resolution status, and comments.'
  27. ),
  28. type: 'select',
  29. choices: [
  30. ['-1', t('Default')],
  31. ['0', t('Always')],
  32. ['1', t('Only on issues I subscribe to')],
  33. ['2', t('Never')],
  34. ],
  35. defaultValue: '-1',
  36. defaultFieldName: 'workflowNotifications',
  37. },
  38. deploy: {
  39. title: t('Deploy Notifications'),
  40. description: t(
  41. 'Control deploy notifications that include release, environment, and commit overviews.'
  42. ),
  43. type: 'select',
  44. choices: [
  45. ['-1', t('Default')],
  46. ['2', t('Always')],
  47. ['3', t('Only on deploys with my commits')],
  48. ['4', t('Never')],
  49. ],
  50. defaultValue: '-1',
  51. defaultFieldName: 'deployNotifications',
  52. },
  53. reports: {
  54. title: t('Weekly Reports'),
  55. description: t(
  56. "Reports contain a summary of what's happened within the organization."
  57. ),
  58. type: 'select',
  59. // API only saves organizations that have this disabled, so we should default to "On"
  60. defaultValue: '1',
  61. choices: [
  62. ['1', t('On')],
  63. ['0', t('Off')],
  64. ],
  65. defaultFieldName: 'weeklyReports',
  66. },
  67. email: {
  68. title: t('Email Routing'),
  69. description: t(
  70. 'On a per project basis, route emails to an alternative email address.'
  71. ),
  72. type: 'select',
  73. // No choices here because it's going to have dynamic content
  74. // Component will create choices
  75. },
  76. };