mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Merge remote-tracking branch 'origin/AD-43-in-piece_detail-add-generic-field-' into AD-43-in-piece_detail-add-generic-field-
This commit is contained in:
commit
5f8abcffd2
@ -15,7 +15,7 @@ class UserActions {
|
||||
this.actions.updateCurrentUser(res['users'][0]);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -14,41 +14,44 @@ let AclButtonList = React.createClass({
|
||||
this.setState(state);
|
||||
},
|
||||
|
||||
componentWillMount() {
|
||||
UserActions.fetchCurrentUser();
|
||||
componentDidMount() {
|
||||
UserStore.listen(this.onChange);
|
||||
UserActions.fetchCurrentUser();
|
||||
},
|
||||
|
||||
componentDidUnmount() {
|
||||
UserStore.unlisten(this.onChange);
|
||||
},
|
||||
|
||||
render() {
|
||||
return (<div className="text-center">
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="transfer"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="consign"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="loan"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="share"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
</div>)
|
||||
return (
|
||||
<div className="text-center">
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="transfer"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="consign"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="loan"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
<AclButton
|
||||
availableAcls={this.props.availableAcls}
|
||||
action="share"
|
||||
editions={this.props.editions}
|
||||
currentUser={this.state.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,6 @@ let ResourceViewer = React.createClass({
|
||||
mixins: [InjectInHeadMixin],
|
||||
|
||||
componentDidMount() {
|
||||
this.inject('http://antani.com');
|
||||
},
|
||||
|
||||
render() {
|
||||
|
@ -19,8 +19,7 @@ let ModalWrapper = React.createClass({
|
||||
title={this.props.title}
|
||||
editions={this.props.editions}
|
||||
currentUser={this.props.currentUser}
|
||||
handleSuccess={this.props.handleSuccess}
|
||||
>
|
||||
handleSuccess={this.props.handleSuccess}>
|
||||
{this.props.children}
|
||||
</ModalBody>
|
||||
}>
|
||||
|
@ -22,8 +22,12 @@ let Header = React.createClass({
|
||||
},
|
||||
|
||||
componentDidMount() {
|
||||
UserStore.listen(this.onChange)
|
||||
UserActions.fetchCurrentUser();
|
||||
UserStore.listen(this.onChange)
|
||||
},
|
||||
|
||||
componentDidUnmount() {
|
||||
UserStore.unlisten(this.onChange)
|
||||
},
|
||||
|
||||
onChange(state) {
|
||||
@ -40,7 +44,7 @@ let Header = React.createClass({
|
||||
</a>
|
||||
</Nav>
|
||||
<Nav right>
|
||||
<DropdownButton eventKey={3} title={this.state.currentUser.username}>
|
||||
<DropdownButton eventKey="1" title={this.state.currentUser.username}>
|
||||
<MenuItem eventKey="1" href="/art/account_settings/">{getLangText('Account Settings')}</MenuItem>
|
||||
<li className="divider"></li>
|
||||
<MenuItem eventKey="2" href="/art/faq/">{getLangText('FAQ')}</MenuItem>
|
||||
|
@ -7,8 +7,8 @@ import AlertDismissable from '../components/ascribe_forms/alert'
|
||||
export const FormMixin = {
|
||||
getInitialState() {
|
||||
return {
|
||||
submitted: false
|
||||
, errors: []
|
||||
submitted: false,
|
||||
errors: []
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import alt from '../alt';
|
||||
import UserAction from '../actions/user_actions';
|
||||
import UserActions from '../actions/user_actions';
|
||||
|
||||
|
||||
class UserStore{
|
||||
class UserStore {
|
||||
constructor() {
|
||||
this.currentUser = {};
|
||||
this.bindActions(UserAction);
|
||||
this.bindActions(UserActions);
|
||||
}
|
||||
|
||||
onUpdateCurrentUser(user) {
|
||||
|
Loading…
Reference in New Issue
Block a user