Support project name in project detail URLs
This commit adds support for navigating to a URL like https://storyboard.openstack.org/#!/project/openstack-infra/storyboard in order to go to the StoryBoard project view. There are some caveats, for a project named `list` or `search` this will not work correctly. Change-Id: Ia6b90e630c57b46abbe925706679efc5c6afcb27 Story: 52 Story: 107 Task: 67 Task: 165
This commit is contained in:
parent
52cbe7c07b
commit
055b8bb708
@ -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.
|
||||
|
@ -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'
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user