Merge branch 'master' into webpack-migration-2.x
This commit is contained in:
@@ -7,7 +7,8 @@ export default class Schemes extends React.Component {
|
||||
specActions: PropTypes.object.isRequired,
|
||||
schemes: PropTypes.object.isRequired,
|
||||
path: PropTypes.string,
|
||||
method: PropTypes.string
|
||||
method: PropTypes.string,
|
||||
operationScheme: PropTypes.string
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
@@ -17,11 +18,18 @@ export default class Schemes extends React.Component {
|
||||
this.setScheme(schemes.first())
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if ( this.props.operationScheme && !nextProps.schemes.has(this.props.operationScheme) ) {
|
||||
//fire 'change' event if our selected scheme is no longer an option
|
||||
this.setScheme(nextProps.schemes.first())
|
||||
}
|
||||
}
|
||||
|
||||
onChange =( e ) => {
|
||||
this.setScheme( e.target.value )
|
||||
}
|
||||
|
||||
setScheme =( value ) => {
|
||||
setScheme = ( value ) => {
|
||||
let { path, method, specActions } = this.props
|
||||
|
||||
specActions.setScheme( value, path, method )
|
||||
|
||||
Reference in New Issue
Block a user