Skip to content

Commit

Permalink
Make general dc path less important
Browse files Browse the repository at this point in the history
  • Loading branch information
John Holt authored and John Holt committed Jul 3, 2023
1 parent fe6fcab commit 9ad8cc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion client/src/js/modules/dc/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ define(['utils/lazyrouter'], function(LazyRouter) {
var Router = LazyRouter.extend({
appRoutes: {
'dc': 'dc_list',
'dc(/visit/:visit)(:pathmatch)': 'dc_list',

'dc/view/id/:id': 'di_viewer',
'dc/map/id/:id/aid/:aid': 'mapmodelviewer',
'dc/rsv/id/:id': 'rsviewer',
'dc/summary/visit/:visit': 'summary',
'dc/apstatussummary/visit/:visit(/ty/:ty)': 'apstatussummary',
'dc/sc/visit/:visit': 'sampleChanger',
'dc/queue/visit/:visit': 'queue',
'dc(/visit/:visit)(:pathmatch)': 'dc_list',
},

loadEvents: ['dclist:show', 'dc:show'],
Expand Down
30 changes: 15 additions & 15 deletions client/src/js/modules/dc/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@ function lookupVisit(visit) {
// Search probably has no value with an id (i.e. individual data collection) or probably dcg either.
// The DC component handles the prefetching and proposal lookup in a cleaner method than using marionette wrapper directly
let routes = [
{
path: '/dc(/visit/)?:visit([a-zA-Z]{2}[0-9]+-[0-9]+)?:pathMatch(.*)*',
name: 'dc-list',
component: DCWrapper,
props: route => ({
id: +RoutesUtil.getParamValue(route.params.pathMatch, 'id') || null,
visit: route.params.visit || '',
dcg: +RoutesUtil.getParamValue(route.params.pathMatch, 'dcg') || null,
page: +RoutesUtil.getParamValue(route.params.pathMatch, 'page') || 1,
ty: RoutesUtil.getParamValue(route.params.pathMatch, 'ty') || '',
search: RoutesUtil.getParamValue(route.params.pathMatch, 's') || '',
pjid: +RoutesUtil.getParamValue(route.params.pathMatch, 'pjid') || null,
sgid: +RoutesUtil.getParamValue(route.params.pathMatch, 'sgid') || null
}),
},
{
path: '/dc/map/id/:id([0-9]+)(/aid/)?:aid([0-9]+)?',
name: 'dc-mapmodelviewer',
Expand All @@ -125,6 +110,21 @@ let routes = [
id: +route.params.id || null,
}),
},
{
path: '/dc(/visit/)?:visit([a-zA-Z]{2}[0-9]+-[0-9]+)?:pathMatch(.*)*',
name: 'dc-list',
component: DCWrapper,
props: route => ({
id: +RoutesUtil.getParamValue(route.params.pathMatch, 'id') || null,
visit: route.params.visit || '',
dcg: +RoutesUtil.getParamValue(route.params.pathMatch, 'dcg') || null,
page: +RoutesUtil.getParamValue(route.params.pathMatch, 'page') || 1,
ty: RoutesUtil.getParamValue(route.params.pathMatch, 'ty') || '',
search: RoutesUtil.getParamValue(route.params.pathMatch, 's') || '',
pjid: +RoutesUtil.getParamValue(route.params.pathMatch, 'pjid') || null,
sgid: +RoutesUtil.getParamValue(route.params.pathMatch, 'sgid') || null
}),
},
{
path: '/dc/summary/visit/:visit([a-zA-Z]{2}[0-9]+-[0-9]+)',
name: 'dc-summary',
Expand Down

0 comments on commit 9ad8cc8

Please sign in to comment.