aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/friends/friend-list
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
commitdf98563e2104b82b119c00a3cd83cd0dc1242d25 (patch)
treea9720bf01bac9ad5646bd3d3c9bc7653617afdad /client/src/app/+admin/friends/friend-list
parent46757b477c1adb5f98060d15998a3852e18902a6 (diff)
downloadPeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.gz
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.zst
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.zip
Use typescript standard and lint all files
Diffstat (limited to 'client/src/app/+admin/friends/friend-list')
-rw-r--r--client/src/app/+admin/friends/friend-list/friend-list.component.ts38
-rw-r--r--client/src/app/+admin/friends/friend-list/index.ts2
2 files changed, 20 insertions, 20 deletions
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
index 525a9fbc3..7bf9d2c6b 100644
--- a/client/src/app/+admin/friends/friend-list/friend-list.component.ts
+++ b/client/src/app/+admin/friends/friend-list/friend-list.component.ts
@@ -1,11 +1,11 @@
1import { Component } from '@angular/core'; 1import { Component } from '@angular/core'
2 2
3import { NotificationsService } from 'angular2-notifications'; 3import { NotificationsService } from 'angular2-notifications'
4import { ServerDataSource } from 'ng2-smart-table'; 4import { ServerDataSource } from 'ng2-smart-table'
5 5
6import { ConfirmService } from '../../../core'; 6import { ConfirmService } from '../../../core'
7import { Utils } from '../../../shared'; 7import { Utils } from '../../../shared'
8import { Friend, FriendService } from '../shared'; 8import { Friend, FriendService } from '../shared'
9 9
10@Component({ 10@Component({
11 selector: 'my-friend-list', 11 selector: 'my-friend-list',
@@ -13,7 +13,7 @@ import { Friend, FriendService } from '../shared';
13 styleUrls: [ './friend-list.component.scss' ] 13 styleUrls: [ './friend-list.component.scss' ]
14}) 14})
15export class FriendListComponent { 15export class FriendListComponent {
16 friendsSource = null; 16 friendsSource = null
17 tableSettings = { 17 tableSettings = {
18 attr: { 18 attr: {
19 class: 'table-hover' 19 class: 'table-hover'
@@ -49,36 +49,36 @@ export class FriendListComponent {
49 valuePrepareFunction: Utils.dateToHuman 49 valuePrepareFunction: Utils.dateToHuman
50 } 50 }
51 } 51 }
52 }; 52 }
53 53
54 constructor( 54 constructor (
55 private notificationsService: NotificationsService, 55 private notificationsService: NotificationsService,
56 private confirmService: ConfirmService, 56 private confirmService: ConfirmService,
57 private friendService: FriendService 57 private friendService: FriendService
58 ) { 58 ) {
59 this.friendsSource = this.friendService.getDataSource(); 59 this.friendsSource = this.friendService.getDataSource()
60 } 60 }
61 61
62 hasFriends() { 62 hasFriends () {
63 return this.friendsSource.count() !== 0; 63 return this.friendsSource.count() !== 0
64 } 64 }
65 65
66 quitFriends() { 66 quitFriends () {
67 const confirmMessage = 'Do you really want to quit your friends? All their videos will be deleted.'; 67 const confirmMessage = 'Do you really want to quit your friends? All their videos will be deleted.'
68 this.confirmService.confirm(confirmMessage, 'Quit friends').subscribe( 68 this.confirmService.confirm(confirmMessage, 'Quit friends').subscribe(
69 res => { 69 res => {
70 if (res === false) return; 70 if (res === false) return
71 71
72 this.friendService.quitFriends().subscribe( 72 this.friendService.quitFriends().subscribe(
73 status => { 73 status => {
74 this.notificationsService.success('Sucess', 'Friends left!'); 74 this.notificationsService.success('Sucess', 'Friends left!')
75 75
76 this.friendsSource.refresh(); 76 this.friendsSource.refresh()
77 }, 77 },
78 78
79 err => this.notificationsService.error('Error', err.text) 79 err => this.notificationsService.error('Error', err.text)
80 ); 80 )
81 } 81 }
82 ); 82 )
83 } 83 }
84} 84}
diff --git a/client/src/app/+admin/friends/friend-list/index.ts b/client/src/app/+admin/friends/friend-list/index.ts
index 354c978a4..c9cbd2800 100644
--- a/client/src/app/+admin/friends/friend-list/index.ts
+++ b/client/src/app/+admin/friends/friend-list/index.ts
@@ -1 +1 @@
export * from './friend-list.component'; export * from './friend-list.component'