Fixed issue #789: Now on unresolved objects redirect user to the 404 page.

stable
Jesús Espino 2014-08-28 11:56:38 +02:00
parent 3afc2fa200
commit 710589d5df
17 changed files with 73 additions and 4 deletions

View File

@ -80,6 +80,10 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadMembers())

View File

@ -76,6 +76,10 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
openDeleteLightbox: ->

View File

@ -76,6 +76,10 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then( => @q.all([
@.loadProject(),
@.loadValues(),

View File

@ -75,6 +75,10 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadRoles())

View File

@ -168,6 +168,10 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadBacklog())

View File

@ -124,6 +124,10 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
@scope.issueId = data.issue
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadIssue())

View File

@ -261,6 +261,10 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadFilters())

View File

@ -146,6 +146,10 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadKanban())

View File

@ -30,9 +30,9 @@ class ProjectsController extends taiga.Controller
module.controller("ProjectsController", ProjectsController)
class ProjectController extends taiga.Controller
@.$inject = ["$scope", "$tgResources", "$tgRepo", "$routeParams", "$q", "$rootScope", "$appTitle"]
@.$inject = ["$scope", "$tgResources", "$tgRepo", "$routeParams", "$q", "$rootScope", "$appTitle", "$tgLocation"]
constructor: (@scope, @rs, @repo, @params, @q, @rootscope, @appTitle) ->
constructor: (@scope, @rs, @repo, @params, @q, @rootscope, @appTitle, @location) ->
@.loadInitialData()
.then () =>
@appTitle.set(@scope.project.name)
@ -43,6 +43,10 @@ class ProjectController extends taiga.Controller
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise
.then(=> @.loadPageData())
.then(=> @scope.$emit("project:loaded", @scope.project))

View File

@ -96,6 +96,10 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())

View File

@ -43,9 +43,10 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
"$routeParams",
"$q",
"$appTitle"
"$tgLocation"
]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle) ->
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle, @location) ->
_.bindAll(@)
@scope.sprintId = @params.id
@ -142,6 +143,10 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadTaskboard())

View File

@ -118,6 +118,10 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
@scope.taskId = data.task
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadTask())

View File

@ -63,6 +63,10 @@ class UserChangePasswordController extends mixOf(taiga.Controller, taiga.PageMix
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
save: ->

View File

@ -61,6 +61,10 @@ class UserSettingsController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
saveUserProfile: ->

View File

@ -68,6 +68,10 @@ class UserNotificationsController extends mixOf(taiga.Controller, taiga.PageMixi
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadNotifyPolicies())

View File

@ -129,6 +129,10 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
@scope.usId = data.us
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadUs())

View File

@ -102,6 +102,10 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
@scope.projectId = data.project
return data
promise.then null, =>
@location.path("/not-found")
@location.replace()
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @.loadWikiLinks())