Commit 206bbc6b authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Update expanded state

parent 493648c9
...@@ -59,9 +59,9 @@ class Component extends PureComponent { ...@@ -59,9 +59,9 @@ class Component extends PureComponent {
</div> </div>
) )
} }
// console.error("-----", this.props)
return ( return (
<Panel header="OAuth Service Discovery" eventKey="1" collapsible={true} defaultExpanded={true}> <Panel header="OAuth Service Discovery" eventKey="1" collapsible={true} defaultExpanded={this.props.expanded}>
<FormGroup <FormGroup
className="gutter" className="gutter"
controlId="formBasicText" controlId="formBasicText"
......
...@@ -80,7 +80,7 @@ class Component extends PureComponent { ...@@ -80,7 +80,7 @@ class Component extends PureComponent {
} }
let expanded = !!this.props.serverConfig let expanded = this.props.expanded && !!this.props.serverConfig
return ( return (
<Panel header="OAuth Server Configuration" eventKey="2" collapsible={true} defaultExpanded={expanded}> <Panel header="OAuth Server Configuration" eventKey="2" collapsible={true} defaultExpanded={expanded}>
<form> <form>
......
...@@ -4,7 +4,8 @@ import HostnameInput from '../components/HostnameInput' ...@@ -4,7 +4,8 @@ import HostnameInput from '../components/HostnameInput'
import API from '../utils/API' import API from '../utils/API'
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
serverError: state.serverError serverError: state.serverError,
expanded: !state.token
}) })
const mapDispatchToProps = { const mapDispatchToProps = {
......
import { connect } from 'react-redux' import { connect } from 'react-redux'
import ServerConfigInput from '../components/ServerConfigInput' import ServerConfigInput from '../components/ServerConfigInput'
// import { discoveryStart } from '../actions/' import actions from '../actions/'
import API from '../utils/API' import API from '../utils/API'
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
serverConfig: state.serverConfig serverConfig: state.serverConfig,
expanded: !state.token
}) })
const mapDispatchToProps = { const mapDispatchToProps = {
authenticateStart: API.authenticate, authenticateStart: API.authenticate,
logoutStart: API.logout logoutStart: API.logout,
updateConfig: actions.discovery.completed
} }
const Controller = connect( const Controller = connect(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment