mirror of
https://github.com/ascribe/onion.git
synced 2025-01-05 11:25:09 +01:00
Integrate new ACLOptions into settings
This commit is contained in:
parent
2a4bc2af89
commit
74e7c9a3d9
@ -89,9 +89,6 @@ let ContractSettings = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-container">
|
<div className="settings-container">
|
||||||
<AclProxy
|
|
||||||
aclName="acl_view_settings_contract"
|
|
||||||
aclObject={this.state.currentUser.acl}>
|
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Contracts')}
|
title={getLangText('Contracts')}
|
||||||
show={true}
|
show={true}
|
||||||
@ -168,7 +165,6 @@ let ContractSettings = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</AclProxy>
|
</AclProxy>
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
</AclProxy>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,17 @@ import Router from 'react-router';
|
|||||||
import UserStore from '../../stores/user_store';
|
import UserStore from '../../stores/user_store';
|
||||||
import UserActions from '../../actions/user_actions';
|
import UserActions from '../../actions/user_actions';
|
||||||
|
|
||||||
|
import WhitelabelStore from '../../stores/whitelabel_store';
|
||||||
|
import WhitelabelActions from '../../actions/whitelabel_actions';
|
||||||
|
|
||||||
import AccountSettings from './account_settings';
|
import AccountSettings from './account_settings';
|
||||||
import BitcoinWalletSettings from './bitcoin_wallet_settings';
|
import BitcoinWalletSettings from './bitcoin_wallet_settings';
|
||||||
import ContractSettings from './contract_settings';
|
|
||||||
import APISettings from './api_settings';
|
import APISettings from './api_settings';
|
||||||
|
|
||||||
|
import AclProxy from '../acl_proxy';
|
||||||
|
|
||||||
|
import { mergeOptions } from '../../utils/general_utils';
|
||||||
|
|
||||||
|
|
||||||
let SettingsContainer = React.createClass({
|
let SettingsContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
@ -22,15 +28,22 @@ let SettingsContainer = React.createClass({
|
|||||||
mixins: [Router.Navigation],
|
mixins: [Router.Navigation],
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return UserStore.getState();
|
return mergeOptions(
|
||||||
|
UserStore.getState(),
|
||||||
|
WhitelabelStore.getState()
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
|
WhitelabelStore.listen(this.onChange);
|
||||||
|
|
||||||
|
WhitelabelActions.fetchWhitelabel();
|
||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser();
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
WhitelabelStore.unlisten(this.onChange);
|
||||||
UserStore.unlisten(this.onChange);
|
UserStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -48,8 +61,16 @@ let SettingsContainer = React.createClass({
|
|||||||
<div className="settings-container">
|
<div className="settings-container">
|
||||||
<AccountSettings currentUser={this.state.currentUser} loadUser={this.loadUser}/>
|
<AccountSettings currentUser={this.state.currentUser} loadUser={this.loadUser}/>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
|
<AclProxy
|
||||||
|
aclObject={this.state.whitelabel}
|
||||||
|
aclName="acl_view_settings_api">
|
||||||
<APISettings />
|
<APISettings />
|
||||||
|
</AclProxy>
|
||||||
|
<AclProxy
|
||||||
|
aclObject={this.state.whitelabel}
|
||||||
|
aclName="acl_view_settings_bitcoin">
|
||||||
<BitcoinWalletSettings />
|
<BitcoinWalletSettings />
|
||||||
|
</AclProxy>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ let Header = React.createClass({
|
|||||||
{getLangText('Account Settings')}
|
{getLangText('Account Settings')}
|
||||||
</MenuItemLink>
|
</MenuItemLink>
|
||||||
<AclProxy
|
<AclProxy
|
||||||
aclObject={this.state.whitelabel}
|
aclObject={this.state.currentUser.acl}
|
||||||
aclName="acl_view_settings_contract">
|
aclName="acl_view_settings_contract">
|
||||||
<MenuItemLink
|
<MenuItemLink
|
||||||
to="contract_settings"
|
to="contract_settings"
|
||||||
|
Loading…
Reference in New Issue
Block a user