import { MlLicense } from '../../../common/license' ; import { showExpiredLicenseWarning } from './expired_warning' ; export class MlClientLicense extends MlLicense { fullLicenseResolver ( ) { if ( this . isMlEnabled ( ) === false || this . isMinimumLicense ( ) === false ) { return redirectToKibana ( ) ; } if ( this . isFullLicense ( ) === false ) { return redirectToBasic ( ) ; } if ( this . hasLicenseExpired ( ) ) { showExpiredLicenseWarning ( ) ; } return Promise . resolve ( ) ; } basicLicenseResolver ( ) { if ( this . isMlEnabled ( ) === false || this . isMinimumLicense ( ) === false ) { return redirectToKibana ( ) ; } if ( this . hasLicenseExpired ( ) ) { showExpiredLicenseWarning ( ) ; } return Promise . resolve ( ) ; } } function redirectToKibana ( ) { window . location . href = '/' ; return Promise . reject ( ) ; } function redirectToBasic ( ) { window . location . href = '#/datavisualizer' ; return Promise . reject ( ) ; }