From 4f32032fed8587ea97d45e235b167e8958efd81f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Jul 2020 14:34:16 +0200 Subject: Add migrations --- client/src/app/+admin/admin.component.ts | 6 +++--- .../app/+admin/users/user-edit/user-edit.component.html | 8 ++++---- .../my-account-notification-preferences.component.ts | 4 ++-- client/src/app/core/users/user.model.ts | 14 ++++++++------ 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 1e137e63e..87ed33a45 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -45,7 +45,7 @@ export class AdminComponent implements OnInit { children: [] } - if (this.hasVideoAbusesRight()) { + if (this.hasAbusesRight()) { moderationItems.children.push({ label: this.i18n('Video reports'), routerLink: '/admin/moderation/video-abuses/list', @@ -76,7 +76,7 @@ export class AdminComponent implements OnInit { if (this.hasUsersRight()) this.menuEntries.push({ label: this.i18n('Users'), routerLink: '/admin/users' }) if (this.hasServerFollowRight()) this.menuEntries.push(federationItems) - if (this.hasVideoAbusesRight() || this.hasVideoBlocklistRight()) this.menuEntries.push(moderationItems) + if (this.hasAbusesRight() || this.hasVideoBlocklistRight()) this.menuEntries.push(moderationItems) if (this.hasConfigRight()) this.menuEntries.push({ label: this.i18n('Configuration'), routerLink: '/admin/config' }) if (this.hasPluginsRight()) this.menuEntries.push({ label: this.i18n('Plugins/Themes'), routerLink: '/admin/plugins' }) if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) this.menuEntries.push({ label: this.i18n('System'), routerLink: '/admin/system' }) @@ -90,7 +90,7 @@ export class AdminComponent implements OnInit { return this.auth.getUser().hasRight(UserRight.MANAGE_SERVER_FOLLOW) } - hasVideoAbusesRight () { + hasAbusesRight () { return this.auth.getUser().hasRight(UserRight.MANAGE_ABUSES) } diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/users/user-edit/user-edit.component.html index 297e6104c..2e7b322ca 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.component.html +++ b/client/src/app/+admin/users/user-edit/user-edit.component.html @@ -37,14 +37,14 @@
- -
{{ user.videoAbusesCount }}
+
+
{{ user.abusesCount }}
Incriminated in reports
- -
{{ user.videoAbusesAcceptedCount }} / {{ user.videoAbusesCreatedCount }}
+
+
{{ user.abusesAcceptedCount }} / {{ user.abusesCreatedCount }}
Authored reports accepted
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts index adc18b587..8562e564b 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts @@ -33,7 +33,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { this.labelNotifications = { newVideoFromSubscription: this.i18n('New video from your subscriptions'), newCommentOnMyVideo: this.i18n('New comment on your video'), - videoAbuseAsModerator: this.i18n('New video abuse'), + abuseAsModerator: this.i18n('New abuse'), videoAutoBlacklistAsModerator: this.i18n('Video blocked automatically waiting review'), blacklistOnMyVideo: this.i18n('One of your video is blocked/unblocked'), myVideoPublished: this.i18n('Video published (after transcoding/scheduled update)'), @@ -47,7 +47,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { this.notificationSettingKeys = Object.keys(this.labelNotifications) as (keyof UserNotificationSetting)[] this.rightNotifications = { - videoAbuseAsModerator: UserRight.MANAGE_ABUSES, + abuseAsModerator: UserRight.MANAGE_ABUSES, videoAutoBlacklistAsModerator: UserRight.MANAGE_VIDEO_BLACKLIST, newUserRegistration: UserRight.MANAGE_USERS, newInstanceFollower: UserRight.MANAGE_SERVER_FOLLOW, diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 8ecdf9fcd..31b9c2152 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts @@ -51,12 +51,14 @@ export class User implements UserServerModel { videoQuotaDaily: number videoQuotaUsed?: number videoQuotaUsedDaily?: number + videosCount?: number - videoAbusesCount?: number - videoAbusesAcceptedCount?: number - videoAbusesCreatedCount?: number videoCommentsCount?: number + abusesCount?: number + abusesAcceptedCount?: number + abusesCreatedCount?: number + theme: string account: Account @@ -89,9 +91,9 @@ export class User implements UserServerModel { 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.abusesCount = hash.abusesCount + this.abusesAcceptedCount = hash.abusesAcceptedCount + this.abusesCreatedCount = hash.abusesCreatedCount this.videoCommentsCount = hash.videoCommentsCount this.nsfwPolicy = hash.nsfwPolicy -- cgit v1.2.3