import type { IconType } from '@elastic/eui' ; import { JOB_STATUSES } from '../../common/constants' ; import { Job } from '../lib/job' ; /**
 * This is not the most forward-compatible way of mapping to an  IconType for an application.
 *
 * Ideally apps using reporting should send some metadata for the icon type they want - this is how
 * the saved objects management UI handles icons at the moment.
  export const guessAppIconTypeFromObjectType = ( type ) : IconType => { switch ( type ) { case 'search' : return 'discoverApp' ; case 'dashboard' : return 'dashboardApp' ; case 'visualization' : return 'visualizeApp' ; case 'canvas workpad' : return 'canvasApp' ; default : return 'apps' ; } } ; export const jobHasIssues = ( job ) : boolean => { return ( Boolean ( job . getWarnings ( ) ) || [ JOB_STATUSES . WARNINGS , JOB_STATUSES . FAILED ] . some ( ( status ) => job . status === status ) ) ; } ;