From 9104a9a9ac9e8f5875dc8b864a5a48c2f43b7a07 Mon Sep 17 00:00:00 2001 From: Mihail Maxacov <0xf013@gmail.com> Date: Tue, 24 Feb 2015 18:24:04 +0200 Subject: [PATCH] most likely fixes the slashes encoding for the new ui.router version --- frontend/app/routing.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frontend/app/routing.js b/frontend/app/routing.js index 2674574458..a43290126d 100644 --- a/frontend/app/routing.js +++ b/frontend/app/routing.js @@ -31,11 +31,24 @@ angular.module('openproject') .config([ '$stateProvider', '$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 .state('work-packages', { - url: '{projectPath:.*}/work_packages?query_id', + url: '{projectPath:projectPathType}/work_packages?query_id', abstract: true, templateUrl: "/templates/work_packages.html", controller: 'WorkPackagesController',