update tslint config and fix member ordering (#1279)
authorBO41 <lukasw41@gmail.com>
Mon, 15 Oct 2018 23:04:50 +0000 (01:04 +0200)
committerRigel Kent <par@rigelk.eu>
Mon, 15 Oct 2018 23:04:50 +0000 (01:04 +0200)
client/src/app/+admin/users/user-edit/user-edit.ts
client/src/app/+admin/users/user-list/user-list.component.ts
client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
client/src/app/search/search.component.ts
client/src/app/shared/rest/rest-table.ts
client/tslint.json
tslint.json

index 07b087b5b657d5d3927bf2465126cdfd3357b154..99ce5804b75ac3eb98947475404898387476c2d2 100644 (file)
@@ -1,7 +1,6 @@
 import { ServerService } from '../../../core'
 import { FormReactive } from '../../../shared'
 import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared'
-import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/'
 import { ConfigService } from '@app/+admin/config/shared/config.service'
 
 export abstract class UserEdit extends FormReactive {
index 33384dc35083c8b7b9542e075d841fb53475df97..ab225072235711008699f1809e30d49de3f2d4fb 100644 (file)
@@ -55,20 +55,6 @@ export class UserListComponent extends RestTable implements OnInit {
     ]
   }
 
-  protected loadData () {
-    this.selectedUsers = []
-
-    this.userService.getUsers(this.pagination, this.sort, this.search)
-                    .subscribe(
-                      resultList => {
-                        this.users = resultList.data
-                        this.totalRecords = resultList.total
-                      },
-
-                      err => this.notificationsService.error(this.i18n('Error'), err.message)
-                    )
-  }
-
   openBanUserModal (users: User[]) {
     for (const user of users) {
       if (user.username === 'root') {
@@ -131,4 +117,18 @@ export class UserListComponent extends RestTable implements OnInit {
   isInSelectionMode () {
     return this.selectedUsers.length !== 0
   }
+
+  protected loadData () {
+    this.selectedUsers = []
+
+    this.userService.getUsers(this.pagination, this.sort, this.search)
+                    .subscribe(
+                      resultList => {
+                        this.users = resultList.data
+                        this.totalRecords = resultList.total
+                      },
+
+                      err => this.notificationsService.error(this.i18n('Error'), err.message)
+                    )
+  }
 }
index 5202786717541771605416cfa2fb21108c149500..0b51ac13cafc6f060574a0c6c78936bdc2d27920 100644 (file)
@@ -34,18 +34,6 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
     this.initialize()
   }
 
-  protected loadData () {
-    return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
-      .subscribe(
-        resultList => {
-          this.videoChangeOwnerships = resultList.data
-          this.totalRecords = resultList.total
-        },
-
-        err => this.notificationsService.error(this.i18n('Error'), err.message)
-      )
-  }
-
   createByString (account: Account) {
     return Account.CREATE_BY_STRING(account.name, account.host)
   }
@@ -65,4 +53,16 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
         err => this.notificationsService.error(this.i18n('Error'), err.message)
       )
   }
+
+  protected loadData () {
+    return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
+      .subscribe(
+        resultList => {
+          this.videoChangeOwnerships = resultList.data
+          this.totalRecords = resultList.total
+        },
+
+        err => this.notificationsService.error(this.i18n('Error'), err.message)
+      )
+  }
 }
index 911d5684371208d994cc42274901cae724fe2df1..ecffcafc1ff09621804704cf4ecddaef5a18148d 100644 (file)
@@ -1,6 +1,6 @@
 import { Component, OnDestroy, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService, RedirectService } from '@app/core'
+import { AuthService } from '@app/core'
 import { NotificationsService } from 'angular2-notifications'
 import { forkJoin, Subscription } from 'rxjs'
 import { SearchService } from '@app/search/search.service'
@@ -40,7 +40,6 @@ export class SearchComponent implements OnInit, OnDestroy {
     private route: ActivatedRoute,
     private router: Router,
     private metaService: MetaService,
-    private redirectService: RedirectService,
     private notificationsService: NotificationsService,
     private searchService: SearchService,
     private authService: AuthService
index 26748f2451ccf14701b1f12c4277b08084d583c7..8845882079ea6777680021df920c1f1bd1234031 100644 (file)
@@ -16,8 +16,6 @@ export abstract class RestTable {
   private searchStream: Subject<string>
   private sortLocalStorageKey = 'rest-table-sort-' + this.constructor.name
 
-  protected abstract loadData (): void
-
   initialize () {
     this.loadSort()
     this.initSearch()
@@ -71,4 +69,6 @@ export abstract class RestTable {
   onSearch (search: string) {
     this.searchStream.next(search)
   }
+
+  protected abstract loadData (): void
 }
index e997088fdaa7822e4ae054812c5e0d24d53aae03..fcc866ee38ab7526e741c5cd96a37cc97451d435 100644 (file)
@@ -7,10 +7,18 @@
     "max-line-length": [true, 140],
     "no-floating-promises": false,
     "no-unused-variable": false, // Memory issues
-    "member-ordering": [true,
-      "public-before-private",
-      "static-before-instance",
-      "variables-before-functions"
+    "member-ordering": [true, {
+      "order": [
+        "public-static-field",
+        "private-static-field",
+        "public-instance-field",
+        "private-instance-field",
+        "public-constructor",
+        "private-constructor",
+        "public-instance-method",
+        "protected-instance-method",
+        "private-instance-method"
+        ]}
     ],
 
     "angular-whitespace": [true, "check-interpolation", "check-semicolon"],
index 92d0bd2b1d7c4603d3de4189376af5e1c95fb4fa..6828f4325efd6d4af83de9f50f71a1ee4bc07bb1 100644 (file)
@@ -4,7 +4,7 @@
     "await-promise": [true, "Bluebird"],
     "no-inferrable-types": true,
     "eofline": true,
-    "indent": ["spaces"],
+    "indent": [true, "spaces"],
     "ter-indent": [true, 2],
     "max-line-length": [true, 140],
     "no-unused-variable": false, // Memory issues