mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 10:00:17 -04:00
* 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
40 lines
1.0 KiB
JavaScript
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;
|