From 51548b31815c6f96f314ae96588a9adca150519d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Nov 2017 10:10:41 +0100 Subject: Add follow tabs Following Follow Followers --- .../friends/friend-list/friend-list.component.html | 29 -------- .../friends/friend-list/friend-list.component.scss | 3 - .../friends/friend-list/friend-list.component.ts | 87 ---------------------- client/src/app/+admin/friends/friend-list/index.ts | 1 - 4 files changed, 120 deletions(-) delete mode 100644 client/src/app/+admin/friends/friend-list/friend-list.component.html delete mode 100644 client/src/app/+admin/friends/friend-list/friend-list.component.scss delete mode 100644 client/src/app/+admin/friends/friend-list/friend-list.component.ts delete mode 100644 client/src/app/+admin/friends/friend-list/index.ts (limited to 'client/src/app/+admin/friends/friend-list') diff --git a/client/src/app/+admin/friends/friend-list/friend-list.component.html b/client/src/app/+admin/friends/friend-list/friend-list.component.html deleted file mode 100644 index df5a570fd..000000000 --- a/client/src/app/+admin/friends/friend-list/friend-list.component.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
-

Friends list

- - - - - - - - - - - - - - - - Quit friends - - - - Make friends - -
-
diff --git a/client/src/app/+admin/friends/friend-list/friend-list.component.scss b/client/src/app/+admin/friends/friend-list/friend-list.component.scss deleted file mode 100644 index 0a0f621c6..000000000 --- a/client/src/app/+admin/friends/friend-list/friend-list.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.btn { - margin-top: 10px; -} diff --git a/client/src/app/+admin/friends/friend-list/friend-list.component.ts b/client/src/app/+admin/friends/friend-list/friend-list.component.ts deleted file mode 100644 index 3fa8ef19f..000000000 --- a/client/src/app/+admin/friends/friend-list/friend-list.component.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Component, OnInit } from '@angular/core' - -import { NotificationsService } from 'angular2-notifications' -import { SortMeta } from 'primeng/primeng' - -import { ConfirmService } from '../../../core' -import { RestTable, RestPagination } from '../../../shared' -import { Pod } from '../../../../../../shared' -import { FriendService } from '../shared' - -@Component({ - selector: 'my-friend-list', - templateUrl: './friend-list.component.html', - styleUrls: ['./friend-list.component.scss'] -}) -export class FriendListComponent extends RestTable implements OnInit { - friends: Pod[] = [] - totalRecords = 0 - rowsPerPage = 10 - sort: SortMeta = { field: 'createdAt', order: 1 } - pagination: RestPagination = { count: this.rowsPerPage, start: 0 } - - constructor ( - private notificationsService: NotificationsService, - private confirmService: ConfirmService, - private friendService: FriendService - ) { - super() - } - - ngOnInit () { - this.loadData() - } - - hasFriends () { - return this.friends.length !== 0 - } - - quitFriends () { - const confirmMessage = 'Do you really want to quit your friends? All their videos will be deleted.' - this.confirmService.confirm(confirmMessage, 'Quit friends').subscribe( - res => { - if (res === false) return - - this.friendService.quitFriends().subscribe( - status => { - this.notificationsService.success('Success', 'Friends left!') - this.loadData() - }, - - err => this.notificationsService.error('Error', err.message) - ) - } - ) - } - - removeFriend (friend: Pod) { - const confirmMessage = 'Do you really want to remove this friend ? All its videos will be deleted.' - - this.confirmService.confirm(confirmMessage, 'Remove').subscribe( - res => { - if (res === false) return - - this.friendService.removeFriend(friend).subscribe( - status => { - this.notificationsService.success('Success', 'Friend removed') - this.loadData() - }, - - err => this.notificationsService.error('Error', err.message) - ) - } - ) - } - - protected loadData () { - this.friendService.getFollowing(this.pagination, this.sort) - .subscribe( - resultList => { - this.friends = resultList.data - this.totalRecords = resultList.total - }, - - err => this.notificationsService.error('Error', err.message) - ) - } -} diff --git a/client/src/app/+admin/friends/friend-list/index.ts b/client/src/app/+admin/friends/friend-list/index.ts deleted file mode 100644 index c9cbd2800..000000000 --- a/client/src/app/+admin/friends/friend-list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './friend-list.component' -- cgit v1.2.3