1
- /* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
1
+ /* eslint-disable ember/no-computed-properties-in-native-classes */
2
2
import { computed } from '@ember/object' ;
3
3
import { inject as service } from '@ember/service' ;
4
4
import { readOnly , alias } from '@ember/object/computed' ;
@@ -44,12 +44,12 @@ export default class ProjectVersionController extends Controller {
44
44
45
45
@computed ( 'model.id' )
46
46
get moduleIDs ( ) {
47
- return this . getModuleRelationships ( this . get ( ' model.id' ) , 'modules' ) ;
47
+ return this . getModuleRelationships ( this . model . id , 'modules' ) ;
48
48
}
49
49
50
50
@computed ( 'model.id' )
51
51
get publicModuleIDs ( ) {
52
- return this . getModuleRelationships ( this . get ( ' model.id' ) , 'public-modules' ) ;
52
+ return this . getModuleRelationships ( this . model . id , 'public-modules' ) ;
53
53
}
54
54
55
55
getModuleRelationships ( versionId , moduleType ) {
@@ -65,6 +65,7 @@ export default class ProjectVersionController extends Controller {
65
65
}
66
66
67
67
getRelationshipIDs ( relationship ) {
68
+ // eslint-disable-next-line
68
69
const splitPoint = 2 + this . get ( 'model.project.id' ) . split ( '-' ) . length - 1 ;
69
70
const classes = this . model . hasMany ( relationship ) ;
70
71
const sorted = A ( classes . ids ( ) ) . sort ( ) ;
@@ -94,9 +95,8 @@ export default class ProjectVersionController extends Controller {
94
95
95
96
@computed ( 'metaStore.availableProjectVersions' , 'model.project.id' )
96
97
get projectVersions ( ) {
97
- const projectVersions = this . get ( 'metaStore.availableProjectVersions' ) [
98
- this . get ( 'model.project.id' )
99
- ] ;
98
+ const projectVersions =
99
+ this . metaStore . availableProjectVersions [ this . model . project . get ( 'id' ) ] ;
100
100
let versions = projectVersions . sort ( ( a , b ) => semverCompare ( b , a ) ) ;
101
101
102
102
versions = versions . map ( ( version ) => {
@@ -116,9 +116,7 @@ export default class ProjectVersionController extends Controller {
116
116
117
117
@computed ( 'projectVersions.[]' , 'model.version' )
118
118
get selectedProjectVersion ( ) {
119
- return this . projectVersions . filter (
120
- ( pV ) => pV . id === this . get ( 'model.version' )
121
- ) [ 0 ] ;
119
+ return this . projectVersions . filter ( ( pV ) => pV . id === this . model . version ) [ 0 ] ;
122
120
}
123
121
124
122
@readOnly ( 'model.project.id' )
0 commit comments