Add and remove bulk accept and reject entries with selections.

This commit is contained in:
Paulo Reis 2017-05-02 15:34:05 +01:00
parent 3bdd5a4a2e
commit d874eb70f8
2 changed files with 19 additions and 2 deletions

View file

@ -82,6 +82,10 @@
on-submit="submitNewComment(content);"
on-cancel="cancelNewComment();"
)
div(ng-if="entry.type === 'bulk-accept'")
| Bulk accept
div(ng-if="entry.type === 'bulk-reject'")
| Bulk reject
.rp-entry-list(
ng-if="reviewPanel.subView === SubViews.OVERVIEW"

View file

@ -159,7 +159,7 @@ define [
entries = $scope.reviewPanel.entries[$scope.editor.open_doc_id] or {}
permEntries = {}
for entry, entryData of entries
if entry != "add-comment"
if entry not in [ "add-comment", "bulk-accept", "bulk-reject" ]
permEntries[entry] = entryData
Object.keys(permEntries).length
), (nEntries) ->
@ -285,12 +285,25 @@ define [
entries = getDocEntries(doc_id)
delete entries["add-comment"]
delete entries["bulk-accept"]
delete entries["bulk-reject"]
if selection
entries["add-comment"] = {
type: "add-comment"
offset: selection_offset_start
length: selection_offset_end - selection_offset_start
}
entries["bulk-accept"] = {
type: "bulk-accept"
offset: selection_offset_start
length: selection_offset_end - selection_offset_start
}
entries["bulk-reject"] = {
type: "bulk-reject"
offset: selection_offset_start
length: selection_offset_end - selection_offset_start
}
for id, entry of entries
if entry.type == "comment" and not $scope.reviewPanel.resolvedThreadIds[entry.thread_id]
@ -299,7 +312,7 @@ define [
entry.focused = (entry.offset <= selection_offset_start <= entry.offset + entry.content.length)
else if entry.type == "delete"
entry.focused = (entry.offset == selection_offset_start)
else if entry.type == "add-comment" and selection
else if entry.type in [ "add-comment", "bulk-accept", "bulk-reject" ] and selection
entry.focused = true
$scope.$broadcast "review-panel:recalculate-screen-positions"