import { SortMeta } from 'primeng/api'
-import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'
+import { Component, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core'
import { AdvancedInputFilter } from '@app/shared/shared-forms'
templateUrl: './user-list.component.html',
styleUrls: [ './user-list.component.scss' ]
})
-export class UserListComponent extends RestTable implements OnInit, AfterViewInit {
+export class UserListComponent extends RestTable implements OnInit {
@ViewChild('userBanModal', { static: true }) userBanModal: UserBanModalComponent
users: User[] = []
.subscribe(config => this.serverConfig = config)
this.initialize()
- this.listenToSearchChange()
this.bulkUserActions = [
[
this.columns.push({ id: 'lastLoginDate', label: 'Last login' })
}
- ngAfterViewInit () {
- if (this.search) this.setTableFilter(this.search, false)
- }
-
getIdentifier () {
return 'UserListComponent'
}
}
onUserChanged () {
- this.loadData()
+ this.reloadData()
}
async unbanUsers (users: User[]) {
.subscribe(
() => {
this.notifier.success($localize`${users.length} users unbanned.`)
- this.loadData()
+ this.reloadData()
},
err => this.notifier.error(err.message)
this.userService.removeUser(users).subscribe(
() => {
this.notifier.success($localize`${users.length} users deleted.`)
- this.loadData()
+ this.reloadData()
},
err => this.notifier.error(err.message)
this.userService.updateUsers(users, { emailVerified: true }).subscribe(
() => {
this.notifier.success($localize`${users.length} users email set as verified.`)
- this.loadData()
+ this.reloadData()
},
err => this.notifier.error(err.message)
return this.selectedUsers.length !== 0
}
- protected loadData () {
+ protected reloadData () {
this.selectedUsers = []
this.userService.getUsers({