mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
6a136bd76a
* Add multi-part form support * tests for form and multipart * Better Analytics Tracking
32 lines
962 B
JavaScript
32 lines
962 B
JavaScript
import React, {PropTypes, Component} from 'react';
|
|
import KeyValueEditor from '../../base/KeyValueEditor';
|
|
import {trackEvent} from '../../../../analytics/index';
|
|
|
|
class UrlEncodedEditor extends Component {
|
|
render () {
|
|
const {parameters, onChange} = this.props;
|
|
|
|
return (
|
|
<div className="scrollable-container tall wide">
|
|
<div className="scrollable">
|
|
<KeyValueEditor
|
|
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}
|
|
/>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
UrlEncodedEditor.propTypes = {
|
|
// Required
|
|
onChange: PropTypes.func.isRequired,
|
|
parameters: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
};
|
|
|
|
export default UrlEncodedEditor;
|