aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorBO41 <lukasw41@gmail.com>2018-10-16 01:04:50 +0200
committerRigel Kent <par@rigelk.eu>2018-10-16 01:04:50 +0200
commitdffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb (patch)
tree4c0f57248268e780804243dac46f8ae9bda96a94 /client/src/app
parent4fe98be6b421498577dc0bbcbe22c105408f394d (diff)
downloadPeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.tar.gz
PeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.tar.zst
PeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.zip
update tslint config and fix member ordering (#1279)
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.ts1
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts28
-rw-r--r--client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts24
-rw-r--r--client/src/app/search/search.component.ts3
-rw-r--r--client/src/app/shared/rest/rest-table.ts4
5 files changed, 29 insertions, 31 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts
index 07b087b5b..99ce5804b 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/users/user-edit/user-edit.ts
@@ -1,7 +1,6 @@
1import { ServerService } from '../../../core' 1import { ServerService } from '../../../core'
2import { FormReactive } from '../../../shared' 2import { FormReactive } from '../../../shared'
3import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared' 3import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared'
4import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/'
5import { ConfigService } from '@app/+admin/config/shared/config.service' 4import { ConfigService } from '@app/+admin/config/shared/config.service'
6 5
7export abstract class UserEdit extends FormReactive { 6export abstract class UserEdit extends FormReactive {
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index 33384dc35..ab2250722 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -55,20 +55,6 @@ export class UserListComponent extends RestTable implements OnInit {
55 ] 55 ]
56 } 56 }
57 57
58 protected loadData () {
59 this.selectedUsers = []
60
61 this.userService.getUsers(this.pagination, this.sort, this.search)
62 .subscribe(
63 resultList => {
64 this.users = resultList.data
65 this.totalRecords = resultList.total
66 },
67
68 err => this.notificationsService.error(this.i18n('Error'), err.message)
69 )
70 }
71
72 openBanUserModal (users: User[]) { 58 openBanUserModal (users: User[]) {
73 for (const user of users) { 59 for (const user of users) {
74 if (user.username === 'root') { 60 if (user.username === 'root') {
@@ -131,4 +117,18 @@ export class UserListComponent extends RestTable implements OnInit {
131 isInSelectionMode () { 117 isInSelectionMode () {
132 return this.selectedUsers.length !== 0 118 return this.selectedUsers.length !== 0
133 } 119 }
120
121 protected loadData () {
122 this.selectedUsers = []
123
124 this.userService.getUsers(this.pagination, this.sort, this.search)
125 .subscribe(
126 resultList => {
127 this.users = resultList.data
128 this.totalRecords = resultList.total
129 },
130
131 err => this.notificationsService.error(this.i18n('Error'), err.message)
132 )
133 }
134} 134}
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
index 520278671..0b51ac13c 100644
--- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
@@ -34,18 +34,6 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
34 this.initialize() 34 this.initialize()
35 } 35 }
36 36
37 protected loadData () {
38 return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
39 .subscribe(
40 resultList => {
41 this.videoChangeOwnerships = resultList.data
42 this.totalRecords = resultList.total
43 },
44
45 err => this.notificationsService.error(this.i18n('Error'), err.message)
46 )
47 }
48
49 createByString (account: Account) { 37 createByString (account: Account) {
50 return Account.CREATE_BY_STRING(account.name, account.host) 38 return Account.CREATE_BY_STRING(account.name, account.host)
51 } 39 }
@@ -65,4 +53,16 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
65 err => this.notificationsService.error(this.i18n('Error'), err.message) 53 err => this.notificationsService.error(this.i18n('Error'), err.message)
66 ) 54 )
67 } 55 }
56
57 protected loadData () {
58 return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
59 .subscribe(
60 resultList => {
61 this.videoChangeOwnerships = resultList.data
62 this.totalRecords = resultList.total
63 },
64
65 err => this.notificationsService.error(this.i18n('Error'), err.message)
66 )
67 }
68} 68}
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 911d56843..ecffcafc1 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -1,6 +1,6 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, RedirectService } from '@app/core' 3import { AuthService } from '@app/core'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import { forkJoin, Subscription } from 'rxjs' 5import { forkJoin, Subscription } from 'rxjs'
6import { SearchService } from '@app/search/search.service' 6import { SearchService } from '@app/search/search.service'
@@ -40,7 +40,6 @@ export class SearchComponent implements OnInit, OnDestroy {
40 private route: ActivatedRoute, 40 private route: ActivatedRoute,
41 private router: Router, 41 private router: Router,
42 private metaService: MetaService, 42 private metaService: MetaService,
43 private redirectService: RedirectService,
44 private notificationsService: NotificationsService, 43 private notificationsService: NotificationsService,
45 private searchService: SearchService, 44 private searchService: SearchService,
46 private authService: AuthService 45 private authService: AuthService
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts
index 26748f245..884588207 100644
--- a/client/src/app/shared/rest/rest-table.ts
+++ b/client/src/app/shared/rest/rest-table.ts
@@ -16,8 +16,6 @@ export abstract class RestTable {
16 private searchStream: Subject<string> 16 private searchStream: Subject<string>
17 private sortLocalStorageKey = 'rest-table-sort-' + this.constructor.name 17 private sortLocalStorageKey = 'rest-table-sort-' + this.constructor.name
18 18
19 protected abstract loadData (): void
20
21 initialize () { 19 initialize () {
22 this.loadSort() 20 this.loadSort()
23 this.initSearch() 21 this.initSearch()
@@ -71,4 +69,6 @@ export abstract class RestTable {
71 onSearch (search: string) { 69 onSearch (search: string) {
72 this.searchStream.next(search) 70 this.searchStream.next(search)
73 } 71 }
72
73 protected abstract loadData (): void
74} 74}