Skip to content

Commit

Permalink
Fix: Run with reporting disabled (elastic#25829)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
w33ble committed Nov 28, 2018
1 parent 459815f commit 2a52da3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/core_plugins/interpreter/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export default async function (server /*options*/) {
server.injectUiAppVars('canvas', () => {
const config = server.config();
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 {
kbnIndex: config.get('kibana.index'),
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/canvas/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export default async function(server /*options*/) {
server.injectUiAppVars('canvas', () => {
const config = server.config();
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 {
kbnIndex: config.get('kibana.index'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

/* eslint import/no-unresolved: 1 */
// 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 { compose, withProps } from 'recompose';
import { jobCompletionNotifications } from '../../../../reporting/public/lib/job_completion_notifications';
import { getWorkpad, getPages } from '../../state/selectors/workpad';
import { getReportingBrowserType } from '../../state/selectors/app';
import { notify } from '../../lib/notify';
Expand Down

0 comments on commit 2a52da3

Please sign in to comment.