broadcasts.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import platformCategories from 'sentry/data/platformPickerCategories';
  2. import platforms from 'sentry/data/platforms';
  3. export const REGIONCHOICES = [
  4. ['us', 'US'],
  5. ['de', 'DE'],
  6. ] as const;
  7. const exposedPlatformCategoriesSet = new Set([
  8. 'browser',
  9. 'server',
  10. 'mobile',
  11. 'desktop',
  12. 'serverless',
  13. ]);
  14. export const platformOptions = platformCategories
  15. .filter(({id}) => exposedPlatformCategoriesSet.has(id))
  16. .map(({name, platforms: platformKeys}) => ({
  17. label: name,
  18. options: [...platformKeys].map(platformKey => {
  19. const platform = platforms.find(p => p.id === platformKey);
  20. return {
  21. value: platformKey,
  22. label: platform?.name ?? platformKey,
  23. };
  24. }),
  25. }));
  26. export const PLATFORMCHOICES = platformOptions
  27. .flatMap(platformChoice => platformChoice.options)
  28. .map(option => [option.value, option.label]);
  29. export const PRODUCTCHOICES = [
  30. ['errors', 'Errors'],
  31. ['spans', 'Spans'],
  32. ['replays', 'Replays'],
  33. ['profiling', 'Profiling'],
  34. ['crons', 'Crons'],
  35. ] as const;
  36. export const TRIALCHOICES = [
  37. ['trialing', 'Trialing'],
  38. ['can_trial', 'Can Trial'],
  39. ['has_trialed', 'Has Trialed'],
  40. ] as const;
  41. export const ROLECHOICES = [
  42. ['admin', 'Admin'],
  43. ['billing', 'Billing'],
  44. ['manager', 'Manager'],
  45. ['member', 'Member'],
  46. ['owner', 'Owner'],
  47. ] as const;
  48. export const AVAILABLE_PLANCHOICES = [
  49. ['free', 'Free'],
  50. ['team', 'Team'],
  51. ['business', 'Business'],
  52. ['enterprise', 'Enterprise'],
  53. ] as const;
  54. export const ALL_PLANCHOICES = [
  55. ['paid_non_business', 'Paid Non-Business/Enterprise'],
  56. ...AVAILABLE_PLANCHOICES,
  57. ] as const;
  58. /**
  59. * Category of the broadcast.
  60. * Synced with https://github.com/getsentry/sentry/blob/master/src/sentry/models/broadcast.py#L14
  61. */
  62. export const CATEGORYCHOICES = [
  63. ['announcement', 'Announcement'],
  64. ['feature', 'New Feature'],
  65. ['blog', 'Blog Post'],
  66. ['event', 'Event'],
  67. ['video', 'Video'],
  68. ] as const;