1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 21:52:08 +02:00

update notification on request action

This commit is contained in:
diminator 2015-09-01 19:14:48 +02:00
parent 71c438ee59
commit bf5d1de635

View File

@ -6,6 +6,8 @@ import AclButton from './../ascribe_buttons/acl_button';
import ActionPanel from '../ascribe_panel/action_panel';
import Form from './form';
import PieceListActions from '../../actions/piece_list_actions';
import GlobalNotificationModel from '../../models/global_notification_model';
import GlobalNotificationActions from '../../actions/global_notification_actions';
@ -71,12 +73,18 @@ let RequestActionForm = React.createClass({
let notification = new GlobalNotificationModel(message, 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
if(this.props.handleSuccess) {
this.props.handleSuccess();
}
this.handleSuccess();
};
},
handleSuccess() {
PieceListActions.fetchPieceRequestActions();
if(this.props.handleSuccess) {
this.props.handleSuccess();
}
},
getContent() {
let pieceOrEditionStr = this.isPiece() ? getLangText('this work%s', '.') : getLangText('this edition%s', '.');
let message = this.props.requestUser + ' ' + getLangText('requests you') + ' ' + this.props.requestAction + ' ' + pieceOrEditionStr;
@ -99,7 +107,7 @@ let RequestActionForm = React.createClass({
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
pieceOrEditions={this.props.pieceOrEditions}
currentUser={this.props.currentUser}
handleSuccess={this.props.handleSuccess} />
handleSuccess={this.handleSuccess} />
);
} else if(this.props.requestAction === 'loan_request') {
return (
@ -110,7 +118,7 @@ let RequestActionForm = React.createClass({
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
pieceOrEditions={this.props.pieceOrEditions}
currentUser={this.props.currentUser}
handleSuccess={this.props.handleSuccess} />
handleSuccess={this.handleSuccess} />
);
} else {
return (