aboutsummaryrefslogtreecommitdiffhomepage
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
parent4fe98be6b421498577dc0bbcbe22c105408f394d (diff)
downloadPeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.tar.gz
PeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.tar.zst
PeerTube-dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb.zip
update tslint config and fix member ordering (#1279)
-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
-rw-r--r--client/tslint.json16
-rw-r--r--tslint.json2
7 files changed, 42 insertions, 36 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}
diff --git a/client/tslint.json b/client/tslint.json
index e997088fd..fcc866ee3 100644
--- a/client/tslint.json
+++ b/client/tslint.json
@@ -7,10 +7,18 @@
7 "max-line-length": [true, 140], 7 "max-line-length": [true, 140],
8 "no-floating-promises": false, 8 "no-floating-promises": false,
9 "no-unused-variable": false, // Memory issues 9 "no-unused-variable": false, // Memory issues
10 "member-ordering": [true, 10 "member-ordering": [true, {
11 "public-before-private", 11 "order": [
12 "static-before-instance", 12 "public-static-field",
13 "variables-before-functions" 13 "private-static-field",
14 "public-instance-field",
15 "private-instance-field",
16 "public-constructor",
17 "private-constructor",
18 "public-instance-method",
19 "protected-instance-method",
20 "private-instance-method"
21 ]}
14 ], 22 ],
15 23
16 "angular-whitespace": [true, "check-interpolation", "check-semicolon"], 24 "angular-whitespace": [true, "check-interpolation", "check-semicolon"],
diff --git a/tslint.json b/tslint.json
index 92d0bd2b1..6828f4325 100644
--- a/tslint.json
+++ b/tslint.json
@@ -4,7 +4,7 @@
4 "await-promise": [true, "Bluebird"], 4 "await-promise": [true, "Bluebird"],
5 "no-inferrable-types": true, 5 "no-inferrable-types": true,
6 "eofline": true, 6 "eofline": true,
7 "indent": ["spaces"], 7 "indent": [true, "spaces"],
8 "ter-indent": [true, 2], 8 "ter-indent": [true, 2],
9 "max-line-length": [true, 140], 9 "max-line-length": [true, 140],
10 "no-unused-variable": false, // Memory issues 10 "no-unused-variable": false, // Memory issues