]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/followers-list/followers-list.component.ts
Fix accessibility action buttons and display on imports and followers list
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / followers-list / followers-list.component.ts
index b78cdf656edfd76b3f2c94d341dd87c72553ced0..63135f898212a9dbb6b5eaa1b8dd57223da2cc52 100644 (file)
@@ -1,28 +1,26 @@
+import { SortMeta } from 'primeng/api'
 import { Component, OnInit } from '@angular/core'
-import { ConfirmService, Notifier } from '@app/core'
-import { SortMeta } from 'primeng/primeng'
-import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
-import { RestPagination, RestTable } from '../../../shared'
-import { FollowService } from '../shared'
+import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
+import { InstanceFollowService } from '@app/shared/shared-instance'
 import { I18n } from '@ngx-translate/i18n-polyfill'
+import { ActorFollow } from '@shared/models'
 
 @Component({
   selector: 'my-followers-list',
   templateUrl: './followers-list.component.html',
-  styleUrls: [ './followers-list.component.scss' ]
+  styleUrls: [ '../follows.component.scss', './followers-list.component.scss' ]
 })
 export class FollowersListComponent extends RestTable implements OnInit {
   followers: ActorFollow[] = []
   totalRecords = 0
-  rowsPerPage = 10
-  sort: SortMeta = { field: 'createdAt', order: 1 }
+  sort: SortMeta = { field: 'createdAt', order: -1 }
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
   constructor (
     private confirmService: ConfirmService,
     private notifier: Notifier,
     private i18n: I18n,
-    private followService: FollowService
+    private followService: InstanceFollowService
   ) {
     super()
   }
@@ -31,6 +29,10 @@ export class FollowersListComponent extends RestTable implements OnInit {
     this.initialize()
   }
 
+  getIdentifier () {
+    return 'FollowersListComponent'
+  }
+
   acceptFollower (follow: ActorFollow) {
     follow.state = 'accepted'
 
@@ -88,7 +90,7 @@ export class FollowersListComponent extends RestTable implements OnInit {
   }
 
   protected loadData () {
-    this.followService.getFollowers(this.pagination, this.sort, this.search)
+    this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search })
                       .subscribe(
                         resultList => {
                           this.followers = resultList.data