constants.tsx 1.2 KB

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