File tree 1 file changed +7
-13
lines changed
app/components/user-page/course-progress-list-item
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -36,29 +36,23 @@ export default class CourseProgressListItemComponent extends Component {
36
36
}
37
37
}
38
38
39
- @action
40
-
41
- navigateToCourse ( ) {
42
- this . router . transitionTo ( 'course-overview' , this . course . slug ) ;
43
- }
44
-
45
39
get languagesToDisplay ( ) {
46
40
const completedParticipations = this . completedCourseParticipations . sort (
47
- ( a , b ) => new Date ( b . completedAt ) . getTime ( ) - new Date ( a . completedAt ) . getTime ( )
41
+ ( a , b ) => new Date ( b . completedAt ) . getTime ( ) - new Date ( a . completedAt ) . getTime ( ) ,
48
42
) ;
49
-
50
43
const incompleteParticipations = this . args . courseParticipations
51
- . filter ( p => ! p . isCompleted )
44
+ . filter ( ( p ) => ! p . isCompleted )
52
45
. sort ( ( a , b ) => new Date ( b . lastSubmissionAt ) . getTime ( ) - new Date ( a . lastSubmissionAt ) . getTime ( ) ) ;
53
46
54
47
if ( completedParticipations . length >= MAX_LANGUAGES_TO_DISPLAY ) {
55
48
return completedParticipations . slice ( 0 , MAX_LANGUAGES_TO_DISPLAY ) ;
56
49
}
57
50
58
- return [
59
- ...completedParticipations ,
60
- ...incompleteParticipations . slice ( 0 , MAX_LANGUAGES_TO_DISPLAY - completedParticipations . length )
61
- ] ;
51
+ return [ ...completedParticipations , ...incompleteParticipations . slice ( 0 , MAX_LANGUAGES_TO_DISPLAY - completedParticipations . length ) ] ;
62
52
}
63
53
54
+ @action
55
+ navigateToCourse ( ) {
56
+ this . router . transitionTo ( 'course-overview' , this . course . slug ) ;
57
+ }
64
58
}
You can’t perform that action at this time.
0 commit comments