globalEventProcessingAlert.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {Fragment} from 'react';
  2. import Alert from 'sentry/components/alert';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {tct} from 'sentry/locale';
  5. import {Project} from 'sentry/types';
  6. const sentryStatusPageLink = 'https://status.sentry.io/';
  7. type Props = {
  8. projects: Project[];
  9. className?: string;
  10. };
  11. // This alert makes the user aware that one or more projects have been selected for the Low Priority Queue
  12. function GlobalEventProcessingAlert({className, projects}: Props) {
  13. const projectsInTheLowPriorityQueue = projects.filter(
  14. project => project.eventProcessing.symbolicationDegraded
  15. );
  16. if (!projectsInTheLowPriorityQueue.length) {
  17. return null;
  18. }
  19. return (
  20. <Alert className={className} type="info" showIcon>
  21. {projectsInTheLowPriorityQueue.length === 1
  22. ? tct(
  23. 'Event Processing for this project is currently degraded. Events may appear with larger delays than usual or get dropped. Please check the [link:Status] page for a potential outage.',
  24. {
  25. link: <ExternalLink href={sentryStatusPageLink} />,
  26. }
  27. )
  28. : tct(
  29. 'Event Processing for the [projectSlugs] projects is currently degraded. Events may appear with larger delays than usual or get dropped. Please check the [link:Status] page for a potential outage.',
  30. {
  31. projectSlugs: projectsInTheLowPriorityQueue.map(({slug}, index) => (
  32. <Fragment key={slug}>
  33. <strong>{slug}</strong>
  34. {index !== projectsInTheLowPriorityQueue.length - 1 && ', '}
  35. </Fragment>
  36. )),
  37. link: <ExternalLink href={sentryStatusPageLink} />,
  38. }
  39. )}
  40. </Alert>
  41. );
  42. }
  43. export default GlobalEventProcessingAlert;