mirror of
https://github.com/ascribe/onion.git
synced 2024-12-31 09:07:48 +01:00
contract list make public
This commit is contained in:
parent
a87879dd3d
commit
17f7be9257
@ -44,12 +44,8 @@ class ContractListActions {
|
||||
resolve(res);
|
||||
})
|
||||
.catch( (err) => {
|
||||
if(typeof err === 'undefined') {
|
||||
resolve(err);
|
||||
}
|
||||
else{
|
||||
reject(err);
|
||||
}
|
||||
console.logGlobal(err);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -56,8 +56,7 @@ let ContractAgreementForm = React.createClass({
|
||||
},
|
||||
|
||||
getFormData(){
|
||||
return {'appendix': {'default': this.refs.form.refs.appendix.state.value},
|
||||
'contract': this.state.contractList[this.state.selectedContract].id};
|
||||
return {'appendix': {'default': this.refs.form.refs.appendix.state.value}};
|
||||
},
|
||||
|
||||
getContracts() {
|
||||
|
@ -50,12 +50,12 @@ let CreateContractForm = React.createClass({
|
||||
},
|
||||
|
||||
handleCreateSuccess(response) {
|
||||
ContractListActions.fetchContractList();
|
||||
ContractListActions.fetchContractList({is_active: 'True'});
|
||||
let notification = new GlobalNotificationModel(getLangText('Contract %s successfully created', response.name), 'success', 5000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
|
||||
// also refresh contract lists for the rest of the contract settings page
|
||||
ContractListActions.fetchContractList();
|
||||
//
|
||||
//// also refresh contract lists for the rest of the contract settings page
|
||||
//ContractListActions.fetchContractList();
|
||||
},
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ let ContractSettings = React.createClass({
|
||||
|
||||
componentDidMount() {
|
||||
ContractListStore.listen(this.onChange);
|
||||
ContractListActions.fetchContractList();
|
||||
ContractListActions.fetchContractList({is_active: 'True'});
|
||||
},
|
||||
|
||||
componentWillUnmount() {
|
||||
@ -41,22 +41,31 @@ let ContractSettings = React.createClass({
|
||||
return () => {
|
||||
contract.is_public = true;
|
||||
ContractListActions.changeContract(contract)
|
||||
.then(() => ContractListActions.fetchContractList())
|
||||
.then(() => {
|
||||
ContractListActions.fetchContractList({is_active: 'True'});
|
||||
let notification = getLangText('Contract %s is now public', contract.name);
|
||||
notification = new GlobalNotificationModel(notification, 'success', 4000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
})
|
||||
.catch((err) => {
|
||||
let notification = new GlobalNotificationModel(err, 'danger', 10000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
});
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
removeContract(contract) {
|
||||
return () => {
|
||||
ContractListActions.removeContract(contract.id)
|
||||
.then(( ) => ContractListActions.fetchContractList())
|
||||
.then((response) => {
|
||||
ContractListActions.fetchContractList({is_active: 'True'});
|
||||
let notification = new GlobalNotificationModel(response.notification, 'success', 4000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
})
|
||||
.catch((err) => {
|
||||
let notification = new GlobalNotificationModel(err, 'danger', 10000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
});
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -24,7 +24,6 @@ let OwnershipFetcher = {
|
||||
},
|
||||
|
||||
makeContractPublic(contractObj){
|
||||
console.log(ApiUrls.ownership_contract);
|
||||
return requests.put(ApiUrls.ownership_contract, { body: contractObj, contract_id: contractObj.id });
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user