diff --git a/src/core/plugins/oas3/components/operation-servers.jsx b/src/core/plugins/oas3/components/operation-servers.jsx index 5db8683a..f5c27583 100644 --- a/src/core/plugins/oas3/components/operation-servers.jsx +++ b/src/core/plugins/oas3/components/operation-servers.jsx @@ -2,7 +2,7 @@ import React from "react" import PropTypes from "prop-types" import ImPropTypes from "react-immutable-proptypes" -export default class OperationServers extends React.PureComponent { +export default class OperationServers extends React.Component { static propTypes = { // for self path: PropTypes.string.isRequired, @@ -21,11 +21,17 @@ export default class OperationServers extends React.PureComponent { setSelectedServer = (server) => { const { path, method } = this.props + // FIXME: we should be keeping up with this in props/state upstream of us + // instead of cheating™ with `forceUpdate` + this.forceUpdate() return this.props.setSelectedServer(server, `${path}:${method}`) } setServerVariableValue = (obj) => { const { path, method } = this.props + // FIXME: we should be keeping up with this in props/state upstream of us + // instead of cheating™ with `forceUpdate` + this.forceUpdate() return this.props.setServerVariableValue({ ...obj, namespace: `${path}:${method}` @@ -34,22 +40,21 @@ export default class OperationServers extends React.PureComponent { getSelectedServer = () => { const { path, method } = this.props - debugger return this.props.getSelectedServer(`${path}:${method}`) } - getServerVariable = (obj) => { + getServerVariable = (server, key) => { const { path, method } = this.props return this.props.getServerVariable({ - ...obj, - namespace: `${path}:${method}` - }) + namespace: `${path}:${method}`, + server + }, key) } - getEffectiveServerValue = (obj) => { + getEffectiveServerValue = (server) => { const { path, method } = this.props return this.props.getEffectiveServerValue({ - ...obj, + server, namespace: `${path}:${method}` }) } diff --git a/src/core/plugins/oas3/components/servers.jsx b/src/core/plugins/oas3/components/servers.jsx index dd073976..5ebfcf5a 100644 --- a/src/core/plugins/oas3/components/servers.jsx +++ b/src/core/plugins/oas3/components/servers.jsx @@ -18,7 +18,6 @@ export default class Servers extends React.Component { let { servers } = this.props //fire 'change' event to set default 'value' of select - debugger this.setServer(servers.first().get("url")) }