diff --git a/frontend/app/work_packages/controllers/work-package-show-controller.js b/frontend/app/work_packages/controllers/work-package-show-controller.js index f8606ea93f..789cb520de 100644 --- a/frontend/app/work_packages/controllers/work-package-show-controller.js +++ b/frontend/app/work_packages/controllers/work-package-show-controller.js @@ -110,7 +110,7 @@ module.exports = function($scope, var promise = WorkPackageService.performBulkDelete([$scope.workPackage.props.id], true); promise.success(function() { - $state.go('work-packages.list', {projectPath: getProjectPath()}); + $state.go('work-packages.list', {projectPath: $scope.projectIdentifier}); }); } $scope.triggerMoreMenuAction = function(action, link) { @@ -348,38 +348,24 @@ module.exports = function($scope, hideAllAttributes: true }; - function isNestedWithinProject() { - return $stateParams.projectPath.indexOf('/projects/') === 0 || $stateParams.projectPath.indexOf('projects/') === 0; - }; - - function getProjectPath() { - if (isNestedWithinProject()) { - return PathHelper.projectPath($scope.projectIdentifier); - } else { - return ''; - } - } - $scope.showWorkPackageDetails = function() { var queryProps = $state.params['query_props']; - $state.go('work-packages.list.details.overview', - { - projectPath: getProjectPath(), - workPackageId: $scope.workPackage.props.id, - 'query_props': queryProps - }); + $state.go('work-packages.list.details.overview', { + projectPath: $scope.projectIdentifier, + workPackageId: $scope.workPackage.props.id, + 'query_props': queryProps + }); }; $scope.closeShowView = function() { var queryProps = $state.params['query_props']; - $state.go('work-packages.list', - { - projectPath: getProjectPath(), - workPackageId: $scope.workPackage.props.id, - 'query_props': queryProps - }); + $state.go('work-packages.list', { + projectPath: $scope.projectIdentifier, + workPackageId: $scope.workPackage.props.id, + 'query_props': queryProps + }); }; function getFocusAnchorLabel(tab, workPackage) { diff --git a/frontend/app/work_packages/controllers/work-packages-list-controller.js b/frontend/app/work_packages/controllers/work-packages-list-controller.js index eba539414f..1be132e4d4 100644 --- a/frontend/app/work_packages/controllers/work-packages-list-controller.js +++ b/frontend/app/work_packages/controllers/work-packages-list-controller.js @@ -309,17 +309,12 @@ module.exports = function($scope, $rootScope, $state, $stateParams, $location, l // browser. This seems to be caused by #maintainUrlQueryState // where we set the search via $location.search. queryProps = $location.search()['query_props']; - var projectPath = ''; - if ($scope.projectIdentifier) { - projectPath = PathHelper.projectPath($scope.projectIdentifier); - } - $state.go('work-packages.show.activity', - { - projectPath: projectPath, - workPackageId: id, - 'query_props': queryProps - }); + $state.go('work-packages.show.activity', { + projectPath: $scope.projectIdentifier || '', + workPackageId: id, + 'query_props': queryProps + }); }; $scope.getFilterCount = function() {