Browse Source

update tslint config and fix member ordering (#1279)

BO41 1 year ago
parent
commit
dffd5d127f

+ 0
- 1
client/src/app/+admin/users/user-edit/user-edit.ts View File

@@ -1,7 +1,6 @@
1 1
 import { ServerService } from '../../../core'
2 2
 import { FormReactive } from '../../../shared'
3 3
 import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared'
4
-import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/'
5 4
 import { ConfigService } from '@app/+admin/config/shared/config.service'
6 5
 
7 6
 export abstract class UserEdit extends FormReactive {

+ 14
- 14
client/src/app/+admin/users/user-list/user-list.component.ts View File

@@ -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 58
   openBanUserModal (users: User[]) {
73 59
     for (const user of users) {
74 60
       if (user.username === 'root') {
@@ -131,4 +117,18 @@ export class UserListComponent extends RestTable implements OnInit {
131 117
   isInSelectionMode () {
132 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
 }

+ 12
- 12
client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts View File

@@ -34,18 +34,6 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
34 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 37
   createByString (account: Account) {
50 38
     return Account.CREATE_BY_STRING(account.name, account.host)
51 39
   }
@@ -65,4 +53,16 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
65 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
 }

+ 1
- 2
client/src/app/search/search.component.ts View File

@@ -1,6 +1,6 @@
1 1
 import { Component, OnDestroy, OnInit } from '@angular/core'
2 2
 import { ActivatedRoute, Router } from '@angular/router'
3
-import { AuthService, RedirectService } from '@app/core'
3
+import { AuthService } from '@app/core'
4 4
 import { NotificationsService } from 'angular2-notifications'
5 5
 import { forkJoin, Subscription } from 'rxjs'
6 6
 import { SearchService } from '@app/search/search.service'
@@ -40,7 +40,6 @@ export class SearchComponent implements OnInit, OnDestroy {
40 40
     private route: ActivatedRoute,
41 41
     private router: Router,
42 42
     private metaService: MetaService,
43
-    private redirectService: RedirectService,
44 43
     private notificationsService: NotificationsService,
45 44
     private searchService: SearchService,
46 45
     private authService: AuthService

+ 2
- 2
client/src/app/shared/rest/rest-table.ts View File

@@ -16,8 +16,6 @@ export abstract class RestTable {
16 16
   private searchStream: Subject<string>
17 17
   private sortLocalStorageKey = 'rest-table-sort-' + this.constructor.name
18 18
 
19
-  protected abstract loadData (): void
20
-
21 19
   initialize () {
22 20
     this.loadSort()
23 21
     this.initSearch()
@@ -71,4 +69,6 @@ export abstract class RestTable {
71 69
   onSearch (search: string) {
72 70
     this.searchStream.next(search)
73 71
   }
72
+
73
+  protected abstract loadData (): void
74 74
 }

+ 12
- 4
client/tslint.json View File

@@ -7,10 +7,18 @@
7 7
     "max-line-length": [true, 140],
8 8
     "no-floating-promises": false,
9 9
     "no-unused-variable": false, // Memory issues
10
-    "member-ordering": [true,
11
-      "public-before-private",
12
-      "static-before-instance",
13
-      "variables-before-functions"
10
+    "member-ordering": [true, {
11
+      "order": [
12
+        "public-static-field",
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 24
     "angular-whitespace": [true, "check-interpolation", "check-semicolon"],

+ 1
- 1
tslint.json View File

@@ -4,7 +4,7 @@
4 4
     "await-promise": [true, "Bluebird"],
5 5
     "no-inferrable-types": true,
6 6
     "eofline": true,
7
-    "indent": ["spaces"],
7
+    "indent": [true, "spaces"],
8 8
     "ter-indent": [true, 2],
9 9
     "max-line-length": [true, 140],
10 10
     "no-unused-variable": false, // Memory issues

Loading…
Cancel
Save