2016-11-22 19:42:10 +00:00
|
|
|
import React, {PropTypes, Component} from 'react';
|
|
|
|
import KeyValueEditor from '../../base/KeyValueEditor';
|
2016-11-23 19:33:24 +00:00
|
|
|
import {trackEvent} from '../../../../analytics/index';
|
2016-11-22 19:42:10 +00:00
|
|
|
|
|
|
|
class UrlEncodedEditor extends Component {
|
|
|
|
render () {
|
|
|
|
const {parameters, onChange} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="scrollable-container tall wide">
|
|
|
|
<div className="scrollable">
|
2016-11-23 19:33:24 +00:00
|
|
|
<KeyValueEditor
|
2016-11-24 01:12:13 +00:00
|
|
|
namePlaceholder="name"
|
|
|
|
valuePlaceholder="value"
|
2016-11-23 19:33:24 +00:00
|
|
|
onChange={onChange}
|
|
|
|
onToggleDisable={pair => trackEvent('Url Encoded Editor', 'Toggle', pair.disabled ? 'Disable' : 'Enable')}
|
|
|
|
onCreate={() => trackEvent('Url Encoded Editor', 'Create')}
|
|
|
|
onDelete={() => trackEvent('Url Encoded Editor', 'Delete')}
|
|
|
|
pairs={parameters}
|
|
|
|
/>
|
2016-11-22 19:42:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UrlEncodedEditor.propTypes = {
|
|
|
|
// Required
|
|
|
|
onChange: PropTypes.func.isRequired,
|
|
|
|
parameters: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UrlEncodedEditor;
|