mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Fix negation of expanded prop of Property
This commit is contained in:
parent
5a05a029b7
commit
34126c2254
@ -124,6 +124,7 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
disabled,
|
||||
style } = this.props;
|
||||
const { contractAgreementList } = this.state;
|
||||
const contractAgreement = this.getContractAgreement(contractAgreementList);
|
||||
const inputCheckboxProps = {
|
||||
name,
|
||||
disabled,
|
||||
@ -131,29 +132,24 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
onChange: this.onChange
|
||||
};
|
||||
|
||||
if (contractAgreementList && contractAgreementList.length > 0) {
|
||||
const contractAgreement = contractAgreementList[0];
|
||||
const { issuer: contractIssuer, blob: { url_safe: contractUrl } } = contractAgreement.contract;
|
||||
|
||||
|
||||
if (contractAgreement.datetime_accepted) {
|
||||
// For `InputCheckbox` we want to override style in this case
|
||||
Object.assign(inputCheckboxProps, { style: { 'display': 'none' } });
|
||||
if(contractAgreement) {
|
||||
const {
|
||||
datetime_accepted: datetimeAccepted,
|
||||
issuer: contractIssuer,
|
||||
blob: { url_safe: contractUrl },
|
||||
} = contractAgreement.contract;
|
||||
|
||||
if(datetimeAccepted) {
|
||||
return (
|
||||
<div className="notification-contract-pdf">
|
||||
<embed
|
||||
className="loan-form"
|
||||
src={contractUrl}
|
||||
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">
|
||||
<span className="glyphicon glyphicon-download" aria-hidden="true" /> {getLangText('Download contract')}
|
||||
</a>
|
||||
<InputCheckbox
|
||||
{...inputCheckboxProps}
|
||||
key="terms_implicitly"
|
||||
defaultChecked={true} />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
@ -171,13 +167,6 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
</InputCheckbox>
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return (
|
||||
<InputCheckbox
|
||||
{...inputCheckboxProps}
|
||||
key="terms_implicitly"
|
||||
defaultChecked={true} />
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -122,7 +122,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='artist_bio'
|
||||
label={getLangText('Artist Biography')}
|
||||
expanded={!disabled && piece.extra_data.artist_bio}>
|
||||
expanded={!disabled || !!piece.extra_data.artist_bio}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.artist_bio}
|
||||
@ -131,7 +131,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.artist_contact_information}
|
||||
@ -140,7 +140,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='conceptual_overview'
|
||||
label={getLangText('Conceptual Overview')}
|
||||
expanded={!disabled && piece.extra_data.conceptual_overview}>
|
||||
expanded={!disabled || !!piece.extra_data.conceptual_overview}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.conceptual_overview}
|
||||
@ -149,7 +149,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='medium'
|
||||
label={getLangText('Medium (technical specifications)')}
|
||||
expanded={!disabled && piece.extra_data.medium}>
|
||||
expanded={!disabled || !!piece.extra_data.medium}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.medium}
|
||||
@ -158,7 +158,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='size_duration'
|
||||
label={getLangText('Size / Duration')}
|
||||
expanded={!disabled && piece.extra_data.size_duration}>
|
||||
expanded={!disabled || !!piece.extra_data.size_duration}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.size_duration}
|
||||
@ -167,7 +167,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='display_instructions'
|
||||
label={getLangText('Display instructions')}
|
||||
expanded={!disabled && piece.extra_data.display_instructions}>
|
||||
expanded={!disabled || !!piece.extra_data.display_instructions}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.display_instructions}
|
||||
@ -176,7 +176,7 @@ let CylandAdditionalDataForm = React.createClass({
|
||||
<Property
|
||||
name='additional_details'
|
||||
label={getLangText('Additional details')}
|
||||
expanded={!disabled && piece.extra_data.additional_details}>
|
||||
expanded={!disabled || !!piece.extra_data.additional_details}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
defaultValue={piece.extra_data.additional_details}
|
||||
|
@ -104,7 +104,7 @@ let IkonotvArtistDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.artist_website}
|
||||
@ -113,7 +113,7 @@ let IkonotvArtistDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='gallery_website'
|
||||
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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.gallery_website}
|
||||
@ -122,7 +122,7 @@ let IkonotvArtistDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='additional_websites'
|
||||
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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.additional_websites}
|
||||
@ -131,7 +131,7 @@ let IkonotvArtistDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='conceptual_overview'
|
||||
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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.conceptual_overview}
|
||||
|
@ -103,7 +103,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.medium}
|
||||
@ -112,7 +112,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.size_duration}
|
||||
@ -121,7 +121,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.copyright}
|
||||
@ -130,7 +130,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.courtesy_of}
|
||||
@ -139,7 +139,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.copyright_of_photography}
|
||||
@ -148,7 +148,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||
<Property
|
||||
name='additional_details'
|
||||
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
|
||||
rows={1}
|
||||
defaultValue={this.props.piece.extra_data.additional_details}
|
||||
|
@ -214,7 +214,7 @@ let IkonotvRegisterPiece = React.createClass({
|
||||
url={ApiUrls.ownership_loans_pieces}
|
||||
email={whitelabel.user}
|
||||
startDate={today}
|
||||
endDate={enddate}
|
||||
endDate={endDate}
|
||||
showStartDate={false}
|
||||
showEndDate={false}
|
||||
gallery="IkonoTV archive"
|
||||
|
Loading…
Reference in New Issue
Block a user