diff options
Diffstat (limited to 'client/src/app/+admin/follows/followers-list/followers-list.component.ts')
-rw-r--r-- | client/src/app/+admin/follows/followers-list/followers-list.component.ts | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index b2d333e83..6dd64fc57 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts | |||
@@ -12,7 +12,7 @@ import { ActorFollow } from '@shared/models' | |||
12 | templateUrl: './followers-list.component.html', | 12 | templateUrl: './followers-list.component.html', |
13 | styleUrls: [ './followers-list.component.scss' ] | 13 | styleUrls: [ './followers-list.component.scss' ] |
14 | }) | 14 | }) |
15 | export class FollowersListComponent extends RestTable implements OnInit { | 15 | export class FollowersListComponent extends RestTable <ActorFollow> implements OnInit { |
16 | followers: ActorFollow[] = [] | 16 | followers: ActorFollow[] = [] |
17 | totalRecords = 0 | 17 | totalRecords = 0 |
18 | sort: SortMeta = { field: 'createdAt', order: -1 } | 18 | sort: SortMeta = { field: 'createdAt', order: -1 } |
@@ -20,8 +20,7 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
20 | 20 | ||
21 | searchFilters: AdvancedInputFilter[] = [] | 21 | searchFilters: AdvancedInputFilter[] = [] |
22 | 22 | ||
23 | selectedFollows: ActorFollow[] = [] | 23 | bulkActions: DropdownAction<ActorFollow[]>[] = [] |
24 | bulkFollowsActions: DropdownAction<ActorFollow[]>[] = [] | ||
25 | 24 | ||
26 | constructor ( | 25 | constructor ( |
27 | private confirmService: ConfirmService, | 26 | private confirmService: ConfirmService, |
@@ -36,7 +35,7 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
36 | 35 | ||
37 | this.searchFilters = this.followService.buildFollowsListFilters() | 36 | this.searchFilters = this.followService.buildFollowsListFilters() |
38 | 37 | ||
39 | this.bulkFollowsActions = [ | 38 | this.bulkActions = [ |
40 | { | 39 | { |
41 | label: $localize`Reject`, | 40 | label: $localize`Reject`, |
42 | handler: follows => this.rejectFollower(follows), | 41 | handler: follows => this.rejectFollower(follows), |
@@ -105,12 +104,14 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
105 | } | 104 | } |
106 | 105 | ||
107 | async deleteFollowers (follows: ActorFollow[]) { | 106 | async deleteFollowers (follows: ActorFollow[]) { |
107 | const icuParams = { count: follows.length, followerName: this.buildFollowerName(follows[0]) } | ||
108 | |||
108 | let message = $localize`Deleted followers will be able to send again a follow request.` | 109 | let message = $localize`Deleted followers will be able to send again a follow request.` |
109 | message += '<br /><br />' | 110 | message += '<br /><br />' |
110 | 111 | ||
111 | // eslint-disable-next-line max-len | 112 | // eslint-disable-next-line max-len |
112 | message += prepareIcu($localize`Do you really want to delete {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}`)( | 113 | message += prepareIcu($localize`Do you really want to delete {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}`)( |
113 | { count: follows.length, followerName: this.buildFollowerName(follows[0]) }, | 114 | icuParams, |
114 | $localize`Do you really want to delete these follow requests?` | 115 | $localize`Do you really want to delete these follow requests?` |
115 | ) | 116 | ) |
116 | 117 | ||
@@ -122,7 +123,7 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
122 | next: () => { | 123 | next: () => { |
123 | // eslint-disable-next-line max-len | 124 | // eslint-disable-next-line max-len |
124 | const message = prepareIcu($localize`Removed {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}`)( | 125 | const message = prepareIcu($localize`Removed {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}`)( |
125 | { count: follows.length, followerName: this.buildFollowerName(follows[0]) }, | 126 | icuParams, |
126 | $localize`Follow requests removed` | 127 | $localize`Follow requests removed` |
127 | ) | 128 | ) |
128 | 129 | ||
@@ -139,10 +140,6 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
139 | return follow.follower.name + '@' + follow.follower.host | 140 | return follow.follower.name + '@' + follow.follower.host |
140 | } | 141 | } |
141 | 142 | ||
142 | isInSelectionMode () { | ||
143 | return this.selectedFollows.length !== 0 | ||
144 | } | ||
145 | |||
146 | protected reloadData () { | 143 | protected reloadData () { |
147 | this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) | 144 | this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) |
148 | .subscribe({ | 145 | .subscribe({ |