Fix loading button attach issue to sprint
parent
6f7bc17847
commit
f4a26000b7
|
@ -108,8 +108,8 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@rootscope.$broadcast("object:updated")
|
@rootscope.$broadcast("object:updated")
|
||||||
|
|
||||||
@scope.$on "assign-sprint-to-issue:success", (ctx, milestoneId) =>
|
@scope.$on "assign-sprint-to-issue:success", (ctx, milestoneId) =>
|
||||||
@rootscope.$broadcast("object:updated")
|
|
||||||
@scope.issue.milestone = milestoneId
|
@scope.issue.milestone = milestoneId
|
||||||
|
@rootscope.$broadcast("object:updated")
|
||||||
if milestoneId
|
if milestoneId
|
||||||
@.loadSprint()
|
@.loadSprint()
|
||||||
else
|
else
|
||||||
|
@ -705,11 +705,20 @@ module.directive("tgPromoteIssueToUsButton", ["$rootScope", "$tgRepo", "$tgConfi
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
AssignSprintToIssueButtonDirective = ($rootScope, $rs, $repo, $loading, $translate,
|
AssignSprintToIssueButtonDirective = ($rootScope, $rs, $repo, $loading, $translate,
|
||||||
lightboxService, $confirm) ->
|
lightboxService, $modelTransform, $confirm) ->
|
||||||
link = ($scope, $el, $attrs, $model) ->
|
link = ($scope, $el, $attrs, $model) ->
|
||||||
avaliableMilestones = []
|
avaliableMilestones = []
|
||||||
issue = null
|
issue = null
|
||||||
|
|
||||||
|
$scope.$watch $attrs.ngModel, (item) ->
|
||||||
|
return if not item
|
||||||
|
if item.milestone
|
||||||
|
$el.find('.assign-issue-button.button-unset').removeClass('is-active')
|
||||||
|
$el.find('.assign-issue-button.button-set').addClass('is-active')
|
||||||
|
else
|
||||||
|
$el.find('.assign-issue-button.button-set').removeClass('is-active')
|
||||||
|
$el.find('.assign-issue-button.button-unset').addClass('is-active')
|
||||||
|
|
||||||
$el.on "click", ".assign-issue-button.button-unset", (event) ->
|
$el.on "click", ".assign-issue-button.button-unset", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
@ -742,8 +751,10 @@ lightboxService, $confirm) ->
|
||||||
askResponse.finish(false)
|
askResponse.finish(false)
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
|
|
||||||
issue.setAttr('milestone', null)
|
transform = $modelTransform.save (issue) ->
|
||||||
$repo.save(issue, true).then(onSuccess, onError)
|
issue.setAttr('milestone', null)
|
||||||
|
return issue
|
||||||
|
transform.then(onSuccess, onError)
|
||||||
|
|
||||||
$scope.$on "$destroy", ->
|
$scope.$on "$destroy", ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
@ -761,7 +772,12 @@ lightboxService, $confirm) ->
|
||||||
$scope.saveIssueToSprint = (selectedSprint, event) ->
|
$scope.saveIssueToSprint = (selectedSprint, event) ->
|
||||||
currentLoading = $loading().target($(event.currentTarget)).start()
|
currentLoading = $loading().target($(event.currentTarget)).start()
|
||||||
issue.setAttr('milestone', selectedSprint.id)
|
issue.setAttr('milestone', selectedSprint.id)
|
||||||
$repo.save(issue, true).then (data) ->
|
|
||||||
|
transform = $modelTransform.save (item) ->
|
||||||
|
issue.setAttr('milestone', selectedSprint.id)
|
||||||
|
return item
|
||||||
|
|
||||||
|
transform.then ->
|
||||||
currentLoading.finish()
|
currentLoading.finish()
|
||||||
lightboxService.close($el.find(".lightbox-assign-sprint-to-issue"))
|
lightboxService.close($el.find(".lightbox-assign-sprint-to-issue"))
|
||||||
$scope.$broadcast("assign-sprint-to-issue:success", selectedSprint.id)
|
$scope.$broadcast("assign-sprint-to-issue:success", selectedSprint.id)
|
||||||
|
@ -775,5 +791,5 @@ lightboxService, $confirm) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
module.directive("tgAssignSprintToIssueButton", ["$rootScope", "$tgResources", "$tgRepo",
|
module.directive("tgAssignSprintToIssueButton", ["$rootScope", "$tgResources", "$tgRepo",
|
||||||
"$tgLoading", "$translate", "lightboxService", "$tgConfirm"
|
"$tgLoading", "$translate", "lightboxService", "$tgQueueModelTransformation",
|
||||||
AssignSprintToIssueButtonDirective] )
|
"$tgConfirm", AssignSprintToIssueButtonDirective] )
|
||||||
|
|
|
@ -6,9 +6,9 @@ a.assign-issue-button.button-gray.is-editable.button-unset(
|
||||||
)
|
)
|
||||||
tg-svg(svg-icon="icon-attach")
|
tg-svg(svg-icon="icon-attach")
|
||||||
|
|
||||||
a.assign-issue-button.button-gray.is-editable.button-set(
|
a.assign-issue-button.button-green.is-editable.button-set(
|
||||||
href=""
|
href=""
|
||||||
ng-show="issue && issue.milestone"
|
ng-show="issue.milestone"
|
||||||
tg-check-permission="modify_issue"
|
tg-check-permission="modify_issue"
|
||||||
title="{{ 'ISSUES.ACTION_DETACH_SPRINT' | translate }}"
|
title="{{ 'ISSUES.ACTION_DETACH_SPRINT' | translate }}"
|
||||||
)
|
)
|
||||||
|
|
|
@ -200,9 +200,17 @@
|
||||||
border-color: $yellow-green;
|
border-color: $yellow-green;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.assign-issue-button.button-set:hover {
|
|
||||||
background: $red-light;
|
.assign-issue-button {
|
||||||
|
display: none;
|
||||||
|
&.is-active {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: $yellow-green;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-block,
|
.item-block,
|
||||||
.item-unblock {
|
.item-unblock {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
Loading…
Reference in New Issue