]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-moderation/video-block.component.ts
Refactor comment add css
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-moderation / video-block.component.ts
index 054651e717b894b875989f5debeb1cc80c74208d..fb47989dc23394b9bb8fb1a3ac16fe9b2b3f1db0 100644 (file)
@@ -1,10 +1,10 @@
 import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
 import { Notifier } from '@app/core'
-import { FormReactive, FormValidatorService, VideoBlockValidatorsService } from '@app/shared/shared-forms'
+import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
 import { Video } from '@app/shared/shared-main'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
-import { I18n } from '@ngx-translate/i18n-polyfill'
+import { VIDEO_BLOCK_REASON_VALIDATOR } from '../form-validators/video-block-validators'
 import { VideoBlockService } from './video-block.service'
 
 @Component({
@@ -26,10 +26,8 @@ export class VideoBlockComponent extends FormReactive implements OnInit {
   constructor (
     protected formValidatorService: FormValidatorService,
     private modalService: NgbModal,
-    private videoBlockValidatorsService: VideoBlockValidatorsService,
     private videoBlocklistService: VideoBlockService,
-    private notifier: Notifier,
-    private i18n: I18n
+    private notifier: Notifier
   ) {
     super()
   }
@@ -38,7 +36,7 @@ export class VideoBlockComponent extends FormReactive implements OnInit {
     const defaultValues = { unfederate: 'true' }
 
     this.buildForm({
-      reason: this.videoBlockValidatorsService.VIDEO_BLOCK_REASON,
+      reason: VIDEO_BLOCK_REASON_VALIDATOR,
       unfederate: null
     }, defaultValues)
   }
@@ -59,7 +57,7 @@ export class VideoBlockComponent extends FormReactive implements OnInit {
     this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate)
         .subscribe(
           () => {
-            this.notifier.success(this.i18n('Video blocked.'))
+            this.notifier.success($localize`Video blocked.`)
             this.hide()
 
             this.video.blacklisted = true