Merge "Support project name in project detail URLs"

This commit is contained in:
Zuul 2018-06-20 20:00:09 +00:00 committed by Gerrit Code Review
commit bfeda58768
2 changed files with 11 additions and 3 deletions

View File

@ -34,8 +34,16 @@ angular.module('sb.projects').controller('ProjectDetailController',
// Parse the ID
var id = $stateParams.hasOwnProperty('id') ?
parseInt($stateParams.id, 10) :
null;
$stateParams.id : null;
if (!isNaN(id)) {
id = parseInt(id, 10);
}
if (id === null) {
$state.go('sb.index');
return;
}
/**
* UI flag for when we're initially loading the view.

View File

@ -44,7 +44,7 @@ angular.module('sb.projects',
controller: 'ProjectListController'
})
.state('sb.project.detail', {
url: '/{id:[0-9]+}',
url: '/{id:any}',
templateUrl: 'app/projects/template/detail.html',
controller: 'ProjectDetailController'
});