From dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb Mon Sep 17 00:00:00 2001 From: BO41 Date: Tue, 16 Oct 2018 01:04:50 +0200 Subject: update tslint config and fix member ordering (#1279) --- client/src/app/+admin/users/user-edit/user-edit.ts | 1 - .../+admin/users/user-list/user-list.component.ts | 28 +++++++++++----------- .../my-account-ownership.component.ts | 24 +++++++++---------- client/src/app/search/search.component.ts | 3 +-- client/src/app/shared/rest/rest-table.ts | 4 ++-- 5 files changed, 29 insertions(+), 31 deletions(-) (limited to 'client/src') 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 @@ 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 { 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 { ] } - 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) + ) + } } 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 { 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) + ) + } } 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 @@ 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 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 { private searchStream: Subject 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 } -- cgit v1.2.3