diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index 9448f16e..a7c9e76b 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -689,3 +689,43 @@ PromoteIssueToUsButtonDirective = ($rootScope, $repo, $confirm, $translate) -> module.directive("tgPromoteIssueToUsButton", ["$rootScope", "$tgRepo", "$tgConfirm", "$translate" PromoteIssueToUsButtonDirective]) + +############################################################################# +## Add Issue to Sprint button directive +############################################################################# + +AssignSprintToIssueButtonDirective = ($rootScope, $repo, $translate, lightboxService) -> + link = ($scope, $el, $attrs, $model) -> + $el.on "click", "a", (event) -> + event.preventDefault() + event.stopPropagation() + issue = $model.$modelValue + + title = $translate.instant("ISSUES.ACTION_ASSIGN_SPRINT") + + # scope.selectProject(selectedProjectId).then () => + # lightboxService.open(el.find(".lightbox-create-related-user-stories")) + # if ctrl.disabled() + # return + + # $el.find(".lightbox-assign-sprint-to-issue").popover().open() + + lightboxService.open($el.find(".lightbox-assign-sprint-to-issue")) + # $scope.new = { + # projectId: projectId, + # milestoneId: milestoneId + # } + + $scope.$on "$destroy", -> + $el.off() + + return { + link: link + restrict: "EA" + require: "ngModel" + templateUrl: "issue/assign-sprint-to-issue-button.html" + + } + +module.directive("tgAssignSprintToIssueButton", ["$rootScope", "$tgRepo", "$translate" + "lightboxService", AssignSprintToIssueButtonDirective] ) diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index ac656b02..c5fd40ce 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -1424,6 +1424,8 @@ "SECTION_NAME": "Issue", "ACTION_NEW_ISSUE": "+ NEW ISSUE", "ACTION_PROMOTE_TO_US": "Promote to User Story", + "ACTION_ASSIGN_SPRINT": "Add issue to Sprint", + "ACTION_REMOVE_FROM_SPRINT": "Remove issue from Sprint {{ sprintName }}", "PROMOTED": "This issue has been promoted to US:", "EXTERNAL_REFERENCE": "This issue has been created from", "GO_TO_EXTERNAL_REFERENCE": "Go to origin", @@ -1431,6 +1433,8 @@ "LIGHTBOX_TITLE_BLOKING_ISSUE": "Blocking issue", "LINK_TASKBOARD": "Taskboard", "TITLE_LINK_TASKBOARD": "Go to the taskboard", + "FILTER_SPRINTS": "Filter Sprints", + "CHOOSE_SPRINT": "What's the user Sprint?", "FIELDS": { "PRIORITY": "Priority", "SEVERITY": "Severity", diff --git a/app/partials/issue/issues-detail.jade b/app/partials/issue/issues-detail.jade index 543a73cb..5e709831 100644 --- a/app/partials/issue/issues-detail.jade +++ b/app/partials/issue/issues-detail.jade @@ -133,6 +133,10 @@ div.wrapper( tg-check-permission="add_us", ng-model="issue" ) + tg-assign-sprint-to-issue-button( + tg-check-permission="modify_issue", + ng-model="issue" + ) tg-block-button( tg-check-permission="modify_issue", ng-model="issue" diff --git a/app/styles/modules/common/ticket-data.scss b/app/styles/modules/common/ticket-data.scss index e1564075..a24ba3e1 100644 --- a/app/styles/modules/common/ticket-data.scss +++ b/app/styles/modules/common/ticket-data.scss @@ -174,6 +174,7 @@ justify-content: center; margin-top: 2rem; label, + .assign-issue-button, .item-block, .item-unblock, .promote-button,