1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

refresh piece list on every major acl action

This commit is contained in:
Tim Daubenschütz 2015-09-28 16:32:59 +02:00
parent 3ae362ac15
commit 9045b9ec01

View File

@ -88,10 +88,8 @@ let Edition = React.createClass({
}, },
handleDeleteSuccess(response) { handleDeleteSuccess(response) {
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.refreshCollection();
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
EditionListActions.refreshEditionList({pieceId: this.props.edition.parent});
EditionListActions.closeAllEditionLists(); EditionListActions.closeAllEditionLists();
EditionListActions.clearAllEditionSelections(); EditionListActions.clearAllEditionSelections();
@ -101,6 +99,13 @@ let Edition = React.createClass({
this.transitionTo('pieces'); this.transitionTo('pieces');
}, },
refreshCollection() {
console.log('freshing');
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
EditionListActions.refreshEditionList({pieceId: this.props.edition.parent});
},
render() { render() {
return ( return (
<Row> <Row>
@ -118,6 +123,7 @@ let Edition = React.createClass({
</div> </div>
<EditionSummary <EditionSummary
handleSuccess={this.props.loadEdition} handleSuccess={this.props.loadEdition}
refreshCollection={this.refreshCollection}
currentUser={this.state.currentUser} currentUser={this.state.currentUser}
edition={this.props.edition} edition={this.props.edition}
handleDeleteSuccess={this.handleDeleteSuccess}/> handleDeleteSuccess={this.handleDeleteSuccess}/>
@ -206,14 +212,22 @@ let EditionSummary = React.createClass({
edition: React.PropTypes.object, edition: React.PropTypes.object,
handleSuccess: React.PropTypes.func, handleSuccess: React.PropTypes.func,
currentUser: React.PropTypes.object, currentUser: React.PropTypes.object,
handleDeleteSuccess: React.PropTypes.func handleDeleteSuccess: React.PropTypes.func,
refreshCollection: React.PropTypes.func
}, },
getTransferWithdrawData(){ getTransferWithdrawData(){
return {'bitcoin_id': this.props.edition.bitcoin_id}; return {'bitcoin_id': this.props.edition.bitcoin_id};
}, },
handleSuccess() {
this.props.refreshCollection();
this.props.handleSuccess();
},
showNotification(response){ showNotification(response){
this.props.handleSuccess(); this.props.handleSuccess();
if (response){ if (response){
let notification = new GlobalNotificationModel(response.notification, 'success'); let notification = new GlobalNotificationModel(response.notification, 'success');
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
@ -278,7 +292,7 @@ let EditionSummary = React.createClass({
className="text-center ascribe-button-list" className="text-center ascribe-button-list"
availableAcls={this.props.edition.acl} availableAcls={this.props.edition.acl}
editions={[this.props.edition]} editions={[this.props.edition]}
handleSuccess={this.props.handleSuccess}> handleSuccess={this.handleSuccess}>
{withdrawButton} {withdrawButton}
<DeleteButton <DeleteButton
handleSuccess={this.props.handleDeleteSuccess} handleSuccess={this.props.handleDeleteSuccess}