|
|
@ -31,11 +31,24 @@ angular.module('openproject') |
|
|
|
.config([ |
|
|
|
.config([ |
|
|
|
'$stateProvider', |
|
|
|
'$stateProvider', |
|
|
|
'$urlRouterProvider', |
|
|
|
'$urlRouterProvider', |
|
|
|
function($stateProvider, $urlRouterProvider) { |
|
|
|
'$urlMatcherFactoryProvider', |
|
|
|
|
|
|
|
function($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvider) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function() { |
|
|
|
|
|
|
|
function valToString(val) { return val !== null ? val.toString() : val; } |
|
|
|
|
|
|
|
function valFromString(val) { return val !== null ? val.toString() : val; } |
|
|
|
|
|
|
|
function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); } |
|
|
|
|
|
|
|
$urlMatcherFactoryProvider.type('projectPathType', { |
|
|
|
|
|
|
|
encode: valToString, |
|
|
|
|
|
|
|
decode: valFromString, |
|
|
|
|
|
|
|
is: regexpMatches, |
|
|
|
|
|
|
|
pattern: /.*/ |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
$stateProvider |
|
|
|
$stateProvider |
|
|
|
.state('work-packages', { |
|
|
|
.state('work-packages', { |
|
|
|
url: '{projectPath:.*}/work_packages?query_id', |
|
|
|
url: '{projectPath:projectPathType}/work_packages?query_id', |
|
|
|
abstract: true, |
|
|
|
abstract: true, |
|
|
|
templateUrl: "/templates/work_packages.html", |
|
|
|
templateUrl: "/templates/work_packages.html", |
|
|
|
controller: 'WorkPackagesController', |
|
|
|
controller: 'WorkPackagesController', |
|
|
|