Fix: Run with reporting disabled (#25829) (#26380)

* fix: relative link instead of static

* fix: handle missing reporting config value

* chore: refactor reportingBrowserType check

* fix: core interpreter reportingBrowserType

the code was duplicated from canvas, so it's equally as broken, this duplicates the fix
This commit is contained in:
Joe Fleming 2018-11-29 09:23:54 -07:00 committed by GitHub
parent 5b482feb23
commit c658f4461a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View file

@ -25,7 +25,11 @@ export default async function (server /*options*/) {
server.injectUiAppVars('canvas', () => { server.injectUiAppVars('canvas', () => {
const config = server.config(); const config = server.config();
const basePath = config.get('server.basePath'); const basePath = config.get('server.basePath');
const reportingBrowserType = config.get('xpack.reporting.capture.browser.type'); const reportingBrowserType = (() => {
const configKey = 'xpack.reporting.capture.browser.type';
if (!config.has(configKey)) return null;
return config.get(configKey);
})();
return { return {
kbnIndex: config.get('kibana.index'), kbnIndex: config.get('kibana.index'),

View file

@ -15,7 +15,11 @@ export default async function(server /*options*/) {
server.injectUiAppVars('canvas', () => { server.injectUiAppVars('canvas', () => {
const config = server.config(); const config = server.config();
const basePath = config.get('server.basePath'); const basePath = config.get('server.basePath');
const reportingBrowserType = config.get('xpack.reporting.capture.browser.type'); const reportingBrowserType = (() => {
const configKey = 'xpack.reporting.capture.browser.type';
if (!config.has(configKey)) return null;
return config.get(configKey);
})();
return { return {
kbnIndex: config.get('kibana.index'), kbnIndex: config.get('kibana.index'),

View file

@ -6,9 +6,9 @@
/* eslint import/no-unresolved: 1 */ /* eslint import/no-unresolved: 1 */
// TODO: remove eslint rule when updating to use the linked kibana resolve package // TODO: remove eslint rule when updating to use the linked kibana resolve package
import { jobCompletionNotifications } from 'plugins/reporting/lib/job_completion_notifications';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { compose, withProps } from 'recompose'; import { compose, withProps } from 'recompose';
import { jobCompletionNotifications } from '../../../../reporting/public/lib/job_completion_notifications';
import { getWorkpad, getPages } from '../../state/selectors/workpad'; import { getWorkpad, getPages } from '../../state/selectors/workpad';
import { getReportingBrowserType } from '../../state/selectors/app'; import { getReportingBrowserType } from '../../state/selectors/app';
import { notify } from '../../lib/notify'; import { notify } from '../../lib/notify';