aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows/following-list
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/follows/following-list')
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.html16
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts40
-rw-r--r--client/src/app/+admin/follows/following-list/index.ts1
3 files changed, 57 insertions, 0 deletions
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html
new file mode 100644
index 000000000..fbcebfaa7
--- /dev/null
+++ b/client/src/app/+admin/follows/following-list/following-list.component.html
@@ -0,0 +1,16 @@
1<div class="row">
2 <div class="content-padding">
3 <h3>Following list</h3>
4
5 <p-dataTable
6 [value]="following" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
7 sortField="createdAt" (onLazyLoad)="loadLazy($event)"
8 >
9 <p-column field="id" header="ID"></p-column>
10 <p-column field="host" header="Host"></p-column>
11 <p-column field="email" header="Email"></p-column>
12 <p-column field="score" header="Score"></p-column>
13 <p-column field="createdAt" header="Created date" [sortable]="true"></p-column>
14 </p-dataTable>
15 </div>
16</div>
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
new file mode 100644
index 000000000..7d2c5084b
--- /dev/null
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -0,0 +1,40 @@
1import { Component, OnInit } from '@angular/core'
2
3import { NotificationsService } from 'angular2-notifications'
4import { SortMeta } from 'primeng/primeng'
5
6import { ConfirmService } from '../../../core'
7import { RestTable, RestPagination } from '../../../shared'
8import { Pod } from '../../../../../../shared'
9import { FollowService } from '../shared'
10
11@Component({
12 selector: 'my-followers-list',
13 templateUrl: './following-list.component.html'
14})
15export class FollowingListComponent extends RestTable {
16 following: Pod[] = []
17 totalRecords = 0
18 rowsPerPage = 10
19 sort: SortMeta = { field: 'createdAt', order: 1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21
22 constructor (
23 private notificationsService: NotificationsService,
24 private followService: FollowService
25 ) {
26 super()
27 }
28
29 protected loadData () {
30 this.followService.getFollowing(this.pagination, this.sort)
31 .subscribe(
32 resultList => {
33 this.following = resultList.data
34 this.totalRecords = resultList.total
35 },
36
37 err => this.notificationsService.error('Error', err.message)
38 )
39 }
40}
diff --git a/client/src/app/+admin/follows/following-list/index.ts b/client/src/app/+admin/follows/following-list/index.ts
new file mode 100644
index 000000000..a70d46a7e
--- /dev/null
+++ b/client/src/app/+admin/follows/following-list/index.ts
@@ -0,0 +1 @@
export * from './following-list.component'