Merge pull request #116 from taigaio/bug/1042/redirect-after-delete-task-or-us

redirect after delete an us or task
stable
Alejandro 2014-10-22 16:58:03 +02:00
commit f8fde1247b
2 changed files with 13 additions and 2 deletions

View File

@ -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")

View File

@ -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")