utils.tsx 787 B

123456789101112131415161718192021222324
  1. import {
  2. withoutPerformanceSupport,
  3. withPerformanceOnboarding,
  4. } from 'sentry/data/platformCategories';
  5. import {Project} from 'sentry/types';
  6. export function filterProjects(rawProjects: Project[]) {
  7. // filter on projects that have not sent a first transaction event
  8. const projectsWithoutFirstTransactionEvent = rawProjects.filter(
  9. p =>
  10. p.firstTransactionEvent === false &&
  11. (!p.platform || !withoutPerformanceSupport.has(p.platform))
  12. );
  13. // additionally filter on projects that have performance onboarding checklist support
  14. const projectsForOnboarding = projectsWithoutFirstTransactionEvent.filter(
  15. p => p.platform && withPerformanceOnboarding.has(p.platform)
  16. );
  17. return {
  18. projectsWithoutFirstTransactionEvent,
  19. projectsForOnboarding,
  20. };
  21. }