diff --git a/circle.yml b/circle.yml
index 160bc7bb9..6009a88e6 100644
--- a/circle.yml
+++ b/circle.yml
@@ -21,6 +21,8 @@ test:
override:
# Run the tests using the junit reporter.
- MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml NPM_PACKAGE_CONFIG_MOCHA_REPORTER=mocha-junit-reporter npm run test
+ # Run the e2e test suite
+ - npm run e2e
deployment:
release:
diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js
index 507c764d7..bf4ebe3e6 100644
--- a/client/coral-configure/components/ConfigureCommentStream.js
+++ b/client/coral-configure/components/ConfigureCommentStream.js
@@ -7,47 +7,50 @@ import translations from '../translations.json';
const lang = new I18n(translations);
export default ({handleChange, handleApply, changed, ...props}) => (
-
{status === 'open' ? 'Close' : 'Open'} Comment Stream
@@ -89,7 +97,6 @@ const mapDispatchToProps = dispatch => ({
updateConfiguration: newConfig => dispatch(updateConfiguration(newConfig))
});
-export default connect(
- mapStateToProps,
- mapDispatchToProps
+export default compose(
+ connect(mapStateToProps, mapDispatchToProps)
)(ConfigureStreamContainer);
diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js
index f734bce0b..93c89ffb0 100644
--- a/client/coral-embed-stream/src/Comment.js
+++ b/client/coral-embed-stream/src/Comment.js
@@ -26,6 +26,11 @@ class Comment extends React.Component {
}
static propTypes = {
+ reactKey: PropTypes.string.isRequired,
+
+ // id of currently opened ReplyBox. tracked in Stream.js
+ activeReplyBox: PropTypes.string.isRequired,
+ setActiveReplyBox: PropTypes.func.isRequired,
refetch: PropTypes.func.isRequired,
showSignInDialog: PropTypes.func.isRequired,
postAction: PropTypes.func.isRequired,
@@ -60,15 +65,6 @@ class Comment extends React.Component {
}).isRequired
}
- onReplyBoxClick = () => {
- if (this.props.currentUser) {
- this.setState({replyBoxVisible: !this.state.replyBoxVisible});
- } else {
- const offset = document.getElementById(`c_${this.props.comment.id}`).getBoundingClientRect().top - 75;
- this.props.showSignInDialog(offset);
- }
- }
-
render () {
const {
comment,
@@ -81,6 +77,8 @@ class Comment extends React.Component {
addNotification,
showSignInDialog,
postAction,
+ setActiveReplyBox,
+ activeReplyBox,
deleteAction
} = this.props;
@@ -106,7 +104,7 @@ class Comment extends React.Component {
setActiveReplyBox(comment.id)}
parentCommentId={parentId || comment.id}
currentUserId={currentUser && currentUser.id}
banned={false} />
@@ -130,13 +128,13 @@ class Comment extends React.Component {
{
- this.state.replyBoxVisible
+ activeReplyBox === comment.id
?
{
- console.log('replyPostedHandler');
- this.setState({replyBoxVisible: false});
+ setActiveReplyBox('');
refetch();
}}
+ setActiveReplyBox={setActiveReplyBox}
parentId={parentId || comment.id}
addNotification={addNotification}
authorId={currentUser.id}
@@ -149,6 +147,8 @@ class Comment extends React.Component {
comment.replies.map(reply => {
return ;
})
diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js
index 5922266fa..416c7fef8 100644
--- a/client/coral-embed-stream/src/Embed.js
+++ b/client/coral-embed-stream/src/Embed.js
@@ -9,8 +9,8 @@ const {logout, showSignInDialog} = authActions;
const {addNotification, clearNotification} = notificationActions;
const {fetchAssetSuccess} = assetActions;
-import {queryStream} from './graphql/queries';
-import {postComment, postAction, deleteAction} from './graphql/mutations';
+import {queryStream} from 'coral-framework/graphql/queries';
+import {postComment, postAction, deleteAction} from 'coral-framework/graphql/mutations';
import {Notification, notificationActions, authActions, assetActions, pym} from 'coral-framework';
import Stream from './Stream';
@@ -90,9 +90,12 @@ class Embed extends Component {
render () {
const {activeTab} = this.state;
+ const {closedAt} = this.props.asset;
const {loading, asset, refetch} = this.props.data;
const {loggedIn, isAdmin, user, showSignInDialog, signInOffset} = this.props.auth;
+ const openStream = closedAt === null;
+
const expandForLogin = showSignInDialog ? {
minHeight: document.body.scrollHeight + 200
} : {};
@@ -109,7 +112,7 @@ class Embed extends Component {
{loggedIn && }
{
- asset.closedAt === null
+ openStream
?