Skip to content

Commit

Permalink
Confirm GIS app enabled and wait until license info enabled before pa…
Browse files Browse the repository at this point in the history
…ssing license info through to maps app (elastic#27607)

# Conflicts:
#	x-pack/plugins/gis/server/routes.js
  • Loading branch information
kindsun committed Dec 28, 2018
1 parent 320d812 commit 82e560b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
44 changes: 22 additions & 22 deletions x-pack/plugins/gis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ export function gis(kibana) {
},

init(server) {
const thisPlugin = this;
const xpackMainPlugin = server.plugins.xpack_main;
const gisEnabled = server.config().get('xpack.gis.enabled');

watchStatusAndLicenseToInitialize(xpackMainPlugin, thisPlugin,
async license => {
if (license) {
if (license.gis) {
// TODO: Replace with content to 'activate' app on license verify
console.info('Valid GIS License');
} else {
console.warn('No GIS for YOU!');
if (gisEnabled) {
const thisPlugin = this;
const xpackMainPlugin = server.plugins.xpack_main;

watchStatusAndLicenseToInitialize(xpackMainPlugin, thisPlugin,
async license => {
if (license && license.gis) {
initRoutes(server);
}
return license;
}
});
xpackMainPlugin.info
.feature(thisPlugin.id)
.registerLicenseCheckResultsGenerator(checkLicense);
});

initRoutes(server);
server.registerSampleDataset(kySaltTrucksSpecProvider);
server.addSavedObjectsToSampleDataset('logs', webLogsSavedObjects);
server.injectUiAppVars('gis', async () => {
return await server.getInjectedUiAppVars('kibana');
});
xpackMainPlugin.info
.feature(thisPlugin.id)
.registerLicenseCheckResultsGenerator(checkLicense);

server.registerSampleDataset(kySaltTrucksSpecProvider);
server.addSavedObjectsToSampleDataset('logs', webLogsSavedObjects);
server.injectUiAppVars('gis', async () => {
return await server.getInjectedUiAppVars('kibana');
});
} else {
server.log(['info', 'maps'], 'Maps app disabled by configuration');
}
}
});
}
3 changes: 0 additions & 3 deletions x-pack/plugins/gis/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,3 @@ export function initRoutes(server) {
return { fileLayers, tmsServices };
}
}



0 comments on commit 82e560b

Please sign in to comment.