Issue sprint change confirmation from TaskBoard
parent
64783318fc
commit
77833cc49f
|
@ -824,6 +824,7 @@ $confirm, $q, attachmentsService, $template, $compile) ->
|
||||||
severityList: _.sortBy(project.severities, "order")
|
severityList: _.sortBy(project.severities, "order")
|
||||||
priorityById: groupBy(project.priorities, (x) -> x.id)
|
priorityById: groupBy(project.priorities, (x) -> x.id)
|
||||||
priorityList: _.sortBy(project.priorities, "order")
|
priorityList: _.sortBy(project.priorities, "order")
|
||||||
|
milestonesById: groupBy(project.milestones, (x) -> x.id)
|
||||||
}
|
}
|
||||||
initialData: (data) ->
|
initialData: (data) ->
|
||||||
return {
|
return {
|
||||||
|
@ -948,11 +949,43 @@ $confirm, $q, attachmentsService, $template, $compile) ->
|
||||||
|
|
||||||
addExisting = (item) ->
|
addExisting = (item) ->
|
||||||
currentLoading = $loading().target($el.find(".add-existing-button")).start()
|
currentLoading = $loading().target($el.find(".add-existing-button")).start()
|
||||||
item.setAttr($scope.relatedField, $scope.relatedObjectId)
|
|
||||||
$repo.save(item, true).then (data) ->
|
if item.milestone
|
||||||
currentLoading.finish()
|
currentLoading.finish()
|
||||||
lightboxService.close($el)
|
lightboxService.close($el)
|
||||||
$rootScope.$broadcast("#{$scope.objType}form:add:success", item)
|
sprintChangeConfirmAndSave(item)
|
||||||
|
else
|
||||||
|
onSuccess = ->
|
||||||
|
currentLoading.finish()
|
||||||
|
lightboxService.close($el)
|
||||||
|
$rootScope.$broadcast("#{$scope.objType}form:add:success", item)
|
||||||
|
onError = ->
|
||||||
|
currentLoading.finish()
|
||||||
|
lightboxService.close($el)
|
||||||
|
saveItem(item, onSuccess, onError)
|
||||||
|
|
||||||
|
sprintChangeConfirmAndSave = (item) ->
|
||||||
|
oldSprintName = $scope.milestonesById[item.milestone].name
|
||||||
|
newSprintName = $scope.milestonesById[$scope.relatedObjectId].name
|
||||||
|
title = $translate.instant("ISSUES.CONFIRM_CHANGE_FROM_SPRINT.TITLE")
|
||||||
|
message = $translate.instant("ISSUES.CONFIRM_CHANGE_FROM_SPRINT.MESSAGE",
|
||||||
|
{oldSprintName: oldSprintName, newSprintName: newSprintName})
|
||||||
|
|
||||||
|
$confirm.ask(title, null, message).then (askResponse) ->
|
||||||
|
onSuccess = ->
|
||||||
|
askResponse.finish()
|
||||||
|
lightboxService.close($el)
|
||||||
|
$rootScope.$broadcast("#{$scope.objType}form:add:success", item)
|
||||||
|
|
||||||
|
onError = ->
|
||||||
|
askResponse.finish(false)
|
||||||
|
$confirm.notify("error")
|
||||||
|
saveItem(item, onSuccess, onError)
|
||||||
|
|
||||||
|
saveItem = (item, onSuccess, onError) ->
|
||||||
|
item.setAttr($scope.relatedField, $scope.relatedObjectId)
|
||||||
|
$repo.save(item, true).then(onSuccess, onError)
|
||||||
|
|
||||||
|
|
||||||
isDisabledExisting = (item) ->
|
isDisabledExisting = (item) ->
|
||||||
return item && item[$scope.relatedField] == $scope.relatedObjectId
|
return item && item[$scope.relatedField] == $scope.relatedObjectId
|
||||||
|
|
|
@ -1447,6 +1447,10 @@
|
||||||
"TITLE": "Detach issue from Sprint",
|
"TITLE": "Detach issue from Sprint",
|
||||||
"MESSAGE": "You are about to detach the issue from the sprint"
|
"MESSAGE": "You are about to detach the issue from the sprint"
|
||||||
},
|
},
|
||||||
|
"CONFIRM_CHANGE_FROM_SPRINT": {
|
||||||
|
"TITLE": "Change issue from Sprint",
|
||||||
|
"MESSAGE": "Are you sure you want to change the issue sprint from {{ oldSprintName }} to {{ newSprintName }}"
|
||||||
|
},
|
||||||
"CONFIRM_PROMOTE": {
|
"CONFIRM_PROMOTE": {
|
||||||
"TITLE": "Promote this issue to a new user story",
|
"TITLE": "Promote this issue to a new user story",
|
||||||
"MESSAGE": "Are you sure you want to create a new US from this Issue?"
|
"MESSAGE": "Are you sure you want to create a new US from this Issue?"
|
||||||
|
|
Loading…
Reference in New Issue