[ML] Fixing missing new ML job link in file datavisualizer (#27889)

This commit is contained in:
James Gowdy 2019-01-02 17:48:15 +00:00 committed by GitHub
parent b9b43cce9c
commit 6c47361e56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,25 +33,7 @@ export function checkFullLicense(Private, kbnBaseUrl, kbnUrl) {
} else {
// ML is enabled
licenseHasExpired = (features.hasExpired || false);
// If the license has expired ML app will still work for 7 days and then
// the job management endpoints (e.g. create job, start datafeed) will be restricted.
// Therefore we need to keep the app enabled but show an info banner to the user.
if(licenseHasExpired) {
const message = features.message;
if (expiredLicenseBannerId === undefined) {
// Only show the banner once with no way to dismiss it
expiredLicenseBannerId = banners.add({
component: (
<EuiCallOut
iconType="iInCircle"
color="warning"
title={message}
/>
),
});
}
}
setLicenseExpired(features);
return Promise.resolve(features);
}
}
@ -67,6 +49,7 @@ export function checkBasicLicense(Private, kbnBaseUrl) {
} else {
// ML is enabled
setLicenseExpired(features);
return Promise.resolve(features);
}
}
@ -89,6 +72,28 @@ export function checkLicenseExpired(Private, kbnBaseUrl, kbnUrl) {
});
}
function setLicenseExpired(features) {
licenseHasExpired = (features.hasExpired || false);
// If the license has expired ML app will still work for 7 days and then
// the job management endpoints (e.g. create job, start datafeed) will be restricted.
// Therefore we need to keep the app enabled but show an info banner to the user.
if(licenseHasExpired) {
const message = features.message;
if (expiredLicenseBannerId === undefined) {
// Only show the banner once with no way to dismiss it
expiredLicenseBannerId = banners.add({
component: (
<EuiCallOut
iconType="iInCircle"
color="warning"
title={message}
/>
),
});
}
}
}
function getFeatures(Private) {
const xpackInfo = Private(XPackInfoProvider);
return xpackInfo.get('features.ml');