constants.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {t} from 'sentry/locale';
  2. export const ALL_PROVIDERS = {
  3. email: 'default',
  4. slack: 'never',
  5. };
  6. export const ALL_PROVIDER_NAMES = Object.keys(ALL_PROVIDERS);
  7. /**
  8. * These values are stolen from the DB.
  9. */
  10. export const VALUE_MAPPING = {
  11. default: 0,
  12. never: 10,
  13. always: 20,
  14. subscribe_only: 30,
  15. committed_only: 40,
  16. };
  17. export const MIN_PROJECTS_FOR_CONFIRMATION = 3;
  18. export const MIN_PROJECTS_FOR_SEARCH = 3;
  19. export const MIN_PROJECTS_FOR_PAGINATION = 100;
  20. export type NotificationSettingsByProviderObject = {[key: string]: string};
  21. export type NotificationSettingsObject = {
  22. [key: string]: {[key: string]: {[key: string]: NotificationSettingsByProviderObject}};
  23. };
  24. export const NOTIFICATION_SETTINGS_TYPES = [
  25. 'alerts',
  26. 'activeRelease',
  27. 'workflow',
  28. 'deploy',
  29. 'approval',
  30. 'quota',
  31. 'reports',
  32. 'email',
  33. ];
  34. export const SELF_NOTIFICATION_SETTINGS_TYPES = [
  35. 'personalActivityNotifications',
  36. 'selfAssignOnResolve',
  37. ];
  38. export const CONFIRMATION_MESSAGE = (
  39. <div>
  40. <p style={{marginBottom: '20px'}}>
  41. <strong>Are you sure you want to disable these notifications?</strong>
  42. </p>
  43. <p>
  44. {t(
  45. 'Turning this off will irreversibly overwrite all of your fine-tuning settings to "off".'
  46. )}
  47. </p>
  48. </div>
  49. );