From bd31bdd7616a222abceac10b6f23fed8ac978825 Mon Sep 17 00:00:00 2001 From: Alex Dik Date: Thu, 12 Nov 2015 18:35:29 +0100 Subject: [PATCH] Fix routing for projects sub routes --- frontend/app/routing.js | 2 +- frontend/tests/unit/tests/work_packages/routing-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/routing.js b/frontend/app/routing.js index 0fee307e72..107af8ba37 100644 --- a/frontend/app/routing.js +++ b/frontend/app/routing.js @@ -229,7 +229,7 @@ angular.module('openproject') }); $rootScope.$on('$stateChangeStart', function(event, toState, toParams){ - if (toParams.projects === '' && toParams.projectPath) { + if (!toParams.projects && toParams.projectPath) { toParams.projects = 'projects'; $state.go(toState, toParams); } diff --git a/frontend/tests/unit/tests/work_packages/routing-test.js b/frontend/tests/unit/tests/work_packages/routing-test.js index 32c3b1c6dd..d673176cc9 100644 --- a/frontend/tests/unit/tests/work_packages/routing-test.js +++ b/frontend/tests/unit/tests/work_packages/routing-test.js @@ -46,7 +46,7 @@ describe('Routing', function () { beforeEach(function () { toState = { name: 'work-packages.list' }; - toParams = { projectPath: 'my_project', projects: '' }; + toParams = { projectPath: 'my_project', projects: null }; }); it('sets the projects path segment to "projects" ', function () {