Commit 77e57e2b authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Updates to the embedded view

parent 4358328d
...@@ -3,7 +3,7 @@ import React from 'react' ...@@ -3,7 +3,7 @@ import React from 'react'
import FontAwesome from 'react-fontawesome' import FontAwesome from 'react-fontawesome'
// import HostnameInput from '../components/HostnameInput' // import HostnameInput from '../components/HostnameInput'
// import { discoveryStart } from '../actions/' // import { discoveryStart } from '../actions/'
import {ListGroup, Label, ListGroupItem, Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap' import {Radio, ListGroup, Label, ListGroupItem, Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap'
import API from '../utils/API' import API from '../utils/API'
class XController extends React.Component { class XController extends React.Component {
...@@ -12,18 +12,37 @@ class XController extends React.Component { ...@@ -12,18 +12,37 @@ class XController extends React.Component {
this.props.orcidRemove(id) this.props.orcidRemove(id)
} }
render() { radioSelect(id) {
var content console.error("RADIO SELECT", id)
if (this.props.orcids.items.length > 0) { }
content = this.props.orcids.items.map((orcid) => getORCIDentry(orcid) {
( if (this.props.embedded) {
return (
<ListGroupItem key={orcid.orcid}> <ListGroupItem key={orcid.orcid}>
<Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button> <Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button>
<Radio name="orcidSelector" onChange={this.radioSelect.bind(this, orcid.orcid)} inline>
<h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4> <h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4>
</Radio>
</ListGroupItem> </ListGroupItem>
) )
}
return (
<ListGroupItem key={orcid.orcid}>
<Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button>
<h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4>
</ListGroupItem>
) )
}
render() {
var content
if (this.props.orcids.items.length > 0) {
content = this.props.orcids.items.map((orcid) => this.getORCIDentry(orcid))
} else { } else {
content = ( content = (
<div>Ingen ORCIDs registrert din bruker.</div> <div>Ingen ORCIDs registrert din bruker.</div>
...@@ -46,7 +65,8 @@ class XController extends React.Component { ...@@ -46,7 +65,8 @@ class XController extends React.Component {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
orcids: state.orcids orcids: state.orcids,
embedded: state.embedded
}) })
const mapDispatchToProps = { const mapDispatchToProps = {
......
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