1
1
import { AppSubdomain , EnvironmentConfig } from '../../config'
2
- import { authUrlLogin , lazyLoad , LazyLoadedComponent , PlatformRoute } from '../../lib'
2
+ import { authUrlLogin , lazyLoad , LazyLoadedComponent , PlatformRoute , Rewrite } from '../../lib'
3
3
4
4
import { toolTitle } from './Learn'
5
5
import { LearnConfig } from './learn-config'
@@ -23,7 +23,7 @@ const MyCertificate: LazyLoadedComponent = lazyLoad(() => import('./course-certi
23
23
const UserCertificate : LazyLoadedComponent = lazyLoad ( ( ) => import ( './course-certificate' ) , 'UserCertificate' )
24
24
const FreeCodeCamp : LazyLoadedComponent = lazyLoad ( ( ) => import ( './free-code-camp' ) , 'FreeCodeCamp' )
25
25
const MyLearning : LazyLoadedComponent = lazyLoad ( ( ) => import ( './my-learning' ) , 'MyLearning' )
26
- const LandingLearn : LazyLoadedComponent = lazyLoad ( ( ) => import ( './Learn' ) )
26
+ const LearnRootPage : LazyLoadedComponent = lazyLoad ( ( ) => import ( './Learn' ) )
27
27
const UserTCACertificate : LazyLoadedComponent = lazyLoad ( ( ) => import ( './tca-certificate' ) , 'CertificateView' )
28
28
29
29
const ValidateTCACertificate : LazyLoadedComponent
@@ -131,7 +131,7 @@ export function getTCACertificateUrl(
131
131
export function getTCACertificationValidationUrl (
132
132
completionUuid : string ,
133
133
) : string {
134
- return `${ absoluteRootRoute } /${ completionUuid } `
134
+ return `${ absoluteRootRoute } /certificate/ ${ completionUuid } `
135
135
}
136
136
137
137
export function getTCAUserCertificationUrl (
@@ -151,6 +151,15 @@ export function getAuthenticateAndEnrollRoute(): string {
151
151
return `${ authUrlLogin ( ) } ${ encodeURIComponent ( LEARN_PATHS . tcaEnroll ) } `
152
152
}
153
153
154
+ const oldUrlRedirectRoute : ReadonlyArray < PlatformRoute > = EnvironmentConfig . SUBDOMAIN === AppSubdomain . tca ? [
155
+ {
156
+ children : [ ] ,
157
+ element : < Rewrite to = '/*' /> ,
158
+ id : 'redirect-old-url' ,
159
+ route : '/learn/*' ,
160
+ } ,
161
+ ] : [ ]
162
+
154
163
export const learnRoutes : ReadonlyArray < PlatformRoute > = [
155
164
{
156
165
children : [
@@ -225,7 +234,7 @@ export const learnRoutes: ReadonlyArray<PlatformRoute> = [
225
234
children : [ ] ,
226
235
element : < ValidateTCACertificate /> ,
227
236
id : 'Hiring manager view - uuid param' ,
228
- route : ':completionUuid' ,
237
+ route : 'certificate/ :completionUuid' ,
229
238
} ,
230
239
{
231
240
children : [ ] ,
@@ -239,9 +248,10 @@ export const learnRoutes: ReadonlyArray<PlatformRoute> = [
239
248
id : 'Giring manager preview' ,
240
249
route : 'tca-certifications/:certification/preview' ,
241
250
} ,
251
+ ...oldUrlRedirectRoute ,
242
252
] ,
243
253
domain : AppSubdomain . tca ,
244
- element : < LandingLearn /> ,
254
+ element : < LearnRootPage /> ,
245
255
id : toolTitle ,
246
256
route : rootRoute ,
247
257
} ,
0 commit comments