aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-edit.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-03-27 15:19:03 +0100
committerGitHub <noreply@github.com>2020-03-27 15:19:03 +0100
commit76314386aeafdd6849b7b70c517779d6b2013473 (patch)
treef0ba33e0f6e7b2eb99222a9eb5b85846cf309ab1 /client/src/app/+admin/users/user-edit/user-edit.ts
parent56d72521ec139dfc0aef083b8541a5b16d974ac1 (diff)
downloadPeerTube-76314386aeafdd6849b7b70c517779d6b2013473.tar.gz
PeerTube-76314386aeafdd6849b7b70c517779d6b2013473.tar.zst
PeerTube-76314386aeafdd6849b7b70c517779d6b2013473.zip
Add overview of a user's actions in user-edit (#2558)
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-edit.ts')
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.ts19
1 files changed, 18 insertions, 1 deletions
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 47b57d2ec..a23cd9033 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/users/user-edit/user-edit.ts
@@ -4,12 +4,14 @@ import { ServerConfig, USER_ROLE_LABELS, UserRole, VideoResolution } from '../..
4import { ConfigService } from '@app/+admin/config/shared/config.service' 4import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { UserAdminFlag } from '@shared/models/users/user-flag.model' 5import { UserAdminFlag } from '@shared/models/users/user-flag.model'
6import { OnInit } from '@angular/core' 6import { OnInit } from '@angular/core'
7import { User } from '@app/shared/users/user.model'
8import { ScreenService } from '@app/shared/misc/screen.service'
7 9
8export abstract class UserEdit extends FormReactive implements OnInit { 10export abstract class UserEdit extends FormReactive implements OnInit {
9 videoQuotaOptions: { value: string, label: string }[] = [] 11 videoQuotaOptions: { value: string, label: string }[] = []
10 videoQuotaDailyOptions: { value: string, label: string }[] = [] 12 videoQuotaDailyOptions: { value: string, label: string }[] = []
11 username: string 13 username: string
12 userId: number 14 user: User
13 15
14 roles: { value: string, label: string }[] = [] 16 roles: { value: string, label: string }[] = []
15 17
@@ -17,6 +19,7 @@ export abstract class UserEdit extends FormReactive implements OnInit {
17 19
18 protected abstract serverService: ServerService 20 protected abstract serverService: ServerService
19 protected abstract configService: ConfigService 21 protected abstract configService: ConfigService
22 protected abstract screenService: ScreenService
20 protected abstract auth: AuthService 23 protected abstract auth: AuthService
21 abstract isCreation (): boolean 24 abstract isCreation (): boolean
22 abstract getFormButtonTitle (): string 25 abstract getFormButtonTitle (): string
@@ -29,6 +32,20 @@ export abstract class UserEdit extends FormReactive implements OnInit {
29 this.buildRoles() 32 this.buildRoles()
30 } 33 }
31 34
35 get subscribersCount () {
36 const forAccount = this.user
37 ? this.user.account.followersCount
38 : 0
39 const forChannels = this.user
40 ? this.user.videoChannels.map(c => c.followersCount).reduce((a, b) => a + b, 0)
41 : 0
42 return forAccount + forChannels
43 }
44
45 isInBigView () {
46 return this.screenService.getWindowInnerWidth() > 1600
47 }
48
32 buildRoles () { 49 buildRoles () {
33 const authUser = this.auth.getUser() 50 const authUser = this.auth.getUser()
34 51