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 {
]
}
- 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') {
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)
+ )
+ }
}
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)
}
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)
+ )
+ }
}
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'
private route: ActivatedRoute,
private router: Router,
private metaService: MetaService,
- private redirectService: RedirectService,
private notificationsService: NotificationsService,
private searchService: SearchService,
private authService: AuthService
private searchStream: Subject<string>
private sortLocalStorageKey = 'rest-table-sort-' + this.constructor.name
- protected abstract loadData (): void
-
initialize () {
this.loadSort()
this.initSearch()
onSearch (search: string) {
this.searchStream.next(search)
}
+
+ protected abstract loadData (): void
}
"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"],
"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