File tree Expand file tree Collapse file tree 2 files changed +55
-1
lines changed Expand file tree Collapse file tree 2 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -1443,6 +1443,23 @@ const deploymentCatalogueChildren = customWrapRoute({
14431443 } ,
14441444} ) ;
14451445
1446+ const obsoleteUrlDeployments = customWrapRoute ( {
1447+ parent : rootLayout ,
1448+ path : 'deployments' ,
1449+ component : {
1450+ eagerLoad : true ,
1451+ render : Navigate ,
1452+ props : {
1453+ to : surgeOverview . absolutePath ,
1454+ } ,
1455+ } ,
1456+ wrapperComponent : Auth ,
1457+ context : {
1458+ title : 'Surge Overview' ,
1459+ visibility : 'anything' ,
1460+ } ,
1461+ } ) ;
1462+
14461463export default {
14471464 surgeLayout,
14481465 surgeOverview,
@@ -1537,4 +1554,5 @@ export default {
15371554 deploymentCatalogueIndex,
15381555 deploymentCatalogueChildren,
15391556 deploymentOthers,
1557+ obsoleteUrlDeployments,
15401558} ;
Original file line number Diff line number Diff line change 1- import { Navigate } from 'react-router-dom' ;
1+ import {
2+ Navigate ,
3+ useParams ,
4+ } from 'react-router-dom' ;
25
36import { unwrapRoute } from '#utils/routes' ;
47
@@ -1187,6 +1190,38 @@ const preparednessOperationalLearning = customWrapRoute({
11871190 } ,
11881191} ) ;
11891192
1193+ // eslint-disable-next-line
1194+ function ObsoleteFieldReportRedirection ( ) {
1195+ const params = useParams < {
1196+ fieldReportId : string ,
1197+ } > ( ) ;
1198+
1199+ // eslint-disable-next-line
1200+ const to = '/field-reports/' + params . fieldReportId ;
1201+
1202+ return (
1203+ < Navigate
1204+ to = { to }
1205+ replace
1206+ />
1207+ ) ;
1208+ }
1209+
1210+ const obsoleteFieldReportDetails = customWrapRoute ( {
1211+ parent : rootLayout ,
1212+ path : 'reports/:fieldReportId' ,
1213+ component : {
1214+ eagerLoad : true ,
1215+ render : ObsoleteFieldReportRedirection ,
1216+ props : { } ,
1217+ } ,
1218+ wrapperComponent : Auth ,
1219+ context : {
1220+ title : 'Field Report Details' ,
1221+ visibility : 'anything' ,
1222+ } ,
1223+ } ) ;
1224+
11901225const wrappedRoutes = {
11911226 fourHundredFour,
11921227 rootLayout,
@@ -1273,6 +1308,7 @@ const wrappedRoutes = {
12731308
12741309 // Redirects
12751310 preparednessOperationalLearning,
1311+ obsoleteFieldReportDetails,
12761312} ;
12771313
12781314export const unwrappedRoutes = unwrapRoute ( Object . values ( wrappedRoutes ) ) ;
You can’t perform that action at this time.
0 commit comments