Add sprintId to bulk issues
parent
580ee04fa2
commit
e63b1be5e0
|
@ -33,20 +33,21 @@ module = angular.module("taigaIssues")
|
|||
## Issue Bulk Create Lightbox Directive
|
||||
#############################################################################
|
||||
|
||||
CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, $loading, lightboxService) ->
|
||||
CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, $loading, lightboxService, $model) ->
|
||||
link = ($scope, $el, attrs) ->
|
||||
form = null
|
||||
|
||||
$scope.$on "issueform:bulk", (ctx, projectId, status)->
|
||||
$scope.$on "issueform:bulk", (ctx, projectId, milestoneId, status)->
|
||||
form.reset() if form
|
||||
|
||||
lightboxService.open($el)
|
||||
$scope.new = {
|
||||
projectId: projectId
|
||||
projectId: projectId,
|
||||
milestoneId: milestoneId,
|
||||
bulk: ""
|
||||
}
|
||||
|
||||
submit = debounce 2000, (event) =>
|
||||
submit = debounce 2000, (event) ->
|
||||
event.preventDefault()
|
||||
|
||||
form = $el.find("form").checksley()
|
||||
|
@ -59,9 +60,11 @@ CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, $loading, lightbo
|
|||
|
||||
data = $scope.new.bulk
|
||||
projectId = $scope.new.projectId
|
||||
milestoneId = $scope.new.milestoneId
|
||||
|
||||
promise = $rs.issues.bulkCreate(projectId, data)
|
||||
promise = $rs.issues.bulkCreate(projectId, milestoneId, data)
|
||||
promise.then (result) ->
|
||||
result = _.map(result.data, (x) -> $model.make_model('issues', x))
|
||||
currentLoading.finish()
|
||||
$rootscope.$broadcast("issueform:new:success", result)
|
||||
lightboxService.close($el)
|
||||
|
@ -81,4 +84,4 @@ CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, $loading, lightbo
|
|||
return {link: link}
|
||||
|
||||
module.directive("tgLbCreateBulkIssues", ["$tgRepo", "$tgResources", "$tgConfirm", "$rootScope", "$tgLoading",
|
||||
"lightboxService", CreateBulkIssuesDirective])
|
||||
"lightboxService", "$tgModel", CreateBulkIssuesDirective])
|
||||
|
|
|
@ -57,9 +57,9 @@ resourceProvider = ($repo, $http, $urls, $storage, $q) ->
|
|||
service.storeQueryParams(projectId, params)
|
||||
return $repo.queryMany("issues", params)
|
||||
|
||||
service.bulkCreate = (projectId, data) ->
|
||||
service.bulkCreate = (projectId, milestoneId, data) ->
|
||||
url = $urls.resolve("bulk-create-issues")
|
||||
params = {project_id: projectId, bulk_issues: data}
|
||||
params = {project_id: projectId, milestone_id: milestoneId, bulk_issues: data}
|
||||
return $http.post(url, params)
|
||||
|
||||
service.upvote = (issueId) ->
|
||||
|
|
|
@ -594,7 +594,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga
|
|||
'sprintId': @scope.sprintId
|
||||
})
|
||||
when "standard" then @rootscope.$broadcast("taskform:new", @scope.sprintId, us?.id)
|
||||
when "bulk" then @rootscope.$broadcast("taskform:bulk", @scope.sprintId, us?.id)
|
||||
when "bulk" then @rootscope.$broadcast("issueform:bulk", @scope.projectId, @scope.sprintId)
|
||||
|
||||
toggleFold: (id) ->
|
||||
@taskboardTasksService.toggleFold(id)
|
||||
|
|
|
@ -52,5 +52,8 @@ div.wrapper(
|
|||
div.lightbox.lightbox-generic-bulk.lightbox-task-bulk(tg-lb-create-bulk-tasks)
|
||||
include ../includes/modules/lightbox-task-bulk
|
||||
|
||||
div.lightbox.lightbox-generic-bulk(tg-lb-create-bulk-issues)
|
||||
include ../includes/modules/lightbox-issue-bulk
|
||||
|
||||
div.lightbox.lightbox-select-user(tg-lb-assignedto)
|
||||
include ../common/lightbox/lightbox-assigned-to
|
||||
|
|
Loading…
Reference in New Issue