From ce46f7c88699c5178dfdcff0705a5c062edc48c3 Mon Sep 17 00:00:00 2001 From: vrde Date: Tue, 14 Jul 2015 18:00:34 +0200 Subject: [PATCH 01/18] Fix bug in whitelabel landing page --- js/components/whitelabel/prize/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/whitelabel/prize/routes.js b/js/components/whitelabel/prize/routes.js index fd4c6edb..912147ac 100644 --- a/js/components/whitelabel/prize/routes.js +++ b/js/components/whitelabel/prize/routes.js @@ -22,7 +22,7 @@ let baseUrl = AppConstants.baseUrl; function getRoutes(commonRoutes) { return ( - + From e49b92031805eaa73294572f36ca0abb53d88180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 14 Jul 2015 18:34:46 +0200 Subject: [PATCH 02/18] more styling on the landing page --- index.html | 3 +++ .../whitelabel/prize/components/hero.js | 3 +-- .../whitelabel/prize/components/landing.js | 12 ++++++++++-- .../prize/components/login_container.js | 2 +- sass/whitelabel/prize/landing.scss | 18 +++++++++++++++++- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 4e3124f4..0893168d 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,9 @@ + + + + + diff --git a/js/components/header.js b/js/components/header.js index 3b9dc7a3..bcf71ff5 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -58,6 +58,8 @@ let Header = React.createClass({ handleLogout(){ UserActions.logoutCurrentUser(); Alt.flush(); + // kill intercom (with fire) + window.Intercom('shutdown'); this.transitionTo('login'); }, @@ -89,6 +91,17 @@ let Header = React.createClass({ }, onChange(state) { this.setState(state); + + if(this.state.currentUser && this.state.currentUser.email) { + // bootup intercom if the user is logged in + window.Intercom('boot', { + app_id: 'oboxh5w1', + email: this.state.currentUser.email, + widget: { + activator: '#IntercomDefaultWidget' + } + }); + } }, render() { From 8f386dc0cf870b4b618fb154b8b7508acb199ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 14 Jul 2015 22:34:34 +0200 Subject: [PATCH 17/18] adjust acl proxy --- js/components/acl_proxy.js | 21 ++++++++++++----- .../accordion_list_item.js | 17 ++++++++++++++ .../ascribe_buttons/submit_to_prize_button.js | 23 +++++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 js/components/ascribe_buttons/submit_to_prize_button.js diff --git a/js/components/acl_proxy.js b/js/components/acl_proxy.js index c6e7b0a9..5b328b3e 100644 --- a/js/components/acl_proxy.js +++ b/js/components/acl_proxy.js @@ -15,22 +15,31 @@ let AclProxy = React.createClass({ React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.element ]).isRequired, - aclObject: React.PropTypes.object.isRequired, - aclName: React.PropTypes.string.isRequired + aclObject: React.PropTypes.object, + aclName: React.PropTypes.string, + show: React.PropTypes.bool }, render() { - if(this.props.aclObject[this.props.aclName]) { + if(this.props.show) { return ( {this.props.children} ); } 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.'); + if(this.props.aclObject[this.props.aclName]) { + return ( + + {this.props.children} + + ); + } 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.'); + } + return null; } - return null; } } }); diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index a5537b51..1f5d9ff8 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -16,6 +16,9 @@ import EditionListActions from '../../actions/edition_list_actions'; import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; +import AclProxy from '../acl_proxy'; +import SubmitToPrizeButton from '../ascribe_buttons/submit_to_prize_button'; + import { getLangText } from '../../utils/lang_utils'; let Link = Router.Link; @@ -125,6 +128,20 @@ let AccordionListItem = React.createClass({ piece={this.props.content} toggleCreateEditionsDialog={this.toggleCreateEditionsDialog} onPollingSuccess={this.onPollingSuccess}/> + + + + + + diff --git a/js/components/ascribe_buttons/submit_to_prize_button.js b/js/components/ascribe_buttons/submit_to_prize_button.js new file mode 100644 index 00000000..62b9995f --- /dev/null +++ b/js/components/ascribe_buttons/submit_to_prize_button.js @@ -0,0 +1,23 @@ +'use strict'; + +import React from 'react'; +import classNames from 'classnames'; + +import { getLangText } from '../../utils/lang_utils'; + +let SubmitToPrizeButton = React.createClass({ + propTypes: { + className: React.PropTypes.string + }, + + render() { + return ( + + ); + } +}); + +export default SubmitToPrizeButton; \ No newline at end of file From aec1ff2173253b47c3cf8c0d1e804ffa7f5f8dff Mon Sep 17 00:00:00 2001 From: vrde Date: Tue, 14 Jul 2015 22:50:48 +0200 Subject: [PATCH 18/18] Fix acl proxy --- js/components/acl_proxy.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/js/components/acl_proxy.js b/js/components/acl_proxy.js index 5b328b3e..f2d5b427 100644 --- a/js/components/acl_proxy.js +++ b/js/components/acl_proxy.js @@ -28,20 +28,23 @@ let AclProxy = React.createClass({ ); } else { - if(this.props.aclObject[this.props.aclName]) { - return ( - - {this.props.children} - - ); - } 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.'); + if(this.props.aclObject) { + if(this.props.aclObject[this.props.aclName]) { + return ( + + {this.props.children} + + ); + } 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.'); + } + return null; } - return null; } } + return null; } }); -export default AclProxy; \ No newline at end of file +export default AclProxy;