1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00

Fix negation of expanded prop of Property

This commit is contained in:
Tim Daubenschütz 2015-12-04 10:49:41 +01:00
parent 5a05a029b7
commit 34126c2254
5 changed files with 27 additions and 38 deletions

View File

@ -124,6 +124,7 @@ const InputContractAgreementCheckbox = React.createClass({
disabled, disabled,
style } = this.props; style } = this.props;
const { contractAgreementList } = this.state; const { contractAgreementList } = this.state;
const contractAgreement = this.getContractAgreement(contractAgreementList);
const inputCheckboxProps = { const inputCheckboxProps = {
name, name,
disabled, disabled,
@ -131,29 +132,24 @@ const InputContractAgreementCheckbox = React.createClass({
onChange: this.onChange onChange: this.onChange
}; };
if (contractAgreementList && contractAgreementList.length > 0) { if(contractAgreement) {
const contractAgreement = contractAgreementList[0]; const {
const { issuer: contractIssuer, blob: { url_safe: contractUrl } } = contractAgreement.contract; datetime_accepted: datetimeAccepted,
issuer: contractIssuer,
blob: { url_safe: contractUrl },
if (contractAgreement.datetime_accepted) { } = contractAgreement.contract;
// For `InputCheckbox` we want to override style in this case
Object.assign(inputCheckboxProps, { style: { 'display': 'none' } });
if(datetimeAccepted) {
return ( return (
<div className="notification-contract-pdf"> <div className="notification-contract-pdf">
<embed <embed
className="loan-form" className="loan-form"
src={contractUrl} src={contractUrl}
alt="pdf" alt="pdf"
pluginspage="http://www.adobe.com/products/acrobat/readstep2.html"/> pluginspage="http://www.adobe.com/products/acrobat/readstep2.html"/>
<a href={contractUrl} target="_blank"> <a href={contractUrl} target="_blank">
<span className="glyphicon glyphicon-download" aria-hidden="true" /> {getLangText('Download contract')} <span className="glyphicon glyphicon-download" aria-hidden="true" /> {getLangText('Download contract')}
</a> </a>
<InputCheckbox
{...inputCheckboxProps}
key="terms_implicitly"
defaultChecked={true} />
</div> </div>
); );
} else { } else {
@ -171,13 +167,6 @@ const InputContractAgreementCheckbox = React.createClass({
</InputCheckbox> </InputCheckbox>
); );
} }
} else {
return (
<InputCheckbox
{...inputCheckboxProps}
key="terms_implicitly"
defaultChecked={true} />
);
} }
}, },

View File

@ -122,7 +122,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='artist_bio' name='artist_bio'
label={getLangText('Artist Biography')} label={getLangText('Artist Biography')}
expanded={!disabled && piece.extra_data.artist_bio}> expanded={!disabled || !!piece.extra_data.artist_bio}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.artist_bio} defaultValue={piece.extra_data.artist_bio}
@ -131,7 +131,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='artist_contact_information' name='artist_contact_information'
label={getLangText('Artist Contact Information')} label={getLangText('Artist Contact Information')}
expanded={!disabled && piece.extra_data.artist_contact_information}> expanded={!disabled || !!piece.extra_data.artist_contact_information}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.artist_contact_information} defaultValue={piece.extra_data.artist_contact_information}
@ -140,7 +140,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='conceptual_overview' name='conceptual_overview'
label={getLangText('Conceptual Overview')} label={getLangText('Conceptual Overview')}
expanded={!disabled && piece.extra_data.conceptual_overview}> expanded={!disabled || !!piece.extra_data.conceptual_overview}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.conceptual_overview} defaultValue={piece.extra_data.conceptual_overview}
@ -149,7 +149,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='medium' name='medium'
label={getLangText('Medium (technical specifications)')} label={getLangText('Medium (technical specifications)')}
expanded={!disabled && piece.extra_data.medium}> expanded={!disabled || !!piece.extra_data.medium}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.medium} defaultValue={piece.extra_data.medium}
@ -158,7 +158,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='size_duration' name='size_duration'
label={getLangText('Size / Duration')} label={getLangText('Size / Duration')}
expanded={!disabled && piece.extra_data.size_duration}> expanded={!disabled || !!piece.extra_data.size_duration}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.size_duration} defaultValue={piece.extra_data.size_duration}
@ -167,7 +167,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='display_instructions' name='display_instructions'
label={getLangText('Display instructions')} label={getLangText('Display instructions')}
expanded={!disabled && piece.extra_data.display_instructions}> expanded={!disabled || !!piece.extra_data.display_instructions}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.display_instructions} defaultValue={piece.extra_data.display_instructions}
@ -176,7 +176,7 @@ let CylandAdditionalDataForm = React.createClass({
<Property <Property
name='additional_details' name='additional_details'
label={getLangText('Additional details')} label={getLangText('Additional details')}
expanded={!disabled && piece.extra_data.additional_details}> expanded={!disabled || !!piece.extra_data.additional_details}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={piece.extra_data.additional_details} defaultValue={piece.extra_data.additional_details}

View File

@ -104,7 +104,7 @@ let IkonotvArtistDetailsForm = React.createClass({
<Property <Property
name='artist_website' name='artist_website'
label={getLangText('Artist Website')} label={getLangText('Artist Website')}
expanded={!this.props.disabled && this.props.piece.extra_data.artist_website}> expanded={!this.props.disabled || !!this.props.piece.extra_data.artist_website}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.artist_website} defaultValue={this.props.piece.extra_data.artist_website}
@ -113,7 +113,7 @@ let IkonotvArtistDetailsForm = React.createClass({
<Property <Property
name='gallery_website' name='gallery_website'
label={getLangText('Website of related Gallery, Museum, etc.')} label={getLangText('Website of related Gallery, Museum, etc.')}
expanded={!this.props.disabled && this.props.piece.extra_data.gallery_website}> expanded={!this.props.disabled || !!this.props.piece.extra_data.gallery_website}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.gallery_website} defaultValue={this.props.piece.extra_data.gallery_website}
@ -122,7 +122,7 @@ let IkonotvArtistDetailsForm = React.createClass({
<Property <Property
name='additional_websites' name='additional_websites'
label={getLangText('Additional Websites/Publications/Museums/Galleries')} label={getLangText('Additional Websites/Publications/Museums/Galleries')}
expanded={!this.props.disabled && this.props.piece.extra_data.additional_websites}> expanded={!this.props.disabled || !!this.props.piece.extra_data.additional_websites}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.additional_websites} defaultValue={this.props.piece.extra_data.additional_websites}
@ -131,7 +131,7 @@ let IkonotvArtistDetailsForm = React.createClass({
<Property <Property
name='conceptual_overview' name='conceptual_overview'
label={getLangText('Short text about the Artist')} label={getLangText('Short text about the Artist')}
expanded={!this.props.disabled && this.props.piece.extra_data.conceptual_overview}> expanded={!this.props.disabled || !!this.props.piece.extra_data.conceptual_overview}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.conceptual_overview} defaultValue={this.props.piece.extra_data.conceptual_overview}

View File

@ -103,7 +103,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='medium' name='medium'
label={getLangText('Medium')} label={getLangText('Medium')}
expanded={!this.props.disabled && this.props.piece.extra_data.medium}> expanded={!this.props.disabled || !!this.props.piece.extra_data.medium}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.medium} defaultValue={this.props.piece.extra_data.medium}
@ -112,7 +112,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='size_duration' name='size_duration'
label={getLangText('Size/Duration')} label={getLangText('Size/Duration')}
expanded={!this.props.disabled && this.props.piece.extra_data.size_duration}> expanded={!this.props.disabled || !!this.props.piece.extra_data.size_duration}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.size_duration} defaultValue={this.props.piece.extra_data.size_duration}
@ -121,7 +121,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='copyright' name='copyright'
label={getLangText('Copyright')} label={getLangText('Copyright')}
expanded={!this.props.disabled && this.props.piece.extra_data.copyright}> expanded={!this.props.disabled || !!this.props.piece.extra_data.copyright}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.copyright} defaultValue={this.props.piece.extra_data.copyright}
@ -130,7 +130,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='courtesy_of' name='courtesy_of'
label={getLangText('Courtesy of')} label={getLangText('Courtesy of')}
expanded={!this.props.disabled && this.props.piece.extra_data.courtesy_of}> expanded={!this.props.disabled || !!this.props.piece.extra_data.courtesy_of}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.courtesy_of} defaultValue={this.props.piece.extra_data.courtesy_of}
@ -139,7 +139,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='copyright_of_photography' name='copyright_of_photography'
label={getLangText('Copyright of Photography')} label={getLangText('Copyright of Photography')}
expanded={!this.props.disabled && this.props.piece.extra_data.copyright_of_photography}> expanded={!this.props.disabled || !!this.props.piece.extra_data.copyright_of_photography}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.copyright_of_photography} defaultValue={this.props.piece.extra_data.copyright_of_photography}
@ -148,7 +148,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
<Property <Property
name='additional_details' name='additional_details'
label={getLangText('Additional Details about the artwork')} label={getLangText('Additional Details about the artwork')}
expanded={!this.props.disabled && this.props.piece.extra_data.additional_details}> expanded={!this.props.disabled || !!this.props.piece.extra_data.additional_details}>
<InputTextAreaToggable <InputTextAreaToggable
rows={1} rows={1}
defaultValue={this.props.piece.extra_data.additional_details} defaultValue={this.props.piece.extra_data.additional_details}

View File

@ -214,7 +214,7 @@ let IkonotvRegisterPiece = React.createClass({
url={ApiUrls.ownership_loans_pieces} url={ApiUrls.ownership_loans_pieces}
email={whitelabel.user} email={whitelabel.user}
startDate={today} startDate={today}
endDate={enddate} endDate={endDate}
showStartDate={false} showStartDate={false}
showEndDate={false} showEndDate={false}
gallery="IkonoTV archive" gallery="IkonoTV archive"