|
@@ -53,17 +53,17 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
this.setState({ mapping: updatedMapping });
|
|
this.setState({ mapping: updatedMapping });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- updateMapping = () => {
|
|
|
|
|
|
|
+ onMappingTypeChange = mappingType => {
|
|
|
const { mapping } = this.state;
|
|
const { mapping } = this.state;
|
|
|
|
|
|
|
|
- this.props.updateMapping(mapping);
|
|
|
|
|
|
|
+ const updatedMapping = { ...mapping, type: mappingType };
|
|
|
|
|
+ this.setState({ mapping: updatedMapping });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- onMappingTypeChange = mappingType => {
|
|
|
|
|
|
|
+ updateMapping = () => {
|
|
|
const { mapping } = this.state;
|
|
const { mapping } = this.state;
|
|
|
|
|
|
|
|
- const updatedMapping = { ...mapping, type: mappingType };
|
|
|
|
|
- this.setState({ mapping: updatedMapping });
|
|
|
|
|
|
|
+ this.props.updateMapping(mapping);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
renderRow() {
|
|
renderRow() {
|
|
@@ -74,7 +74,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="gf-form">
|
|
<div className="gf-form">
|
|
|
- <div className="gf-form-inline">
|
|
|
|
|
|
|
+ <div className="gf-form-inline mapping-row-input">
|
|
|
<Label width={4}>From</Label>
|
|
<Label width={4}>From</Label>
|
|
|
<div>
|
|
<div>
|
|
|
<input
|
|
<input
|
|
@@ -85,7 +85,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="gf-form-inline">
|
|
|
|
|
|
|
+ <div className="gf-form-inline mapping-row-input">
|
|
|
<Label width={4}>To</Label>
|
|
<Label width={4}>To</Label>
|
|
|
<div>
|
|
<div>
|
|
|
<input
|
|
<input
|
|
@@ -96,7 +96,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="gf-form-inline">
|
|
|
|
|
|
|
+ <div className="gf-form-inline mapping-row-input">
|
|
|
<Label width={4}>Text</Label>
|
|
<Label width={4}>Text</Label>
|
|
|
<div>
|
|
<div>
|
|
|
<input
|
|
<input
|
|
@@ -115,7 +115,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="gf-form">
|
|
<div className="gf-form">
|
|
|
- <div className="gf-form-inline">
|
|
|
|
|
|
|
+ <div className="gf-form-inline mapping-row-input">
|
|
|
<Label width={4}>Value</Label>
|
|
<Label width={4}>Value</Label>
|
|
|
<div>
|
|
<div>
|
|
|
<input
|
|
<input
|
|
@@ -126,7 +126,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="gf-form-inline">
|
|
|
|
|
|
|
+ <div className="gf-form-inline mapping-row-input">
|
|
|
<Label width={4}>Text</Label>
|
|
<Label width={4}>Text</Label>
|
|
|
<div>
|
|
<div>
|
|
|
<input
|
|
<input
|
|
@@ -151,7 +151,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
onChange={mappingType => this.onMappingTypeChange(mappingType)}
|
|
onChange={mappingType => this.onMappingTypeChange(mappingType)}
|
|
|
value={mapping.type}
|
|
value={mapping.type}
|
|
|
stackedButtons={true}
|
|
stackedButtons={true}
|
|
|
- render={({ selectedValue, onChange }) => {
|
|
|
|
|
|
|
+ render={({ selectedValue, onChange, stackedButtons }) => {
|
|
|
return [
|
|
return [
|
|
|
<ToggleButton
|
|
<ToggleButton
|
|
|
className="btn-small"
|
|
className="btn-small"
|
|
@@ -159,6 +159,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
onChange={onChange}
|
|
onChange={onChange}
|
|
|
selected={selectedValue === MappingType.ValueToText}
|
|
selected={selectedValue === MappingType.ValueToText}
|
|
|
value={MappingType.ValueToText}
|
|
value={MappingType.ValueToText}
|
|
|
|
|
+ stackedButtons={stackedButtons}
|
|
|
>
|
|
>
|
|
|
Value
|
|
Value
|
|
|
</ToggleButton>,
|
|
</ToggleButton>,
|
|
@@ -168,6 +169,7 @@ export default class MappingRow extends PureComponent<Props, State> {
|
|
|
onChange={onChange}
|
|
onChange={onChange}
|
|
|
selected={selectedValue === MappingType.RangeToText}
|
|
selected={selectedValue === MappingType.RangeToText}
|
|
|
value={MappingType.RangeToText}
|
|
value={MappingType.RangeToText}
|
|
|
|
|
+ stackedButtons={stackedButtons}
|
|
|
>
|
|
>
|
|
|
Range
|
|
Range
|
|
|
</ToggleButton>,
|
|
</ToggleButton>,
|