mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Integrate bulk actions dialog with controller actions.
This commit is contained in:
parent
f3e020df7e
commit
8aee0edfe8
2 changed files with 23 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
define [
|
||||
"ide/review-panel/controllers/ReviewPanelController"
|
||||
"ide/review-panel/controllers/TrackChangesUpgradeModalController"
|
||||
"ide/review-panel/controllers/BulkActionsModalController"
|
||||
"ide/review-panel/directives/reviewPanelSorted"
|
||||
"ide/review-panel/directives/reviewPanelToggle"
|
||||
"ide/review-panel/directives/changeEntry"
|
||||
|
|
|
@ -335,7 +335,7 @@ define [
|
|||
$scope.$broadcast "change:reject", entry_id
|
||||
event_tracking.sendMB "rp-change-rejected", { view: if $scope.ui.reviewPanelOpen then $scope.reviewPanel.subView else 'mini' }
|
||||
|
||||
$scope.bulkAccept = () ->
|
||||
bulkAccept = () ->
|
||||
entry_ids = $scope.reviewPanel.selectedEntryIds.slice()
|
||||
$http.post "/project/#{$scope.project_id}/doc/#{$scope.editor.open_doc_id}/changes/accept", { change_ids: entry_ids, _csrf: window.csrfToken}
|
||||
$scope.$broadcast "change:bulk-accept", entry_ids
|
||||
|
@ -345,7 +345,7 @@ define [
|
|||
nEntries: $scope.reviewPanel.selectedEntryIds.length
|
||||
}
|
||||
|
||||
$scope.bulkReject = () ->
|
||||
bulkReject = () ->
|
||||
$scope.$broadcast "change:bulk-reject", $scope.reviewPanel.selectedEntryIds.slice()
|
||||
$scope.reviewPanel.selectedEntryIds = []
|
||||
event_tracking.sendMB "rp-bulk-reject", {
|
||||
|
@ -353,6 +353,26 @@ define [
|
|||
nEntries: $scope.reviewPanel.selectedEntryIds.length
|
||||
}
|
||||
|
||||
$scope.showBulkAcceptDialog = () ->
|
||||
console.log "showBulkAcceptDialog"
|
||||
showBulkActionsDialog true
|
||||
|
||||
$scope.showBulkRejectDialog = () -> showBulkActionsDialog false
|
||||
|
||||
showBulkActionsDialog = (isAccept) ->
|
||||
$modal.open({
|
||||
templateUrl: "bulkActionsModalTemplate"
|
||||
controller: "BulkActionsModalController"
|
||||
resolve:
|
||||
isAccept: () -> isAccept
|
||||
nChanges: () -> $scope.reviewPanel.selectedEntryIds.length
|
||||
scope: $scope.$new()
|
||||
}).result.then (isAccept) ->
|
||||
if isAccept
|
||||
bulkAccept()
|
||||
else
|
||||
bulkReject()
|
||||
|
||||
$scope.addNewComment = () ->
|
||||
$scope.$broadcast "comment:start_adding"
|
||||
$scope.toggleReviewPanel()
|
||||
|
|
Loading…
Reference in a new issue