import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
-import { NotificationsService } from 'angular2-notifications'
import { fromEvent, Observable, Subscription } from 'rxjs'
import { AuthService } from '../../core/auth'
import { ComponentPagination } from '../rest/component-pagination.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
+import { Syndication } from '@app/shared/video/syndication.model'
+import { Notifier } from '@app/core'
export abstract class AbstractVideoList implements OnInit, OnDestroy {
private static LINES_PER_PAGE = 4
sort: VideoSortField = '-publishedAt'
categoryOneOf?: number
defaultSort: VideoSortField = '-publishedAt'
- syndicationItems: any = []
+ syndicationItems: Syndication[] = []
loadOnInit = true
marginContent = true
ownerDisplayType: OwnerDisplayType = 'account'
firstLoadedPage: number
displayModerationBlock = false
+ titleTooltip: string
- protected baseVideoWidth = 215
- protected baseVideoHeight = 205
+ protected baseVideoWidth = 238
+ protected baseVideoHeight = 225
- protected abstract notificationsService: NotificationsService
+ protected abstract notifier: Notifier
protected abstract authService: AuthService
protected abstract router: Router
protected abstract route: ActivatedRoute
private resizeSubscription: Subscription
abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}>
- abstract generateSyndicationList (): any
+ abstract generateSyndicationList (): void
get user () {
return this.authService.getUser()
},
error => {
this.loadingPage[page] = false
- this.notificationsService.error(this.i18n('Error'), error.message)
+ this.notifier.error(error.message)
}
)
}
}
protected setNewRouteParams () {
- const paramsObject: any = this.buildRouteParams()
+ const paramsObject = this.buildRouteParams()
- const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
+ const queryParams = Object.keys(paramsObject)
+ .map(p => p + '=' + paramsObject[p])
+ .join('&')
this.location.replaceState(this.currentRoute, queryParams)
}