File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,42 @@ function configRoutes() {
213213 permission : 'VIEW_PORTFOLIO' ,
214214 } ,
215215 } ,
216+ {
217+ path : 'projects/:name/:version/*' ,
218+ name : 'Project By Name and Version' ,
219+ beforeEnter : ( to , from , next ) => {
220+ const searchParams = new URLSearchParams ( {
221+ name : to . params . name ,
222+ version : to . params . version ,
223+ } ) ;
224+ router . app . axios
225+ . get (
226+ `${ router . app . $api . BASE_URL } /${ router . app . $api . URL_PROJECT_LOOKUP } ?${ searchParams } ` ,
227+ )
228+ . then ( ( result ) => {
229+ const trailingPathSegments = to . params . pathMatch
230+ ? `/${ to . params . pathMatch } `
231+ : '' ;
232+ next ( {
233+ path : `projects/${ result . data . uuid } ${ trailingPathSegments } ` ,
234+ replace : true ,
235+ } ) ;
236+ } )
237+ . catch ( ( ) => {
238+ next ( {
239+ name : '404' ,
240+ replace : true ,
241+ } ) ;
242+ } ) ;
243+ } ,
244+ meta : {
245+ permission : 'VIEW_PORTFOLIO' ,
246+ } ,
247+ } ,
248+ {
249+ path : 'projects/:name/:version' ,
250+ redirect : 'projects/:name/:version/' ,
251+ } ,
216252 {
217253 path : 'components' ,
218254 name : 'Component Lookup' ,
Original file line number Diff line number Diff line change 4141 "URL_POLICY_VIOLATION" : " api/v1/violation" ,
4242 "URL_POLICY_VIOLATION_ANALYSIS" : " api/v1/violation/analysis" ,
4343 "URL_PROJECT" : " api/v1/project" ,
44+ "URL_PROJECT_LOOKUP" : " api/v1/project/lookup" ,
4445 "URL_REPOSITORY" : " api/v1/repository" ,
4546 "URL_SEARCH" : " api/v1/search" ,
4647 "URL_SERVICE" : " api/v1/service" ,
You can’t perform that action at this time.
0 commit comments