mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [ML] Only add ML links for sample data sets if full license * [ML] Update following review
This commit is contained in:
parent
99d6d9bc96
commit
8ab06e9a13
1 changed files with 10 additions and 4 deletions
|
@ -11,6 +11,7 @@ import Boom from 'boom';
|
|||
import { checkLicense } from './server/lib/check_license';
|
||||
import { addLinksToSampleDatasets } from './server/lib/sample_data_sets';
|
||||
import { FEATURE_ANNOTATIONS_ENABLED } from './common/constants/feature_flags';
|
||||
import { LICENSE_TYPE } from './common/constants/license';
|
||||
|
||||
import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status';
|
||||
import { annotationRoutes } from './server/routes/annotations';
|
||||
|
@ -79,11 +80,16 @@ export const ml = (kibana) => {
|
|||
xpackMainPlugin.status.once('green', () => {
|
||||
// Register a function that is called whenever the xpack info changes,
|
||||
// to re-compute the license check results for this plugin
|
||||
xpackMainPlugin.info.feature(thisPlugin.id).registerLicenseCheckResultsGenerator(checkLicense);
|
||||
const mlFeature = xpackMainPlugin.info.feature(thisPlugin.id);
|
||||
mlFeature.registerLicenseCheckResultsGenerator(checkLicense);
|
||||
|
||||
const isEnabled = xpackMainPlugin.info.feature(thisPlugin.id).isEnabled();
|
||||
if (isEnabled === true) {
|
||||
addLinksToSampleDatasets(server);
|
||||
// Add links to the Kibana sample data sets if ml is enabled
|
||||
// and there is a full license (trial or platinum).
|
||||
if (mlFeature.isEnabled() === true) {
|
||||
const licenseCheckResults = mlFeature.getLicenseCheckResults();
|
||||
if (licenseCheckResults.licenseType === LICENSE_TYPE.FULL) {
|
||||
addLinksToSampleDatasets(server);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue