Basic OperationServers display
This commit is contained in:
@@ -166,12 +166,6 @@ export default class Operation extends PureComponent {
|
|||||||
</div> : null
|
</div> : null
|
||||||
}
|
}
|
||||||
|
|
||||||
{ !tryItOutEnabled ? null :
|
|
||||||
<OperationServers
|
|
||||||
operationServers={operation.get("servers")}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
|
|
||||||
<Parameters
|
<Parameters
|
||||||
parameters={parameters}
|
parameters={parameters}
|
||||||
operation={operation}
|
operation={operation}
|
||||||
@@ -189,6 +183,14 @@ export default class Operation extends PureComponent {
|
|||||||
getConfigs={ getConfigs }
|
getConfigs={ getConfigs }
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{ !tryItOutEnabled ? null :
|
||||||
|
<OperationServers
|
||||||
|
getComponent={getComponent}
|
||||||
|
operationServers={operation.get("servers")}
|
||||||
|
pathServers={specSelectors.paths().getIn([path, "servers"])}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
{!tryItOutEnabled || !allowTryItOut ? null : schemes && schemes.size ? <div className="opblock-schemes">
|
{!tryItOutEnabled || !allowTryItOut ? null : schemes && schemes.size ? <div className="opblock-schemes">
|
||||||
<Schemes schemes={ schemes }
|
<Schemes schemes={ schemes }
|
||||||
path={ path }
|
path={ path }
|
||||||
|
|||||||
@@ -1,7 +1,33 @@
|
|||||||
import React from "react"
|
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.PureComponent {
|
||||||
|
static propTypes = {
|
||||||
|
operationServers: ImPropTypes.list,
|
||||||
|
pathServers: ImPropTypes.list,
|
||||||
|
getComponent: PropTypes.func.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return null
|
const { getComponent, pathServers, operationServers } = this.props
|
||||||
|
const Servers = getComponent("Servers")
|
||||||
|
|
||||||
|
const serversToDisplay = operationServers || pathServers
|
||||||
|
const displaying = operationServers ? "operation" : "path"
|
||||||
|
|
||||||
|
return <div className="opblock-section">
|
||||||
|
<div className="opblock-section-header">
|
||||||
|
<div className="tab-header">
|
||||||
|
<h4 className="opblock-title">Servers ({displaying})</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="opblock-description-wrapper">
|
||||||
|
<h4>These options override the global server settings.</h4>
|
||||||
|
<Servers
|
||||||
|
servers={serversToDisplay}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user