diff --git a/app/coffee/modules/tasks/detail.coffee b/app/coffee/modules/tasks/detail.coffee index 7778b193..7592c34b 100644 --- a/app/coffee/modules/tasks/detail.coffee +++ b/app/coffee/modules/tasks/detail.coffee @@ -140,7 +140,12 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin) promise = @.repo.remove(@scope.task) promise.then => finish() - @location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug})) + + if @scope.task.milestone + @location.path(@navUrls.resolve("project-taskboard", {project: @scope.project.slug, sprint: @scope.sprint.slug})) + else if @scope.us + @location.path(@navUrls.resolve("project-userstories-detail", {project: @scope.project.slug, ref: @scope.us.ref})) + promise.then null, => finish(false) @confirm.notify("error") diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index aac5f273..a944ec43 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -152,7 +152,13 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin) promise = @.repo.remove(@scope.us) promise.then => finish() - @location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug})) + + if @scope.us.milestone + @location.path(@navUrls.resolve("project-taskboard", {project: @scope.project.slug, sprint: @scope.sprint.slug})) + else if @scope.project.is_backlog_activated + @location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug})) + else + @location.path(@navUrls.resolve("project-kanban", {project: @scope.project.slug})) promise.then null, => finish(false) $confirm.notify("error")