export type SortField = 'name' | '-name'
| 'duration' | '-duration'
- | 'createdAt' | '-createdAt';
+ | 'createdAt' | '-createdAt'
+ | 'views' | '-views'
+ | 'likes' | '-likes';
+
styleUrls: [ './video-list.component.scss' ],
templateUrl: './video-list.component.html'
})
-
export class VideoListComponent implements OnInit, OnDestroy {
loading: BehaviorSubject<boolean> = new BehaviorSubject(false);
pagination: RestPagination = {
@Input() currentSort: SortField;
- sortChoices = {
+ sortChoices: { [ id: SortField ]: string } = {
'name': 'Name - Asc',
'-name': 'Name - Desc',
'duration': 'Duration - Asc',
'createdAt': 'Created Date - Asc',
'-createdAt': 'Created Date - Desc',
'views': 'Views - Asc',
- '-views': 'Views - Desc'
+ '-views': 'Views - Desc',
+ 'likes': 'Likes - Asc',
+ '-likes': 'Likes - Desc'
};
get choiceKeys() {
const SORTABLE_COLUMNS = {
USERS: [ 'id', 'username', 'createdAt' ],
VIDEO_ABUSES: [ 'id', 'createdAt' ],
- VIDEOS: [ 'name', 'duration', 'createdAt', 'views' ]
+ VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ]
}
const OAUTH_LIFETIME = {