From f1e90795f07aeb55e0e9eb5c17af3062bc6d12c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 15 Jul 2015 01:40:48 +0200 Subject: [PATCH] specify editions generically by whitelabel --- js/components/acl_proxy.js | 2 +- js/components/register_piece.js | 10 ++++++++-- .../prize/components/register_piece.js | 3 +-- js/constants/languages.js | 18 +++++++++++++++--- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/js/components/acl_proxy.js b/js/components/acl_proxy.js index f2d5b427..a04e499d 100644 --- a/js/components/acl_proxy.js +++ b/js/components/acl_proxy.js @@ -37,7 +37,7 @@ let AclProxy = React.createClass({ ); } else { if(typeof this.props.aclObject[this.props.aclName] === 'undefined') { - console.warn('The aclName you\'re filtering for was not present (undefined) in the aclObject.'); + console.warn('The aclName you\'re filtering for was not present (or undefined) in the aclObject.'); } return null; } diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 16687eb4..e5f36c8e 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -9,6 +9,9 @@ import Row from 'react-bootstrap/lib/Row'; import LicenseActions from '../actions/license_actions'; import LicenseStore from '../stores/license_store'; +import WhitelabelActions from '../actions/whitelabel_actions'; +import WhitelabelStore from '../stores/whitelabel_store'; + import PieceListStore from '../stores/piece_list_store'; import PieceListActions from '../actions/piece_list_actions'; @@ -35,7 +38,6 @@ let RegisterPiece = React.createClass( { propTypes: { headerMessage: React.PropTypes.string, submitMessage: React.PropTypes.string, - canSpecifyEditions: React.PropTypes.bool, children: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.element]) @@ -53,6 +55,7 @@ let RegisterPiece = React.createClass( { return mergeOptions( LicenseStore.getState(), UserStore.getState(), + WhitelabelStore.getState(), PieceListStore.getState(), { selectedLicense: 0, @@ -62,15 +65,18 @@ let RegisterPiece = React.createClass( { componentDidMount() { LicenseActions.fetchLicense(); + WhitelabelActions.fetchWhitelabel(); LicenseStore.listen(this.onChange); PieceListStore.listen(this.onChange); UserStore.listen(this.onChange); + WhitelabelStore.listen(this.onChange); }, componentWillUnmount() { LicenseStore.unlisten(this.onChange); PieceListStore.unlisten(this.onChange); UserStore.unlisten(this.onChange); + WhitelabelStore.unlisten(this.onChange); }, onChange(state) { @@ -136,7 +142,7 @@ let RegisterPiece = React.createClass( { }, getSpecifyEditions() { - if (this.props.canSpecifyEditions) { + if (this.state.whitelabel.acl_editions) { return ( + submitMessage={getLangText('Submit')}>