aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/moderation')
-rw-r--r--client/src/app/+admin/moderation/moderation.component.ts14
-rw-r--r--client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts19
2 files changed, 20 insertions, 13 deletions
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts
index 47154af3f..7744deb06 100644
--- a/client/src/app/+admin/moderation/moderation.component.ts
+++ b/client/src/app/+admin/moderation/moderation.component.ts
@@ -1,4 +1,4 @@
1import { Component } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../../shared' 2import { UserRight } from '../../../../../shared'
3import { AuthService, ServerService } from '@app/core' 3import { AuthService, ServerService } from '@app/core'
4 4
@@ -6,14 +6,18 @@ import { AuthService, ServerService } from '@app/core'
6 templateUrl: './moderation.component.html', 6 templateUrl: './moderation.component.html',
7 styleUrls: [ './moderation.component.scss' ] 7 styleUrls: [ './moderation.component.scss' ]
8}) 8})
9export class ModerationComponent { 9export class ModerationComponent implements OnInit {
10 autoBlacklistVideosEnabled: boolean 10 autoBlacklistVideosEnabled = false
11 11
12 constructor ( 12 constructor (
13 private auth: AuthService, 13 private auth: AuthService,
14 private serverService: ServerService 14 private serverService: ServerService
15 ) { 15 ) { }
16 this.autoBlacklistVideosEnabled = this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled 16
17 ngOnInit (): void {
18 this.serverService.getConfig()
19 .subscribe(config => this.autoBlacklistVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
20
17 } 21 }
18 22
19 hasVideoAbusesRight () { 23 hasVideoAbusesRight () {
diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts
index f4bce7c48..5876f658b 100644
--- a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts
+++ b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts
@@ -33,11 +33,18 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit {
33 private i18n: I18n 33 private i18n: I18n
34 ) { 34 ) {
35 super() 35 super()
36 }
36 37
37 // don't filter if auto-blacklist not enabled as this will be only list 38 ngOnInit () {
38 if (this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled) { 39 this.serverService.getConfig()
39 this.listBlacklistTypeFilter = VideoBlacklistType.MANUAL 40 .subscribe(config => {
40 } 41 // don't filter if auto-blacklist not enabled as this will be only list
42 if (config.autoBlacklist.videos.ofUsers.enabled) {
43 this.listBlacklistTypeFilter = VideoBlacklistType.MANUAL
44 }
45 })
46
47 this.initialize()
41 48
42 this.videoBlacklistActions = [ 49 this.videoBlacklistActions = [
43 { 50 {
@@ -47,10 +54,6 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit {
47 ] 54 ]
48 } 55 }
49 56
50 ngOnInit () {
51 this.initialize()
52 }
53
54 getVideoUrl (videoBlacklist: VideoBlacklist) { 57 getVideoUrl (videoBlacklist: VideoBlacklist) {
55 return Video.buildClientUrl(videoBlacklist.video.uuid) 58 return Video.buildClientUrl(videoBlacklist.video.uuid)
56 } 59 }