From 03b6ec4fe444889b69fd9260bea213cb87cfd542 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 5 Dec 2016 19:18:29 -0300 Subject: [PATCH] Lint --- .../coral-embed-stream/src/CommentStream.js | 295 +++++++++--------- client/coral-framework/actions/config.js | 10 +- routes/api/asset/index.js | 10 +- 3 files changed, 155 insertions(+), 160 deletions(-) diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index 1922d3c3d..d46042df8 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -53,7 +53,7 @@ class CommentStream extends Component { } toggleStatus () { - this.props.updateStatus(this.props.config.status === 'open' ? 'closed' : 'open') + this.props.updateStatus(this.props.config.status === 'open' ? 'closed' : 'open'); } static propTypes = { @@ -105,154 +105,153 @@ class CommentStream extends Component { {/* Add to the restricted param a boolean if the user is suspended*/} }> - { - status === 'open' - ?
- - - {!loggedIn && } -
- :

Comments are closed for this thread.

- } - { - rootItem.comments && rootItem.comments.map((commentId) => { - const comment = comments[commentId]; - return
-
- - - -
- + + + {!loggedIn && } +
+ :

Comments are closed for this thread.

+ } + { + rootItem.comments && rootItem.comments.map((commentId) => { + const comment = comments[commentId]; + return
+
+ + + +
+ + +
+
+ + +
+ - -
-
- - -
- - { - comment.children && - comment.children.map((replyId) => { - let reply = this.props.items.comments[replyId]; - return
-
- - - -
- { + let reply = this.props.items.comments[replyId]; + return
+
+ + + +
+ + +
+
+ + +
+ - -
-
- - -
- -
; - }) - } -
; - }) - } - - - - - - -

{status === 'open' ? 'Close' : 'Open'} Comment Stream

- - - -
+
; + }) + } + ; + }) + } + +
+ + + + +

{status === 'open' ? 'Close' : 'Open'} Comment Stream

+ + + +
: - + } ; } } -const CloseCommentsInfo = ({ status, onClick }) => status === 'open' ? ( +const CloseCommentsInfo = ({status, onClick}) => status === 'open' ? (

This comment stream is currently open. By closing this comment stream, @@ -284,7 +283,7 @@ const CloseCommentsInfo = ({ status, onClick }) => status === 'open' ? (

-) +); const mapStateToProps = state => ({ config: state.config.toJS(), diff --git a/client/coral-framework/actions/config.js b/client/coral-framework/actions/config.js index 09b4596a7..6dc880434 100644 --- a/client/coral-framework/actions/config.js +++ b/client/coral-framework/actions/config.js @@ -10,9 +10,9 @@ export const CLOSE_COMMENTS = 'CLOSE_COMMENTS'; export const ADD_ITEM = 'ADD_ITEM'; export const updateOpenStatus = status => (dispatch, getState) => { - const assetId = getState().items.get('assets').keySeq().toArray()[0] + const assetId = getState().items.get('assets') + .keySeq() + .toArray()[0]; return coralApi(`/asset/${assetId}/status?status=${status}`, {method: 'PUT'}) - .then(res => { - dispatch({ type: status === 'open' ? OPEN_COMMENTS : CLOSE_COMMENTS }) - }) -} + .then(() => dispatch({type: status === 'open' ? OPEN_COMMENTS : CLOSE_COMMENTS})); +}; diff --git a/routes/api/asset/index.js b/routes/api/asset/index.js index 30cb98528..05926bc15 100644 --- a/routes/api/asset/index.js +++ b/routes/api/asset/index.js @@ -99,13 +99,9 @@ router.put('/:asset_id/settings', (req, res, next) => { router.put('/:asset_id/status', (req, res, next) => { // Update the asset status Asset - .update({ id: req.params.asset_id }, { status: req.query.status }) - .then((asset) => { - res.status(204).end(); - }) - .catch((err) => { - next(err); - }); + .update({id: req.params.asset_id}, {status: req.query.status}) + .then(() => res.status(204).end()) + .catch((err) => next(err)); }); module.exports = router;