Merge branch 'master' into shortcut-hint

This commit is contained in:
Riley Davis
2017-04-24 12:34:44 -06:00
committed by GitHub
3 changed files with 16 additions and 27 deletions
+5 -3
View File
@@ -187,6 +187,7 @@ hr {
/* Comment Box Styles */
.coral-plugin-commentbox-container {
display: flex;
width: 100%;
}
.coral-plugin-commentbox-textarea {
@@ -194,7 +195,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 +280,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 {
+2 -2
View File
@@ -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
+9 -22
View File
@@ -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}
});
}
};