From 7e9d8f0b374d0c71676ab2441626b715a1d9169f Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 30 Nov 2017 15:30:46 -0800 Subject: [PATCH] Wire up OperationServers passthrough --- .../oas3/components/operation-servers.jsx | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/core/plugins/oas3/components/operation-servers.jsx b/src/core/plugins/oas3/components/operation-servers.jsx index 3162ad9b..f59e1fac 100644 --- a/src/core/plugins/oas3/components/operation-servers.jsx +++ b/src/core/plugins/oas3/components/operation-servers.jsx @@ -4,13 +4,40 @@ import ImPropTypes from "react-immutable-proptypes" export default class OperationServers extends React.PureComponent { static propTypes = { + // for self operationServers: ImPropTypes.list, pathServers: ImPropTypes.list, + + // for Servers + currentServer: PropTypes.string.isRequired, + setSelectedServer: PropTypes.func.isRequired, + setServerVariableValue: PropTypes.func.isRequired, + getServerVariable: PropTypes.func.isRequired, + getEffectiveServerValue: PropTypes.func.isRequired, + + // utils getComponent: PropTypes.func.isRequired } render() { - const { getComponent, pathServers, operationServers } = this.props + const { + // for self + operationServers, + pathServers, + + // for Servers + currentServer, + setSelectedServer, + setServerVariableValue, + getServerVariable, + getEffectiveServerValue, + + // util + getComponent + } = this.props + + const serverPassthroughProps = { currentServer, setSelectedServer, setServerVariableValue, getServerVariable, getEffectiveServerValue } + const Servers = getComponent("Servers") const serversToDisplay = operationServers || pathServers @@ -25,6 +52,7 @@ export default class OperationServers extends React.PureComponent {

These {displaying}-level options override the global server options.