mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
314daf155e
* Added an UNSET sync mode * Fixed tests * Remove sync logs and adjusted dropdown * Fixed duplication kve bug * Added sync config modal * AUtobind * Autobind working * Hot loading works again * Remove express * Fixed tests * Fix one thing * Fixed some hmr-related bugs
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
import React, {PropTypes, PureComponent} from 'react';
|
|
import autobind from 'autobind-decorator';
|
|
import Lazy from '../../base/Lazy';
|
|
import KeyValueEditor from '../../keyvalueeditor/Editor';
|
|
import {trackEvent} from '../../../../analytics/index';
|
|
|
|
@autobind
|
|
class UrlEncodedEditor extends PureComponent {
|
|
constructor (props) {
|
|
super(props);
|
|
}
|
|
|
|
_handleTrackToggle (pair) {
|
|
trackEvent(
|
|
'Url Encoded Editor',
|
|
'Toggle',
|
|
pair.disabled ? 'Disable' : 'Enable'
|
|
);
|
|
}
|
|
|
|
_handleTrackCreate () {
|
|
trackEvent('Url Encoded Editor', 'Create');
|
|
}
|
|
|
|
_handleTrackDelete () {
|
|
trackEvent('Url Encoded Editor', 'Delete');
|
|
}
|
|
|
|
render () {
|
|
const {parameters, onChange, handleRender} = this.props;
|
|
|
|
return (
|
|
<div className="scrollable-container tall wide">
|
|
<div className="scrollable">
|
|
<Lazy>
|
|
<KeyValueEditor
|
|
sortable
|
|
namePlaceholder="name"
|
|
valuePlaceholder="value"
|
|
onChange={onChange}
|
|
handleRender={handleRender}
|
|
onToggleDisable={this._handleTrackToggle}
|
|
onCreate={this._handleTrackCreate}
|
|
onDelete={this._handleTrackDelete}
|
|
pairs={parameters}
|
|
/>
|
|
</Lazy>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
UrlEncodedEditor.propTypes = {
|
|
// Required
|
|
onChange: PropTypes.func.isRequired,
|
|
parameters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
handleRender: PropTypes.func.isRequired,
|
|
};
|
|
|
|
export default UrlEncodedEditor;
|