diff --git a/js/actions/contract_agreement_list_actions.js b/js/actions/contract_agreement_list_actions.js index f2959901..52c055a6 100644 --- a/js/actions/contract_agreement_list_actions.js +++ b/js/actions/contract_agreement_list_actions.js @@ -91,12 +91,7 @@ class ContractAgreementListActions { flushContractAgreementList(){ return Q.Promise((resolve, reject) => { - this.actions.updateContractAgreementList(null).then( - resolve() - ).catch((err) => { - console.logGlobal(err); - reject(err); - }); + return this.actions.updateContractAgreementList(null); }); } diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index aa3d81ba..1e69a7ab 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -152,7 +152,7 @@ let Edition = React.createClass({ {return {'bitcoin_id': this.props.edition.bitcoin_id}; }} diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 8642ee05..4f8d8d8d 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -237,7 +237,7 @@ let PieceContainer = React.createClass({ - - - -
- - ); + if (this.props.currentUser && this.props.currentUser.email){ + return ( +
+ + + +
+
+ ); + } + return null; } }); diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index 0c60fd7b..1b37a116 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -79,12 +79,17 @@ let LoanForm = React.createClass({ getContractAgreementsOrCreatePublic(email){ /* a more complex defer (with promises) otherwise we dispatch while an action is being dispatched) */ window.setTimeout(() => { - ContractAgreementListActions.flushContractAgreementList(); + ContractAgreementListActions.flushContractAgreementList() + .catch((err) => { + console.logGlobal(err); + }); if (email) { + // fetch the available contractagreements (pending/accepted) ContractAgreementListActions.fetchAvailableContractAgreementList(email).then( (contractAgreementList) => { if (!contractAgreementList && this.props.createPublicContractAgreement) { + // for public contracts: fetch the public contract and create a contractagreement if available ContractAgreementListActions.createContractAgreementFromPublicContract(email); } } diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js b/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js index 395cd86e..5b605007 100644 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js +++ b/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js @@ -98,7 +98,7 @@ let CylandPieceContainer = React.createClass({
{return {'id': this.state.piece.id}; }} diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js index 8368bd89..9ee94245 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js @@ -97,7 +97,7 @@ let IkonotvPieceContainer = React.createClass({ {return {'id': this.state.piece.id}; }} diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js index cd98a94c..e840173a 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js @@ -62,7 +62,7 @@ let IkonotvArtistDetailsForm = React.createClass({ }, render() { - if(this.props.piece && this.props.piece.id) { + if(this.props.piece && this.props.piece.id && this.props.piece.extra_data) { return (
this.handleConfirmSuccess() ); }, handleConfirmSuccess() { - let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 10000); + let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 5000); GlobalNotificationActions.appendGlobalNotification(notification); this.transitionTo('pieces'); }, handleDeny() { let contractAgreement = this.state.contractAgreementListNotifications[0].contract_agreement; - requests.put(apiUrls.ownership_contract_agreements_deny, {contract_agreement_id: contractAgreement.id}).then( + requests.put(ApiUrls.ownership_contract_agreements_deny, {contract_agreement_id: contractAgreement.id}).then( () => this.handleDenySuccess() ); }, handleDenySuccess() { - let notification = new GlobalNotificationModel(getLangText('You have denied the conditions'), 'success', 10000); + let notification = new GlobalNotificationModel(getLangText('You have denied the conditions'), 'success', 5000); GlobalNotificationActions.appendGlobalNotification(notification); this.transitionTo('pieces'); }, @@ -136,18 +139,19 @@ let IkonotvContractNotifications = React.createClass({ && this.state.currentUser.profile.copyright_association){ return null; } - return ( -
-

{getLangText('Are you a member of any copyright societies?')}

-

- ARS, DACS, Bildkunst, Pictoright, SODRAC, Copyright Agency/Viscopy, SAVA, Bildrecht GmbH, - SABAM, AUTVIS, CREAIMAGEN, SONECA, Copydan, EAU, Kuvasto, GCA, HUNGART, IVARO, SIAE, JASPAR-SPDA, - AKKA/LAA, LATGA-A, SOMAAP, ARTEGESTION, CARIER, BONO, APSAV, SPA, GESTOR, VISaRTA, RAO, LITA, - DALRO, VeGaP, BUS, ProLitteris, AGADU, AUTORARTE, BUBEDRA, BBDA, BCDA, BURIDA, ADAVIS, BSDA -

- -
- ); + if (this.state.currentUser && this.state.currentUser.profile) { + return ( +
+

{getLangText('Are you a member of any copyright societies?')}

+ +

+ {AppConstants.copyrightAssociations.join(', ')} +

+ +
+ ); + } + return null; }, render() {