Undo url escaping of work package toolbar-buttons

pull/3563/head
Alex Dik 9 years ago committed by Stefan Botzenhart
parent 691c57a9a4
commit 805880247d
  1. 36
      frontend/app/work_packages/controllers/work-package-show-controller.js
  2. 15
      frontend/app/work_packages/controllers/work-packages-list-controller.js

@ -110,7 +110,7 @@ module.exports = function($scope,
var promise = WorkPackageService.performBulkDelete([$scope.workPackage.props.id], true); var promise = WorkPackageService.performBulkDelete([$scope.workPackage.props.id], true);
promise.success(function() { promise.success(function() {
$state.go('work-packages.list', {projectPath: getProjectPath()}); $state.go('work-packages.list', {projectPath: $scope.projectIdentifier});
}); });
} }
$scope.triggerMoreMenuAction = function(action, link) { $scope.triggerMoreMenuAction = function(action, link) {
@ -348,38 +348,24 @@ module.exports = function($scope,
hideAllAttributes: true 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() { $scope.showWorkPackageDetails = function() {
var queryProps = $state.params['query_props']; var queryProps = $state.params['query_props'];
$state.go('work-packages.list.details.overview', $state.go('work-packages.list.details.overview', {
{ projectPath: $scope.projectIdentifier,
projectPath: getProjectPath(), workPackageId: $scope.workPackage.props.id,
workPackageId: $scope.workPackage.props.id, 'query_props': queryProps
'query_props': queryProps });
});
}; };
$scope.closeShowView = function() { $scope.closeShowView = function() {
var queryProps = $state.params['query_props']; var queryProps = $state.params['query_props'];
$state.go('work-packages.list', $state.go('work-packages.list', {
{ projectPath: $scope.projectIdentifier,
projectPath: getProjectPath(), workPackageId: $scope.workPackage.props.id,
workPackageId: $scope.workPackage.props.id, 'query_props': queryProps
'query_props': queryProps });
});
}; };
function getFocusAnchorLabel(tab, workPackage) { function getFocusAnchorLabel(tab, workPackage) {

@ -309,17 +309,12 @@ module.exports = function($scope, $rootScope, $state, $stateParams, $location, l
// browser. This seems to be caused by #maintainUrlQueryState // browser. This seems to be caused by #maintainUrlQueryState
// where we set the search via $location.search. // where we set the search via $location.search.
queryProps = $location.search()['query_props']; queryProps = $location.search()['query_props'];
var projectPath = '';
if ($scope.projectIdentifier) {
projectPath = PathHelper.projectPath($scope.projectIdentifier);
}
$state.go('work-packages.show.activity', $state.go('work-packages.show.activity', {
{ projectPath: $scope.projectIdentifier || '',
projectPath: projectPath, workPackageId: id,
workPackageId: id, 'query_props': queryProps
'query_props': queryProps });
});
}; };
$scope.getFilterCount = function() { $scope.getFilterCount = function() {

Loading…
Cancel
Save