diff --git a/.eslintrc.js b/.eslintrc.js
index 961e31d9f483e..36e98a0e1d250 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -375,7 +375,6 @@ module.exports = {
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-multi-spaces': 2,
radix: 2,
- curly: [2, 'multi-or-nest', 'consistent'],
// annoying rules that conflict with prettier
'space-before-function-paren': 0,
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.js
index a5e71e3143e16..8ff58b539d6d9 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.js
@@ -67,8 +67,9 @@ export const containerStyle = () => ({
};
if (backgroundImage) {
- if (!isValidUrl(backgroundImage))
+ if (!isValidUrl(backgroundImage)) {
throw new Error('Invalid backgroundImage. Please provide an asset or a URL.');
+ }
style.backgroundImage = `url(${backgroundImage})`;
style.backgroundSize = backgroundSize;
style.backgroundRepeat = backgroundRepeat;
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.js
index ebb94cde8fb68..dddec18e5a809 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.js
@@ -26,8 +26,9 @@ export const dropdownControl = () => ({
},
fn: (context, { valueColumn, filterColumn }) => {
let choices = [];
- if (context.rows[0][valueColumn])
+ if (context.rows[0][valueColumn]) {
choices = uniq(context.rows.map(row => row[valueColumn])).sort();
+ }
const column = filterColumn || valueColumn;
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.js
index ded8500ffbb09..f9194df51163d 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.js
@@ -39,8 +39,9 @@ export const math = () => ({
'Expressions must return a single number. Try wrapping your expression in mean() or sum()'
);
}
- if (isNaN(result))
+ if (isNaN(result)) {
throw new Error('Failed to execute math expression. Check your column names');
+ }
return result;
} catch (e) {
if (context.rows.length === 0) throw new Error('Empty datatable');
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.js
index 6391b01c3ded6..0a036f06dc5b8 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.js
@@ -28,8 +28,9 @@ export const getFlotAxisConfig = (axis, argValue, { columns, ticks, font } = {})
if (tickSize && axisType === 'number') config.tickSize = tickSize;
}
- if (axisType === 'string')
+ if (axisType === 'string') {
config.ticks = map(ticks[axis].hash, (position, name) => [position, name]);
+ }
if (axisType === 'date') config.mode = 'time';
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.js
index f3f167275949f..2cee3d91216a2 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.js
@@ -27,8 +27,9 @@ function combineAcross(datatableArray) {
// Sanity check
datatableArray.forEach(datatable => {
- if (datatable.rows.length !== targetRowLength)
+ if (datatable.rows.length !== targetRowLength) {
throw new Error('All expressions must return the same number of rows');
+ }
});
// Merge columns and rows.
@@ -103,9 +104,9 @@ export const ply = () => ({
const datatablePromises = originalDatatables.map(originalDatatable => {
let expressionResultPromises = [];
- if (args.expression)
+ if (args.expression) {
expressionResultPromises = args.expression.map(expression => expression(originalDatatable));
- else expressionResultPromises.push(Promise.resolve(originalDatatable));
+ } else expressionResultPromises.push(Promise.resolve(originalDatatable));
return Promise.all(expressionResultPromises).then(combineAcross);
});
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/src/pointseries/index.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/src/pointseries/index.js
index 02fc450f32eca..5a68134bd30e6 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/src/pointseries/index.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/src/pointseries/index.js
@@ -147,8 +147,9 @@ export const pointseries = () => ({
const measureValues = measureNames.map(measure => {
try {
const ev = evaluate(args[measure], subScope);
- if (Array.isArray(ev))
+ if (Array.isArray(ev)) {
throw new Error('Expressions must be wrapped in a function such as sum()');
+ }
return ev;
} catch (e) {
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js
index 4e6616a625023..c0655fcc713f5 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js
@@ -331,8 +331,9 @@ function init(plot) {
radius >= canvasWidth / 2 - shadowLeft ||
radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop ||
radius <= edge
- )
- return; // shadow would be outside canvas, so don't draw it
+ ) {
+ return;
+ } // shadow would be outside canvas, so don't draw it
ctx.save();
ctx.translate(shadowLeft, shadowTop);
@@ -386,8 +387,9 @@ function init(plot) {
ctx.save();
ctx.lineWidth = options.series.pie.stroke.width;
currentAngle = startAngle;
- for (let i = 0; i < slices.length; ++i)
+ for (let i = 0; i < slices.length; ++i) {
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
+ }
ctx.restore();
}
@@ -435,8 +437,9 @@ function init(plot) {
: maxRadius * options.series.pie.label.radius;
for (let i = 0; i < slices.length; ++i) {
- if (slices[i].percent >= options.series.pie.label.threshold * 100)
+ if (slices[i].percent >= options.series.pie.label.threshold * 100) {
if (!drawLabel(slices[i], currentAngle, i)) return false;
+ }
currentAngle += slices[i].angle;
}
@@ -487,8 +490,9 @@ function init(plot) {
0 - labelLeft > 0 ||
canvasHeight - (labelTop + label.height()) < 0 ||
canvasWidth - (labelLeft + label.width()) < 0
- )
+ ) {
return false;
+ }
if (options.series.pie.label.background.opacity !== 0) {
// put in the transparent background separately to avoid blended labels and label boxes
diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js
index d7c1885f6388c..faa67c51263af 100644
--- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js
+++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js
@@ -72,10 +72,12 @@ export const progress = () => ({
text.textContent = label;
text.setAttribute('className', 'canvasProgress__label');
- if (shape === 'horizontalPill')
+ if (shape === 'horizontalPill') {
text.setAttribute('x', parseInt(text.getAttribute('x'), 10) + offset / 2);
- if (shape === 'verticalPill')
+ }
+ if (shape === 'verticalPill') {
text.setAttribute('y', parseInt(text.getAttribute('y'), 10) - offset / 2);
+ }
Object.assign(text.style, font.spec);
shapeSvg.appendChild(text);
diff --git a/x-pack/plugins/canvas/common/lib/autocomplete.js b/x-pack/plugins/canvas/common/lib/autocomplete.js
index 8be391aea884a..b1e46197076af 100644
--- a/x-pack/plugins/canvas/common/lib/autocomplete.js
+++ b/x-pack/plugins/canvas/common/lib/autocomplete.js
@@ -67,8 +67,9 @@ function getFnArgAtPosition(ast, position) {
for (let argIndex = 0; argIndex < argValues.length; argIndex++) {
const value = argValues[argIndex];
if (value.start <= position && position <= value.end) {
- if (value.node !== null && value.node.type === 'expression')
+ if (value.node !== null && value.node.type === 'expression') {
return getFnArgAtPosition(value, position);
+ }
return { ast, fnIndex, argName, argIndex };
}
}
diff --git a/x-pack/plugins/canvas/public/apps/workpad/routes.js b/x-pack/plugins/canvas/public/apps/workpad/routes.js
index 42616135e08d2..bd483b4b9be6f 100644
--- a/x-pack/plugins/canvas/public/apps/workpad/routes.js
+++ b/x-pack/plugins/canvas/public/apps/workpad/routes.js
@@ -72,8 +72,9 @@ export const routes = [
const pageNumber = parseInt(params.page, 10);
// no page provided, append current page to url
- if (isNaN(pageNumber))
+ if (isNaN(pageNumber)) {
return router.redirectTo('loadWorkpad', { id: workpad.id, page: workpad.page + 1 });
+ }
// set the active page using the number provided in the url
const pageIndex = pageNumber - 1;
diff --git a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js
index 439556334c3e4..e22605c9aa0db 100644
--- a/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js
+++ b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js
@@ -56,8 +56,9 @@ export class Autocomplete extends React.Component {
prevProps.items !== this.props.items &&
this.props.items.length === 1 &&
this.state.selectedIndex !== 0
- )
+ ) {
this.selectFirst();
+ }
if (prevState.selectedIndex !== this.state.selectedIndex) this.scrollIntoView();
}
@@ -93,9 +94,9 @@ export class Autocomplete extends React.Component {
selectNext() {
const { items } = this.props;
const { selectedIndex } = this.state;
- if (selectedIndex >= 0 && selectedIndex < items.length - 1)
+ if (selectedIndex >= 0 && selectedIndex < items.length - 1) {
this.setState({ selectedIndex: selectedIndex + 1 });
- else this.setState({ selectedIndex: 0 });
+ } else this.setState({ selectedIndex: 0 });
}
scrollIntoView() {
diff --git a/x-pack/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/plugins/canvas/public/components/datasource/datasource_component.js
index e0240a3a8ef36..dda2f2a203b0c 100644
--- a/x-pack/plugins/canvas/public/components/datasource/datasource_component.js
+++ b/x-pack/plugins/canvas/public/components/datasource/datasource_component.js
@@ -96,8 +96,9 @@ export class DatasourceComponent extends PureComponent {
setInvalid,
} = this.props;
- if (selecting)
+ if (selecting) {
return ;
+ }
const datasourcePreview = previewing ? (
this.props.setFields(fields));
+ }
},
componentDidUpdate({ index }) {
const { setFields, onChange, selected } = this.props;
diff --git a/x-pack/plugins/canvas/public/components/fullscreen_control/fullscreen_control.js b/x-pack/plugins/canvas/public/components/fullscreen_control/fullscreen_control.js
index 3b56129c27417..7985e468d8f57 100644
--- a/x-pack/plugins/canvas/public/components/fullscreen_control/fullscreen_control.js
+++ b/x-pack/plugins/canvas/public/components/fullscreen_control/fullscreen_control.js
@@ -18,8 +18,9 @@ export class FullscreenControl extends React.PureComponent {
const { children, isFullscreen } = this.props;
const keyHandler = action => {
- if (action === 'FULLSCREEN' || (isFullscreen && action === 'FULLSCREEN_EXIT'))
+ if (action === 'FULLSCREEN' || (isFullscreen && action === 'FULLSCREEN_EXIT')) {
this.toggleFullscreen();
+ }
};
return (
diff --git a/x-pack/plugins/canvas/public/components/router/router.js b/x-pack/plugins/canvas/public/components/router/router.js
index 800c01079fcec..44df1f2b7b842 100644
--- a/x-pack/plugins/canvas/public/components/router/router.js
+++ b/x-pack/plugins/canvas/public/components/router/router.js
@@ -47,8 +47,9 @@ export class Router extends React.PureComponent {
if (!component) {
// TODO: render some kind of 404 page, maybe from a prop?
- if (process.env.NODE_ENV !== 'production')
+ if (process.env.NODE_ENV !== 'production') {
console.warn(`No component defined on route: ${route.name}`);
+ }
return;
}
@@ -73,8 +74,9 @@ export class Router extends React.PureComponent {
render() {
// show loading
- if (this.props.showLoading)
+ if (this.props.showLoading) {
return React.createElement(CanvasLoading, { msg: this.props.loadingMessage });
+ }
// show the activeComponent
return isClassComponent(this.state.activeComponent)
diff --git a/x-pack/plugins/canvas/public/components/workpad_export/index.js b/x-pack/plugins/canvas/public/components/workpad_export/index.js
index eaa4691b71839..2524584f5cd89 100644
--- a/x-pack/plugins/canvas/public/components/workpad_export/index.js
+++ b/x-pack/plugins/canvas/public/components/workpad_export/index.js
@@ -39,8 +39,9 @@ export const WorkpadExport = compose(
throw new Error(`Unknown export type: ${type}`);
},
onCopy: type => {
- if (type === 'pdf')
+ if (type === 'pdf') {
return notify.info('The PDF generation URL was copied to your clipboard.');
+ }
throw new Error(`Unknown export type: ${type}`);
},
diff --git a/x-pack/plugins/canvas/public/components/workpad_export/utils.js b/x-pack/plugins/canvas/public/components/workpad_export/utils.js
index be2e7e6d8114c..9fefaef09b9ab 100644
--- a/x-pack/plugins/canvas/public/components/workpad_export/utils.js
+++ b/x-pack/plugins/canvas/public/components/workpad_export/utils.js
@@ -28,8 +28,9 @@ export function getPdfUrl({ id, name: title, width, height }, { pageCount }) {
// build a list of all page urls for exporting, they are captured one at a time
const workpadUrls = [];
- for (let i = 1; i <= pageCount; i++)
+ for (let i = 1; i <= pageCount; i++) {
workpadUrls.push(rison.encode(`${canvasEntry}/export/workpad/pdf/${id}/page/${i}`));
+ }
const jobParams = {
browserTimezone: 'America/Phoenix', // TODO: get browser timezone, or Kibana setting?
diff --git a/x-pack/plugins/canvas/public/components/workpad_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/index.js
index 58bc2bc06ebd4..e1c3188b163c8 100644
--- a/x-pack/plugins/canvas/public/components/workpad_page/index.js
+++ b/x-pack/plugins/canvas/public/components/workpad_page/index.js
@@ -85,8 +85,9 @@ export const WorkpadPage = compose(
let element = null;
if (elementLookup.has(shape.id)) {
element = elementLookup.get(shape.id);
- if (selectedElementIds.indexOf(shape.id) > -1)
+ if (selectedElementIds.indexOf(shape.id) > -1) {
selectedElements.push({ ...element, id: shape.id });
+ }
}
// instead of just combining `element` with `shape`, we make property transfer explicit
return element ? { ...shape, filter: element.filter } : shape;
diff --git a/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.js b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.js
index 8661413c0b1e4..ef76598865858 100644
--- a/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.js
+++ b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.js
@@ -22,8 +22,9 @@ const EnhancedExtendedTemplate = lifecycle({
},
componentWillReceiveProps(newProps) {
const newLabel = get(newProps.argValue, 'chain.0.arguments.label.0', '');
- if (newLabel && this.props.label !== this.formatLabel(newLabel))
+ if (newLabel && this.props.label !== this.formatLabel(newLabel)) {
this.props.setLabel(this.formatLabel(newLabel));
+ }
},
})(ExtendedTemplate);
diff --git a/x-pack/plugins/canvas/public/expression_types/view.js b/x-pack/plugins/canvas/public/expression_types/view.js
index 6d0b6cd7a2817..166a242d2bae8 100644
--- a/x-pack/plugins/canvas/public/expression_types/view.js
+++ b/x-pack/plugins/canvas/public/expression_types/view.js
@@ -22,8 +22,9 @@ export class View extends FunctionForm {
this.modelArgs = this.modelArgs || [];
- if (!Array.isArray(this.modelArgs))
+ if (!Array.isArray(this.modelArgs)) {
throw new Error(`${this.name} element is invalid, modelArgs must be an array`);
+ }
}
}
diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout.js
index 93bd4ed8c8648..155f2ecd4f208 100644
--- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout.js
+++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout.js
@@ -685,8 +685,9 @@ const alignmentGuides = (shapes, guidedShapes, draggedShape) => {
// moved midpoint on vertical border
(extremeVertical === 0 && l !== 0 && extremeHorizontal === k)
)
- )
+ ) {
continue;
+ }
const D = landmarkPoint(d, k, l);
for (let m = -1; m < 2; m++) {
for (let n = -1; n < 2; n++) {
@@ -906,8 +907,9 @@ function resizeAnnotation(shapes, selectedShapes, shape) {
: [];
return result;
}
- if (foundShape.type === 'annotation')
+ if (foundShape.type === 'annotation') {
return resizeAnnotation(shapes, selectedShapes, shapes.find(s => foundShape.parent === s.id));
+ }
// fixme left active: snap wobble. right active: opposite side wobble.
const a = snappedA(properShape);
@@ -1057,8 +1059,9 @@ const snappedShapes = select(
const subtype = draggedShape && draggedShape.subtype;
// snapping doesn't come into play if there's no dragging, or it's not a resize drag or translate drag on a
// leaf element or a group element:
- if (subtype && [config.resizeHandleName, config.adHocGroupName].indexOf(subtype) === -1)
+ if (subtype && [config.resizeHandleName, config.adHocGroupName].indexOf(subtype) === -1) {
return contentShapes;
+ }
const constraints = alignmentGuideAnnotations; // fixme split concept of snap constraints and their annotations
const relaxed = alterSnapGesture.indexOf('relax') !== -1;
const constrained = config.snapConstraint && !relaxed;
diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/state.js b/x-pack/plugins/canvas/public/lib/aeroelastic/state.js
index 448c8b161f7c2..57f745d1825e0 100644
--- a/x-pack/plugins/canvas/public/lib/aeroelastic/state.js
+++ b/x-pack/plugins/canvas/public/lib/aeroelastic/state.js
@@ -23,8 +23,9 @@ const selectReduce = (fun, previousValue, mapFun = d => d, logFun) => (...inputs
if (
shallowEqual(argumentValues, (argumentValues = inputs.map(input => input(state)))) &&
value === prevValue
- )
+ ) {
return mappedValue;
+ }
prevValue = value;
value = fun(prevValue, ...argumentValues);
@@ -45,8 +46,9 @@ const select = (fun, logFun) => (...inputs) => {
if (
actionId === lastActionId ||
shallowEqual(argumentValues, (argumentValues = inputs.map(input => input(state))))
- )
+ ) {
return value;
+ }
value = fun(...argumentValues);
actionId = lastActionId;
diff --git a/x-pack/plugins/canvas/public/lib/router_provider.js b/x-pack/plugins/canvas/public/lib/router_provider.js
index eac87fd51a2a7..b5254b16da90a 100644
--- a/x-pack/plugins/canvas/public/lib/router_provider.js
+++ b/x-pack/plugins/canvas/public/lib/router_provider.js
@@ -51,8 +51,9 @@ export function routerProvider(routes) {
updateLocation(name, params, state, true);
},
onPathChange(fn) {
- if (componentListener != null)
+ if (componentListener != null) {
throw new Error('Only one route component listener is allowed');
+ }
const execOnMatch = location => {
const { pathname } = location;
diff --git a/x-pack/plugins/canvas/public/lib/time_duration.js b/x-pack/plugins/canvas/public/lib/time_duration.js
index 46d73fb02100b..77443f4c048a4 100644
--- a/x-pack/plugins/canvas/public/lib/time_duration.js
+++ b/x-pack/plugins/canvas/public/lib/time_duration.js
@@ -14,8 +14,9 @@ export const timeDuration = (time, format) => {
if (format === 'days' || days >= 1) return { length: days, format: getLabel('day', days) };
if (format === 'hours' || hours >= 1) return { length: hours, format: getLabel('hour', hours) };
- if (format === 'minutes' || minutes >= 1)
+ if (format === 'minutes' || minutes >= 1) {
return { length: seconds / 60, format: getLabel('minute', minutes) };
+ }
return { length: seconds, format: getLabel('second', seconds) };
};
diff --git a/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js b/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js
index e3f781ffe4ef6..6ad6848779f45 100644
--- a/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js
+++ b/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js
@@ -130,8 +130,9 @@ export const aeroelastic = ({ dispatch, getState }) => {
// set the selected element on the global store, if one element is selected
const selectedShape = nextScene.selectedPrimaryShapes[0];
if (nextScene.selectedShapes.length === 1) {
- if (selectedShape && selectedShape !== selectedElement)
+ if (selectedShape && selectedShape !== selectedElement) {
dispatch(selectElement(selectedShape));
+ }
} else {
// otherwise, clear the selected element state
dispatch(selectElement(null));
diff --git a/x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js b/x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js
index e84ef8c228a3e..b949e7025acbf 100644
--- a/x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js
+++ b/x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js
@@ -18,6 +18,7 @@ export const breadcrumbs = ({ getState }) => next => action => {
const updatedWorkpad = getWorkpad(getState());
// if the workpad name changed, update the breadcrumb data
- if (currentWorkpad.name !== updatedWorkpad.name)
+ if (currentWorkpad.name !== updatedWorkpad.name) {
setBreadcrumb([getBaseBreadcrumb(), getWorkpadBreadcrumb(updatedWorkpad)]);
+ }
};
diff --git a/x-pack/plugins/canvas/public/state/middleware/index.js b/x-pack/plugins/canvas/public/state/middleware/index.js
index 4b997d51d813b..fe842df379948 100644
--- a/x-pack/plugins/canvas/public/state/middleware/index.js
+++ b/x-pack/plugins/canvas/public/state/middleware/index.js
@@ -33,7 +33,8 @@ const middlewares = [
];
// intitialize redux devtools if extension is installed
-if (getWindow().__REDUX_DEVTOOLS_EXTENSION__)
+if (getWindow().__REDUX_DEVTOOLS_EXTENSION__) {
middlewares.push(getWindow().__REDUX_DEVTOOLS_EXTENSION__());
+}
export const middleware = compose(...middlewares);
diff --git a/x-pack/plugins/canvas/public/state/reducers/resolved_args.js b/x-pack/plugins/canvas/public/state/reducers/resolved_args.js
index 7404ece39136a..9afbf7d85649c 100644
--- a/x-pack/plugins/canvas/public/state/reducers/resolved_args.js
+++ b/x-pack/plugins/canvas/public/state/reducers/resolved_args.js
@@ -112,8 +112,9 @@ export const resolvedArgsReducer = handleActions(
return Object.keys(expressionContext).reduce((state, indexKey) => {
const indexAsNum = parseInt(indexKey, 10);
- if (indexAsNum >= index)
+ if (indexAsNum >= index) {
return del(state, getFullPath([elementId, 'expressionContext', indexKey]));
+ }
return state;
}, transientState);
diff --git a/x-pack/plugins/canvas/server/routes/workpad.js b/x-pack/plugins/canvas/server/routes/workpad.js
index e873f99efa74f..3ec3cb9d5247d 100644
--- a/x-pack/plugins/canvas/server/routes/workpad.js
+++ b/x-pack/plugins/canvas/server/routes/workpad.js
@@ -20,8 +20,9 @@ export function workpad(server) {
if (resp instanceof esErrors['401']) return boom.unauthorized();
- if (resp instanceof esErrors['403'])
+ if (resp instanceof esErrors['403']) {
return boom.forbidden("Sorry, you don't have access to that");
+ }
if (resp instanceof esErrors['404']) return boom.boomify(resp, { statusCode: 404 });