utils.tsx 523 B

12345678910111213
  1. import {OnboardingTask} from 'sentry/types';
  2. export const taskIsDone = (task: OnboardingTask) =>
  3. ['complete', 'skipped'].includes(task.status);
  4. export const findCompleteTasks = (task: OnboardingTask) =>
  5. task.completionSeen && ['complete', 'skipped'].includes(task.status);
  6. export const findActiveTasks = (task: OnboardingTask) =>
  7. task.requisiteTasks.length === 0 && !findCompleteTasks(task);
  8. export const findUpcomingTasks = (task: OnboardingTask) =>
  9. task.requisiteTasks.length > 0 && !findCompleteTasks(task);