Files
redash/client/app/visualizations/box-plot/Editor.jsx
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

40 lines
1.0 KiB
JavaScript

import React from "react";
import { Section, Input } from "@/components/visualizations/editor";
import { EditorPropTypes } from "@/visualizations";
export default function Editor({ options, onOptionsChange }) {
const onXAxisLabelChanged = xAxisLabel => {
const newOptions = { ...options, xAxisLabel };
onOptionsChange(newOptions);
};
const onYAxisLabelChanged = yAxisLabel => {
const newOptions = { ...options, yAxisLabel };
onOptionsChange(newOptions);
};
return (
<React.Fragment>
<Section>
<Input
label="X Axis Label"
data-test="BoxPlot.XAxisLabel"
value={options.xAxisLabel}
onChange={event => onXAxisLabelChanged(event.target.value)}
/>
</Section>
<Section>
<Input
label="Y Axis Label"
data-test="BoxPlot.YAxisLabel"
value={options.yAxisLabel}
onChange={event => onYAxisLabelChanged(event.target.value)}
/>
</Section>
</React.Fragment>
);
}
Editor.propTypes = EditorPropTypes;