mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
update notification on request action
This commit is contained in:
parent
71c438ee59
commit
bf5d1de635
@ -6,6 +6,8 @@ import AclButton from './../ascribe_buttons/acl_button';
|
|||||||
import ActionPanel from '../ascribe_panel/action_panel';
|
import ActionPanel from '../ascribe_panel/action_panel';
|
||||||
import Form from './form';
|
import Form from './form';
|
||||||
|
|
||||||
|
import PieceListActions from '../../actions/piece_list_actions';
|
||||||
|
|
||||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
import GlobalNotificationModel from '../../models/global_notification_model';
|
||||||
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
||||||
|
|
||||||
@ -71,12 +73,18 @@ let RequestActionForm = React.createClass({
|
|||||||
let notification = new GlobalNotificationModel(message, 'success');
|
let notification = new GlobalNotificationModel(message, 'success');
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
|
|
||||||
if(this.props.handleSuccess) {
|
this.handleSuccess();
|
||||||
this.props.handleSuccess();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleSuccess() {
|
||||||
|
PieceListActions.fetchPieceRequestActions();
|
||||||
|
if(this.props.handleSuccess) {
|
||||||
|
this.props.handleSuccess();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getContent() {
|
getContent() {
|
||||||
let pieceOrEditionStr = this.isPiece() ? getLangText('this work%s', '.') : getLangText('this edition%s', '.');
|
let pieceOrEditionStr = this.isPiece() ? getLangText('this work%s', '.') : getLangText('this edition%s', '.');
|
||||||
let message = this.props.requestUser + ' ' + getLangText('requests you') + ' ' + this.props.requestAction + ' ' + pieceOrEditionStr;
|
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'
|
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
|
||||||
pieceOrEditions={this.props.pieceOrEditions}
|
pieceOrEditions={this.props.pieceOrEditions}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess} />
|
handleSuccess={this.handleSuccess} />
|
||||||
);
|
);
|
||||||
} else if(this.props.requestAction === 'loan_request') {
|
} else if(this.props.requestAction === 'loan_request') {
|
||||||
return (
|
return (
|
||||||
@ -110,7 +118,7 @@ let RequestActionForm = React.createClass({
|
|||||||
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
|
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
|
||||||
pieceOrEditions={this.props.pieceOrEditions}
|
pieceOrEditions={this.props.pieceOrEditions}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess} />
|
handleSuccess={this.handleSuccess} />
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user