diff --git a/services/web/app/views/project/editor/review-panel.jade b/services/web/app/views/project/editor/review-panel.jade index 3d2bc741f1..956dd1bf32 100644 --- a/services/web/app/views/project/editor/review-panel.jade +++ b/services/web/app/views/project/editor/review-panel.jade @@ -135,7 +135,7 @@ script(type='text/ng-template', id='commentEntryTemplate') ) i.fa.fa-comment .rp-entry.rp-entry-comment( - ng-class="entry.focused ? 'rp-entry-focused' : '';" + ng-class="{ 'rp-entry-focused': entry.focused, 'rp-entry-comment-resolved': entry.resolved}" ) .rp-comment( ng-if="!entry.resolved || entry.showWhenResolved" @@ -160,7 +160,10 @@ script(type='text/ng-template', id='commentEntryTemplate') placeholder="{{ 'Hit \"Enter\" to reply' + (entry.resolved ? ' and re-open' : '') }}" ) .rp-comment-resolved-description(ng-if="entry.resolved && !entry.showWhenResolved") - | Resolved comment + div + | Comment resolved by + span(style="color: hsl({{ users[entry.resolved_data.user_id].hue }}, 70%, 40%);") {{ users[entry.resolved_data.user_id].name }} + div {{ entry.resolved_data.ts | date : 'MMM d, y h:mm a' }} .rp-entry-actions a.rp-entry-button(href, ng-click="onResolve();", ng-if="!entry.resolved") i.fa.fa-check diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee index 5b651a5f54..016ccb7d7a 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee @@ -48,8 +48,8 @@ define [ @$scope.$on "comment:remove", (e, comment_id) => @removeCommentId(comment_id) - @$scope.$on "comment:resolve", (e, comment_id) => - @resolveCommentId(comment_id) + @$scope.$on "comment:resolve", (e, comment_id, user_id) => + @resolveCommentId(comment_id, user_id) @$scope.$on "comment:unresolve", (e, comment_id) => @unresolveCommentId(comment_id) @@ -206,8 +206,10 @@ define [ removeCommentId: (comment_id) -> @changesTracker.removeCommentId(comment_id) - resolveCommentId: (comment_id) -> - @changesTracker.resolveCommentId(comment_id) + resolveCommentId: (comment_id, user_id) -> + @changesTracker.resolveCommentId(comment_id, { + user_id, ts: new Date() + }) unresolveCommentId: (comment_id) -> @changesTracker.unresolveCommentId(comment_id) diff --git a/services/web/public/coffee/ide/review-panel/ChangesTracker.coffee b/services/web/public/coffee/ide/review-panel/ChangesTracker.coffee index dc1adb7885..0b668c90dd 100644 --- a/services/web/public/coffee/ide/review-panel/ChangesTracker.coffee +++ b/services/web/public/coffee/ide/review-panel/ChangesTracker.coffee @@ -69,10 +69,11 @@ define [ break return comment - resolveCommentId: (comment_id) -> + resolveCommentId: (comment_id, resolved_data) -> comment = @getComment(comment_id) return if !comment? comment.metadata.resolved = true + comment.metadata.resolved_data = resolved_data @emit "comment:resolved", comment unresolveCommentId: (comment_id) -> diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index ade3e0b895..ae0c2160db 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -196,6 +196,7 @@ define [ type: "comment" thread: comment.metadata.thread resolved: comment.metadata.resolved + resolved_data: comment.metadata.resolved_data offset: comment.offset length: comment.length } @@ -308,7 +309,7 @@ define [ $scope.resolveComment = (entry, entry_id) -> entry.showWhenResolved = false entry.focused = false - $scope.$broadcast "comment:resolve", entry_id + $scope.$broadcast "comment:resolve", entry_id, window.user_id $scope.unresolveComment = (entry_id) -> $scope.$broadcast "comment:unresolve", entry_id diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index 4944e99ccb..2939957b24 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -14,6 +14,7 @@ @rp-dim-red : #f3cdce; @rp-yellow : #f3b111; @rp-dim-yellow : #ffe9b2; +@rp-grey : #aaaaaa; @rp-type-blue : #6b7797; @rp-type-darkgrey : #3f3f3f; @@ -237,6 +238,11 @@ &-comment { border-color: @rp-yellow; } + + &-comment-resolved { + border-color: @rp-grey; + background-color: #efefef; + } &-add-comment { background-color: transparent;