1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 18:35:09 +01:00

Merge remote-tracking branch 'origin/AD-456-ikonotv-branded-page-for-registra' into AD-456-ikonotv-branded-page-for-registra

This commit is contained in:
diminator 2015-09-28 16:44:37 +02:00
commit 0a0a34b0e3
2 changed files with 20 additions and 7 deletions

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}

View File

@ -17,7 +17,6 @@ import Pagination from './ascribe_pagination/pagination';
import PieceListFilterDisplay from './piece_list_filter_display'; import PieceListFilterDisplay from './piece_list_filter_display';
import GlobalAction from './global_action';
import PieceListBulkModal from './ascribe_piece_list_bulk_modal/piece_list_bulk_modal'; import PieceListBulkModal from './ascribe_piece_list_bulk_modal/piece_list_bulk_modal';
import PieceListToolbar from './ascribe_piece_list_toolbar/piece_list_toolbar'; import PieceListToolbar from './ascribe_piece_list_toolbar/piece_list_toolbar';
@ -76,7 +75,7 @@ let PieceList = React.createClass({
componentDidUpdate() { componentDidUpdate() {
if (this.props.redirectTo && this.state.unfilteredPieceListCount === 0) { if (this.props.redirectTo && this.state.unfilteredPieceListCount === 0) {
// FIXME: hack to redirect out of the dispatch cycle // FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.transitionTo(this.props.redirectTo), 0); window.setTimeout(() => this.transitionTo(this.props.redirectTo, this.getQuery()));
} }
}, },