mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Fix react warning for select inputs
This commit is contained in:
parent
bd5aa266b1
commit
33b8e51aee
@ -134,7 +134,7 @@ let ContractAgreementForm = React.createClass({
|
||||
return (
|
||||
<div>
|
||||
<p className="text-center">
|
||||
{getLangText('No private contracts found, please go to the ')}
|
||||
{getLangText('No contracts uploaded yet, please go to the ')}
|
||||
<a href="settings">{getLangText('settings page')}</a>
|
||||
{getLangText(' and create them.')}
|
||||
</p>
|
||||
|
@ -29,12 +29,15 @@ let CopyrightAssociationForm = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
let selectedState = -1;
|
||||
if (this.props.currentUser
|
||||
&& this.props.currentUser.profile
|
||||
let selectedState;
|
||||
let selectDefaultValue = ' -- ' + getLangText('select an association') + ' -- ';
|
||||
|
||||
if (this.props.currentUser && this.props.currentUser.profile
|
||||
&& this.props.currentUser.profile.copyright_association) {
|
||||
selectedState = AppConstants.copyrightAssociations.indexOf(this.props.currentUser.profile.copyright_association);
|
||||
selectedState = selectedState !== -1 ? AppConstants.copyrightAssociations[selectedState] : selectDefaultValue;
|
||||
}
|
||||
|
||||
if (this.props.currentUser && this.props.currentUser.email){
|
||||
return (
|
||||
<Form
|
||||
@ -47,17 +50,19 @@ let CopyrightAssociationForm = React.createClass({
|
||||
className="ascribe-settings-property-collapsible-toggle"
|
||||
label={getLangText('Copyright Association')}
|
||||
style={{paddingBottom: 0}}>
|
||||
<select name="contract">
|
||||
<option disabled selected={selectedState === -1}>
|
||||
{' -- ' + getLangText('select an association') + ' -- '}
|
||||
<select defaultValue={selectedState} name="contract">
|
||||
<option
|
||||
name={0}
|
||||
key={0}
|
||||
value={selectDefaultValue}>
|
||||
{selectDefaultValue}
|
||||
</option>
|
||||
{AppConstants.copyrightAssociations.map((association, i) => {
|
||||
return (
|
||||
<option
|
||||
name={i}
|
||||
key={i}
|
||||
value={ association }
|
||||
selected={selectedState === i}>
|
||||
name={i + 1}
|
||||
key={i + 1}
|
||||
value={association}>
|
||||
{ association }
|
||||
</option>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user