import React, {Component, PropTypes} from 'react'; import {Tab, Tabs, TabList, TabPanel} from 'react-tabs'; import KeyValueEditor from './base/KeyValueEditor'; import RequestHeadersEditor from './editors/RequestHeadersEditor'; import ContentTypeDropdown from './dropdowns/ContentTypeDropdown'; import RenderedQueryString from './RenderedQueryString'; import BodyEditor from './editors/body/BodyEditor'; import AuthEditor from './editors/AuthEditor'; import RequestUrlBar from './RequestUrlBar.js'; import {MOD_SYM, getContentTypeName, getContentTypeFromHeaders} from '../../common/constants'; import {debounce} from '../../common/misc'; import {getBodyDescription} from '../../models/request'; class RequestPane extends Component { render () { const { request, environmentId, handleImportFile, showPasswords, editorFontSize, editorLineWrapping, handleCreateRequest, handleSend, useBulkHeaderEditor, updateRequestUrl, updateRequestMethod, updateRequestBody, updateRequestParameters, updateRequestAuthentication, updateRequestHeaders, updateRequestMimeType, updateSettingsUseBulkHeaderEditor } = this.props; if (!request) { return (
New Request {MOD_SYM}N
Switch Requests {MOD_SYM}P
Manage Cookies {MOD_SYM}K
Edit Environments {MOD_SYM}E
) } const numParameters = request.parameters.filter(p => !p.disabled).length; const numHeaders = request.headers.filter(h => !h.disabled).length; const hasAuth = !request.authentication.disabled; return (
) } } RequestPane.propTypes = { // Functions handleSend: PropTypes.func.isRequired, handleCreateRequest: PropTypes.func.isRequired, updateRequestUrl: PropTypes.func.isRequired, updateRequestMethod: PropTypes.func.isRequired, updateRequestBody: PropTypes.func.isRequired, updateRequestParameters: PropTypes.func.isRequired, updateRequestAuthentication: PropTypes.func.isRequired, updateRequestHeaders: PropTypes.func.isRequired, updateRequestMimeType: PropTypes.func.isRequired, updateSettingsShowPasswords: PropTypes.func.isRequired, updateSettingsUseBulkHeaderEditor: PropTypes.func.isRequired, handleImportFile: PropTypes.func.isRequired, // Other useBulkHeaderEditor: PropTypes.bool.isRequired, showPasswords: PropTypes.bool.isRequired, editorFontSize: PropTypes.number.isRequired, editorLineWrapping: PropTypes.bool.isRequired, environmentId: PropTypes.string.isRequired, // Optional request: PropTypes.object, }; export default RequestPane;