From 76314386aeafdd6849b7b70c517779d6b2013473 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 27 Mar 2020 15:19:03 +0100 Subject: Add overview of a user's actions in user-edit (#2558) --- client/src/app/shared/shared.module.ts | 7 +++++-- client/src/app/shared/users/user.model.ts | 10 ++++++++++ client/src/app/shared/users/user.service.ts | 5 +++-- client/src/app/shared/video/modals/video-report.component.html | 3 +-- 4 files changed, 19 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index 75aa30dab..b89f0a8d1 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -106,6 +106,7 @@ import { InputSwitchModule } from 'primeng/inputswitch' import { MyAccountVideoSettingsComponent } from '@app/+my-account/my-account-settings/my-account-video-settings' import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account-settings/my-account-interface' +import { ActorAvatarInfoComponent } from '@app/+my-account/shared/actor-avatar-info.component' @NgModule({ imports: [ @@ -189,7 +190,8 @@ import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account PreviewUploadComponent, MyAccountVideoSettingsComponent, - MyAccountInterfaceSettingsComponent + MyAccountInterfaceSettingsComponent, + ActorAvatarInfoComponent ], exports: [ @@ -270,7 +272,8 @@ import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account VideoDurationPipe, MyAccountVideoSettingsComponent, - MyAccountInterfaceSettingsComponent + MyAccountInterfaceSettingsComponent, + ActorAvatarInfoComponent ], providers: [ diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index a37cae749..76c57d2fb 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -51,6 +51,11 @@ export class User implements UserServerModel { videoQuotaDaily: number videoQuotaUsed?: number videoQuotaUsedDaily?: number + videosCount?: number + videoAbusesCount?: number + videoAbusesAcceptedCount?: number + videoAbusesCreatedCount?: number + videoCommentsCount?: number theme: string @@ -79,6 +84,11 @@ export class User implements UserServerModel { this.videoQuotaDaily = hash.videoQuotaDaily this.videoQuotaUsed = hash.videoQuotaUsed this.videoQuotaUsedDaily = hash.videoQuotaUsedDaily + this.videosCount = hash.videosCount + this.videoAbusesCount = hash.videoAbusesCount + this.videoAbusesAcceptedCount = hash.videoAbusesAcceptedCount + this.videoAbusesCreatedCount = hash.videoAbusesCreatedCount + this.videoCommentsCount = hash.videoCommentsCount this.nsfwPolicy = hash.nsfwPolicy this.webTorrentEnabled = hash.webTorrentEnabled diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index a79343646..5442a8453 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts @@ -234,8 +234,9 @@ export class UserService { return this.userCache[userId] } - getUser (userId: number) { - return this.authHttp.get(UserService.BASE_USERS_URL + userId) + getUser (userId: number, withStats = false) { + const params = new HttpParams().append('withStats', withStats + '') + return this.authHttp.get(UserService.BASE_USERS_URL + userId, { params }) .pipe(catchError(err => this.restExtractor.handleError(err))) } diff --git a/client/src/app/shared/video/modals/video-report.component.html b/client/src/app/shared/video/modals/video-report.component.html index b9434da26..cc1d361b3 100644 --- a/client/src/app/shared/video/modals/video-report.component.html +++ b/client/src/app/shared/video/modals/video-report.component.html @@ -7,8 +7,7 @@