[7.x] [Canvas] Fixes axisConfig position argument UI (#50717) (#52215)

This commit is contained in:
Catherine Liu 2019-12-05 10:44:22 -07:00 committed by GitHub
parent 2fe82cfe3b
commit 09e28a97eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,13 +79,19 @@ export class ExtendedTemplate extends PureComponent<Props> {
}
const positions = {
xaxis: [strings.getPositionBottom(), strings.getPositionTop()],
yaxis: [strings.getPositionLeft(), strings.getPositionRight()],
xaxis: [
{ value: 'bottom', text: strings.getPositionBottom() },
{ value: 'top', text: strings.getPositionTop() },
],
yaxis: [
{ value: 'left', text: strings.getPositionLeft() },
{ value: 'right', text: strings.getPositionRight() },
],
};
const argName = this.props.typeInstance.name;
const position = this.getArgValue('position', positions[argName][0]);
const position = this.getArgValue('position', positions[argName][0].value);
const options = positions[argName].map(val => ({ value: val, text: val }));
const options = positions[argName];
return (
<Fragment>