mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 13:41:57 +02:00
PR comments fix
This commit is contained in:
parent
5c2ec3ffb0
commit
63fffc2132
|
@ -91,12 +91,7 @@ class ContractAgreementListActions {
|
||||||
|
|
||||||
flushContractAgreementList(){
|
flushContractAgreementList(){
|
||||||
return Q.Promise((resolve, reject) => {
|
return Q.Promise((resolve, reject) => {
|
||||||
this.actions.updateContractAgreementList(null).then(
|
return this.actions.updateContractAgreementList(null);
|
||||||
resolve()
|
|
||||||
).catch((err) => {
|
|
||||||
console.logGlobal(err);
|
|
||||||
reject(err);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ let Edition = React.createClass({
|
||||||
|
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title="Notes"
|
title="Notes"
|
||||||
show={(this.state.currentUser.username && true || false) ||
|
show={(!!this.state.currentUser.username) ||
|
||||||
(this.props.edition.acl.acl_edit || this.props.edition.public_note)}>
|
(this.props.edition.acl.acl_edit || this.props.edition.public_note)}>
|
||||||
<Note
|
<Note
|
||||||
id={() => {return {'bitcoin_id': this.props.edition.bitcoin_id}; }}
|
id={() => {return {'bitcoin_id': this.props.edition.bitcoin_id}; }}
|
||||||
|
|
|
@ -237,7 +237,7 @@ let PieceContainer = React.createClass({
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Notes')}
|
title={getLangText('Notes')}
|
||||||
show={(this.state.currentUser.username && true || false) ||
|
show={(!!this.state.currentUser.username) ||
|
||||||
(this.state.piece.public_note)}>
|
(this.state.piece.public_note)}>
|
||||||
<Note
|
<Note
|
||||||
id={this.getId}
|
id={this.getId}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import GlobalNotificationActions from '../../actions/global_notification_actions
|
||||||
import Form from './form';
|
import Form from './form';
|
||||||
import Property from './property';
|
import Property from './property';
|
||||||
|
|
||||||
import apiUrls from '../../constants/api_urls';
|
import ApiUrls from '../../constants/api_urls';
|
||||||
import appConstants from '../../constants/application_constants';
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
|
@ -25,10 +25,7 @@ let CopyrightAssociationForm = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
getProfileFormData(){
|
getProfileFormData(){
|
||||||
if (this.props.currentUser && this.props.currentUser.email){
|
return {email: this.props.currentUser.email};
|
||||||
return {email: this.props.currentUser.email};
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -36,39 +33,42 @@ let CopyrightAssociationForm = React.createClass({
|
||||||
if (this.props.currentUser
|
if (this.props.currentUser
|
||||||
&& this.props.currentUser.profile
|
&& this.props.currentUser.profile
|
||||||
&& this.props.currentUser.profile.copyright_association) {
|
&& this.props.currentUser.profile.copyright_association) {
|
||||||
selectedState = appConstants.copyrightAssociations.indexOf(this.props.currentUser.profile.copyright_association);
|
selectedState = AppConstants.copyrightAssociations.indexOf(this.props.currentUser.profile.copyright_association);
|
||||||
}
|
}
|
||||||
return (
|
if (this.props.currentUser && this.props.currentUser.email){
|
||||||
<Form
|
return (
|
||||||
ref='form'
|
<Form
|
||||||
url={apiUrls.users_profile}
|
ref='form'
|
||||||
getFormData={this.getProfileFormData}
|
url={ApiUrls.users_profile}
|
||||||
handleSuccess={this.handleSubmitSuccess}>
|
getFormData={this.getProfileFormData}
|
||||||
<Property
|
handleSuccess={this.handleSubmitSuccess}>
|
||||||
name="copyright_association"
|
<Property
|
||||||
className="ascribe-settings-property-collapsible-toggle"
|
name="copyright_association"
|
||||||
label={getLangText('Copyright Association')}
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
style={{paddingBottom: 0}}>
|
label={getLangText('Copyright Association')}
|
||||||
<select name="contract">
|
style={{paddingBottom: 0}}>
|
||||||
<option disabled selected={selectedState === -1}>
|
<select name="contract">
|
||||||
{getLangText(' -- select an association -- ')}
|
<option disabled selected={selectedState === -1}>
|
||||||
</option>
|
{getLangText(' -- select an association -- ')}
|
||||||
{appConstants.copyrightAssociations.map((association, i) => {
|
</option>
|
||||||
return (
|
{AppConstants.copyrightAssociations.map((association, i) => {
|
||||||
<option
|
return (
|
||||||
name={i}
|
<option
|
||||||
key={i}
|
name={i}
|
||||||
value={ association }
|
key={i}
|
||||||
selected={selectedState === i}>
|
value={ association }
|
||||||
{ association }
|
selected={selectedState === i}>
|
||||||
</option>
|
{ association }
|
||||||
);
|
</option>
|
||||||
})}
|
);
|
||||||
</select>
|
})}
|
||||||
</Property>
|
</select>
|
||||||
<hr />
|
</Property>
|
||||||
</Form>
|
<hr />
|
||||||
);
|
</Form>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -79,12 +79,17 @@ let LoanForm = React.createClass({
|
||||||
getContractAgreementsOrCreatePublic(email){
|
getContractAgreementsOrCreatePublic(email){
|
||||||
/* a more complex defer (with promises) otherwise we dispatch while an action is being dispatched) */
|
/* a more complex defer (with promises) otherwise we dispatch while an action is being dispatched) */
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
ContractAgreementListActions.flushContractAgreementList();
|
ContractAgreementListActions.flushContractAgreementList()
|
||||||
|
.catch((err) => {
|
||||||
|
console.logGlobal(err);
|
||||||
|
});
|
||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
|
// fetch the available contractagreements (pending/accepted)
|
||||||
ContractAgreementListActions.fetchAvailableContractAgreementList(email).then(
|
ContractAgreementListActions.fetchAvailableContractAgreementList(email).then(
|
||||||
(contractAgreementList) => {
|
(contractAgreementList) => {
|
||||||
if (!contractAgreementList && this.props.createPublicContractAgreement) {
|
if (!contractAgreementList && this.props.createPublicContractAgreement) {
|
||||||
|
// for public contracts: fetch the public contract and create a contractagreement if available
|
||||||
ContractAgreementListActions.createContractAgreementFromPublicContract(email);
|
ContractAgreementListActions.createContractAgreementFromPublicContract(email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ let CylandPieceContainer = React.createClass({
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Notes')}
|
title={getLangText('Notes')}
|
||||||
show={(this.state.currentUser.username && true || false) ||
|
show={(!!this.state.currentUser.username) ||
|
||||||
(this.state.piece.public_note)}>
|
(this.state.piece.public_note)}>
|
||||||
<Note
|
<Note
|
||||||
id={() => {return {'id': this.state.piece.id}; }}
|
id={() => {return {'id': this.state.piece.id}; }}
|
||||||
|
|
|
@ -97,7 +97,7 @@ let IkonotvPieceContainer = React.createClass({
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Notes')}
|
title={getLangText('Notes')}
|
||||||
show={(this.state.currentUser.username && true || false) ||
|
show={(!!this.state.currentUser.username) ||
|
||||||
(this.state.piece.public_note)}>
|
(this.state.piece.public_note)}>
|
||||||
<Note
|
<Note
|
||||||
id={() => {return {'id': this.state.piece.id}; }}
|
id={() => {return {'id': this.state.piece.id}; }}
|
||||||
|
|
|
@ -62,7 +62,7 @@ let IkonotvArtistDetailsForm = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if(this.props.piece && this.props.piece.id) {
|
if(this.props.piece && this.props.piece.id && this.props.piece.extra_data) {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
|
|
|
@ -7,8 +7,6 @@ import Property from '../../../../../ascribe_forms/property';
|
||||||
|
|
||||||
import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_toggable';
|
import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_toggable';
|
||||||
|
|
||||||
//import FurtherDetailsFileuploader from '../../../../../ascribe_detail/further_details_fileuploader';
|
|
||||||
|
|
||||||
import ApiUrls from '../../../../../../constants/api_urls';
|
import ApiUrls from '../../../../../../constants/api_urls';
|
||||||
import AppConstants from '../../../../../../constants/application_constants';
|
import AppConstants from '../../../../../../constants/application_constants';
|
||||||
|
|
||||||
|
@ -62,7 +60,7 @@ let IkonotvArtworkDetailsForm = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if(this.props.piece && this.props.piece.id) {
|
if(this.props.piece && this.props.piece.id && this.props.piece.extra_data) {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import Button from 'react-bootstrap/lib/Button';
|
||||||
import NotificationActions from '../../../../../actions/notification_actions';
|
import NotificationActions from '../../../../../actions/notification_actions';
|
||||||
import NotificationStore from '../../../../../stores/notification_store';
|
import NotificationStore from '../../../../../stores/notification_store';
|
||||||
|
|
||||||
|
import UserActions from '../../../../../actions/user_actions';
|
||||||
import UserStore from '../../../../../stores/user_store';
|
import UserStore from '../../../../../stores/user_store';
|
||||||
|
|
||||||
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
||||||
|
@ -19,7 +20,8 @@ import GlobalNotificationActions from '../../../../../actions/global_notificatio
|
||||||
|
|
||||||
import CopyrightAssociationForm from '../../../../ascribe_forms/form_copyright_association';
|
import CopyrightAssociationForm from '../../../../ascribe_forms/form_copyright_association';
|
||||||
|
|
||||||
import apiUrls from '../../../../../constants/api_urls';
|
import AppConstants from '../../../../../constants/application_constants';
|
||||||
|
import ApiUrls from '../../../../../constants/api_urls';
|
||||||
|
|
||||||
import requests from '../../../../../utils/requests';
|
import requests from '../../../../../utils/requests';
|
||||||
import { getLangText } from '../../../../../utils/lang_utils';
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
|
@ -42,6 +44,7 @@ let IkonotvContractNotifications = React.createClass({
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
NotificationStore.listen(this.onChange);
|
NotificationStore.listen(this.onChange);
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
|
UserActions.fetchCurrentUser();
|
||||||
WhitelabelStore.listen(this.onChange);
|
WhitelabelStore.listen(this.onChange);
|
||||||
WhitelabelActions.fetchWhitelabel();
|
WhitelabelActions.fetchWhitelabel();
|
||||||
if (this.state.contractAgreementListNotifications === null){
|
if (this.state.contractAgreementListNotifications === null){
|
||||||
|
@ -107,26 +110,26 @@ let IkonotvContractNotifications = React.createClass({
|
||||||
|
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
let contractAgreement = this.state.contractAgreementListNotifications[0].contract_agreement;
|
let contractAgreement = this.state.contractAgreementListNotifications[0].contract_agreement;
|
||||||
requests.put(apiUrls.ownership_contract_agreements_confirm, {contract_agreement_id: contractAgreement.id}).then(
|
requests.put(ApiUrls.ownership_contract_agreements_confirm, {contract_agreement_id: contractAgreement.id}).then(
|
||||||
() => this.handleConfirmSuccess()
|
() => this.handleConfirmSuccess()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
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);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
this.transitionTo('pieces');
|
this.transitionTo('pieces');
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDeny() {
|
handleDeny() {
|
||||||
let contractAgreement = this.state.contractAgreementListNotifications[0].contract_agreement;
|
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()
|
() => this.handleDenySuccess()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
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);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
this.transitionTo('pieces');
|
this.transitionTo('pieces');
|
||||||
},
|
},
|
||||||
|
@ -136,18 +139,19 @@ let IkonotvContractNotifications = React.createClass({
|
||||||
&& this.state.currentUser.profile.copyright_association){
|
&& this.state.currentUser.profile.copyright_association){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
if (this.state.currentUser && this.state.currentUser.profile) {
|
||||||
<div className='notification-contract-footer'>
|
return (
|
||||||
<h1>{getLangText('Are you a member of any copyright societies?')}</h1>
|
<div className='notification-contract-footer'>
|
||||||
<p>
|
<h1>{getLangText('Are you a member of any copyright societies?')}</h1>
|
||||||
ARS, DACS, Bildkunst, Pictoright, SODRAC, Copyright Agency/Viscopy, SAVA, Bildrecht GmbH,
|
|
||||||
SABAM, AUTVIS, CREAIMAGEN, SONECA, Copydan, EAU, Kuvasto, GCA, HUNGART, IVARO, SIAE, JASPAR-SPDA,
|
<p>
|
||||||
AKKA/LAA, LATGA-A, SOMAAP, ARTEGESTION, CARIER, BONO, APSAV, SPA, GESTOR, VISaRTA, RAO, LITA,
|
{AppConstants.copyrightAssociations.join(', ')}
|
||||||
DALRO, VeGaP, BUS, ProLitteris, AGADU, AUTORARTE, BUBEDRA, BBDA, BCDA, BURIDA, ADAVIS, BSDA
|
</p>
|
||||||
</p>
|
<CopyrightAssociationForm currentUser={this.state.currentUser}/>
|
||||||
<CopyrightAssociationForm currentUser={this.state.currentUser} />
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
}
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user