fields2.tsx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import * as React from 'react';
  2. import {t} from 'app/locale';
  3. export type NotificationSettingField = {
  4. name: string;
  5. type: 'select' | 'blank' | 'boolean';
  6. label: string;
  7. choices?: string[][];
  8. defaultValue?: string;
  9. defaultFieldName?: string;
  10. help?: string;
  11. confirm?: {[key: string]: React.ReactNode | string};
  12. };
  13. export const NOTIFICATION_SETTING_FIELDS: Record<string, NotificationSettingField> = {
  14. alerts: {
  15. name: 'alerts',
  16. type: 'select',
  17. label: t('Issue Alerts'),
  18. choices: [
  19. ['always', t('On')],
  20. ['never', t('Off')],
  21. ],
  22. help: t('Notifications sent from Alert rules that your team has set up.'),
  23. },
  24. workflow: {
  25. name: 'workflow',
  26. type: 'select',
  27. label: t('Issue Workflow'),
  28. choices: [
  29. ['always', t('On')],
  30. ['subscribe_only', t('Only Subscribed Issues')],
  31. ['never', t('Off')],
  32. ],
  33. help: t('Changes in issue assignment, resolution status, and comments.'),
  34. },
  35. deploy: {
  36. name: 'deploy',
  37. type: 'select',
  38. label: t('Deploys'),
  39. choices: [
  40. ['always', t('On')],
  41. ['committed_only', t('Only Committed Issues')],
  42. ['never', t('Off')],
  43. ],
  44. help: t('Release, environment, and commit overviews.'),
  45. },
  46. provider: {
  47. name: 'provider',
  48. type: 'select',
  49. label: t('Delivery Method'),
  50. choices: [
  51. ['email', t('Send to Email')],
  52. ['slack', t('Send to Slack')],
  53. ['email+slack', t('Send to Email and Slack')],
  54. ],
  55. },
  56. reports: {
  57. name: 'weekly reports',
  58. type: 'blank',
  59. label: t('Weekly Reports'),
  60. help: t('A summary of the past week for an organization.'),
  61. },
  62. email: {
  63. name: 'email routing',
  64. type: 'blank',
  65. label: t('Email Routing'),
  66. help: t('Change the email address that receives notifications.'),
  67. },
  68. personalActivityNotifications: {
  69. name: 'personalActivityNotifications',
  70. type: 'boolean',
  71. label: t('My Own Activity'),
  72. help: t('Notifications about your own actions on Sentry.'),
  73. },
  74. selfAssignOnResolve: {
  75. name: 'selfAssignOnResolve',
  76. type: 'boolean',
  77. label: t('Claim Unassigned Issues I’ve Resolved'),
  78. help: t('You’ll receive notifications about any changes that happen afterwards.'),
  79. },
  80. };