@@ -24,7 +24,7 @@ export default class ProjectVersionRoute extends Route {
24
24
projectService ;
25
25
26
26
titleToken ( model ) {
27
- return model . get ( ' version' ) ;
27
+ return model . version ;
28
28
}
29
29
30
30
async model ( { project, project_version } ) {
@@ -68,8 +68,7 @@ export default class ProjectVersionRoute extends Route {
68
68
) ;
69
69
let isLatestVersion =
70
70
transitionVersion === latestVersion || transitionVersion === 'release' ;
71
- let shouldConvertPackages =
72
- semverCompare ( model . get ( 'version' ) , '2.16' ) < 0 ;
71
+ let shouldConvertPackages = semverCompare ( model . version , '2.16' ) < 0 ;
73
72
if ( ! shouldConvertPackages || isLatestVersion ) {
74
73
// ... and the transition version is the latest release,
75
74
// display the landing page at
@@ -111,17 +110,17 @@ export default class ProjectVersionRoute extends Route {
111
110
}
112
111
113
112
_gatherHeadDataFromVersion ( model , projectVersion ) {
114
- this . set ( ' headData.isRelease' , projectVersion === 'release' ) ;
115
- this . set ( ' headData.compactVersion' , model . get ( 'compactVersion' ) ) ;
116
- this . set ( ' headData.urlVersion' , projectVersion ) ;
117
- if ( ! this . get ( ' headData.isRelease' ) ) {
118
- let request = this . get ( ' fastboot.request' ) ;
119
- let href = this . get ( ' fastboot.isFastBoot' )
113
+ this . headData . isRelease = projectVersion === 'release' ;
114
+ this . headData . compactVersion = model . get ( 'compactVersion' ) ;
115
+ this . headData . urlVersion = projectVersion ;
116
+ if ( ! this . headData . isRelease ) {
117
+ let request = this . fastboot . request ;
118
+ let href = this . fastboot . isFastBoot
120
119
? `${ config . APP . domain } /${ request . path } `
121
120
: window . location . href ;
122
121
let version = new RegExp ( model . get ( 'compactVersion' ) , 'g' ) ;
123
122
let canonicalUrl = href . replace ( version , 'release' ) ;
124
- this . set ( ' headData.canonicalUrl' , canonicalUrl ) ;
123
+ this . headData . canonicalUrl = canonicalUrl ;
125
124
}
126
125
}
127
126
@@ -215,7 +214,7 @@ export default class ProjectVersionRoute extends Route {
215
214
// to the home page instead of trying to translate the url
216
215
let shouldConvertPackages = this . shouldConvertPackages (
217
216
ver ,
218
- this . get ( ' projectService.version' )
217
+ this . projectService . version
219
218
) ;
220
219
let isEmberProject = project === 'ember' ;
221
220
if ( ! isEmberProject || ! shouldConvertPackages ) {
@@ -246,7 +245,7 @@ export default class ProjectVersionRoute extends Route {
246
245
let encodedModule = moduleRevs [ 0 ]
247
246
. split ( '-' )
248
247
. reduce ( ( result , val , index , arry ) => {
249
- if ( val === this . get ( ' projectService.version' ) ) {
248
+ if ( val === this . projectService . version ) {
250
249
return arry . slice ( index + 1 ) . join ( '-' ) ;
251
250
}
252
251
return result ;
0 commit comments