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 {
</div>
)
}
// console.error("-----", this.props)
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
className="gutter"
controlId="formBasicText"
......
......@@ -80,7 +80,7 @@ class Component extends PureComponent {
}
let expanded = !!this.props.serverConfig
let expanded = this.props.expanded && !!this.props.serverConfig
return (
<Panel header="OAuth Server Configuration" eventKey="2" collapsible={true} defaultExpanded={expanded}>
<form>
......
......@@ -4,7 +4,8 @@ import HostnameInput from '../components/HostnameInput'
import API from '../utils/API'
const mapStateToProps = (state) => ({
serverError: state.serverError
serverError: state.serverError,
expanded: !state.token
})
const mapDispatchToProps = {
......
import { connect } from 'react-redux'
import ServerConfigInput from '../components/ServerConfigInput'
// import { discoveryStart } from '../actions/'
import actions from '../actions/'
import API from '../utils/API'
const mapStateToProps = (state) => ({
serverConfig: state.serverConfig
serverConfig: state.serverConfig,
expanded: !state.token
})
const mapDispatchToProps = {
authenticateStart: API.authenticate,
logoutStart: API.logout
logoutStart: API.logout,
updateConfig: actions.discovery.completed
}
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