From 4e060b884b3243a22888c19a0a346837643bb4d5 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 21 Apr 2017 12:12:29 -0600 Subject: [PATCH 1/3] Fixed bug with status changes in the graph --- graph/mutators/comment.js | 4 ++-- services/comments.js | 31 +++++++++---------------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index 982f7ade7..5cfc23794 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -180,9 +180,9 @@ const createPublicComment = (context, commentInput) => { * @param {String} status the new status of the comment */ -const setCommentStatus = ({loaders: {Comments}}, {id, status}) => { +const setCommentStatus = ({user, loaders: {Comments}}, {id, status}) => { return CommentsService - .setStatus(id, status) + .pushStatus(id, status, user ? user.id : null) .then((comment) => { // If the loaders are present, clear the caches for these values because we diff --git a/services/comments.js b/services/comments.js index 7e9cca20f..d77118705 100644 --- a/services/comments.js +++ b/services/comments.js @@ -213,7 +213,15 @@ module.exports = class CommentsService { * @return {Promise} */ static pushStatus(id, status, assigned_by = null) { - return CommentModel.update({id}, { + + // Check to see if the comment status is in the allowable set of statuses. + if (STATUSES.indexOf(status) === -1) { + + // Comment status is not supported! Error out here. + return Promise.reject(new Error(`status ${status} is not supported`)); + } + + return CommentModel.findOneAndUpdate({id}, { $push: { status_history: { type: status, @@ -292,25 +300,4 @@ module.exports = class CommentsService { return CommentModel.find(query); } - - /** - * Sets Comment Status - * @param {String} id identifier of the comment (uuid) - * @param {String} status the new status of the comment - * @return {Promise} - */ - - static setStatus(id, status) { - - // Check to see if the comment status is in the allowable set of statuses. - if (STATUSES.indexOf(status) === -1) { - - // Comment status is not supported! Error out here. - return Promise.reject(new Error(`status ${status} is not supported`)); - } - - return CommentModel.findOneAndUpdate({id}, { - $set: {status} - }); - } }; From c60cfebde73ec4f43bcadba4a7947e4686eeb7b9 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Mon, 24 Apr 2017 10:19:36 -0600 Subject: [PATCH 2/3] add some styles so mobile doesn't zoom the text box --- client/coral-embed-stream/style/default.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 13a200690..bf044172d 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -194,7 +194,8 @@ hr { padding: 5px; min-height: 100px; margin-top: 10px; - font-size: 14px; + font-size: 16px; + border: 1px solid #ccc; } .coral-plugin-commentbox-button-container { @@ -278,13 +279,13 @@ hr { .commentActionsRight, .replyActionsRight { display: flex; justify-content: flex-end; - width: 30%; + width: 50%; } .commentActionsLeft, .replyActionsLeft { display: flex; justify-content: flex-start; float: left; - width: 70%; + width: 50%; } .comment__action-container .material-icons { From 76e2066a5161f592dec67dfc446969471a6d676f Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Mon, 24 Apr 2017 11:12:39 -0600 Subject: [PATCH 3/3] reply box is squished on long comments in Firefox --- client/coral-embed-stream/style/default.css | 1 + 1 file changed, 1 insertion(+) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 13a200690..d66e43e27 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -187,6 +187,7 @@ hr { /* Comment Box Styles */ .coral-plugin-commentbox-container { display: flex; + width: 100%; } .coral-plugin-commentbox-textarea {