uptimeIssues.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import EmptyStateWarning from 'sentry/components/emptyStateWarning';
  2. import GroupList from 'sentry/components/issues/groupList';
  3. import Panel from 'sentry/components/panels/panel';
  4. import PanelBody from 'sentry/components/panels/panelBody';
  5. import {t} from 'sentry/locale';
  6. import {IssueCategory} from 'sentry/types/group';
  7. import type {Project} from 'sentry/types/project';
  8. interface Props {
  9. project: Project;
  10. ruleId: string;
  11. }
  12. export function UptimeIssues({project, ruleId}: Props) {
  13. // TODO(davidenwang): Replace this with an actual query for the specific uptime alert rule
  14. const query = `issue.category:${IssueCategory.UPTIME} tags[uptime_rule]:${ruleId}`;
  15. const emptyMessage = () => {
  16. return (
  17. <Panel>
  18. <PanelBody>
  19. <EmptyStateWarning>
  20. <p>{t('No issues relating to this uptime alert have been found.')}</p>
  21. </EmptyStateWarning>
  22. </PanelBody>
  23. </Panel>
  24. );
  25. };
  26. return (
  27. <GroupList
  28. withChart={false}
  29. withPagination={false}
  30. withColumns={['assignee']}
  31. queryParams={{
  32. query,
  33. project: project.id,
  34. limit: 1,
  35. }}
  36. renderEmptyMessage={emptyMessage}
  37. />
  38. );
  39. }