Add video channel and video thumbnail, rework video appearance in row
[oweals/peertube.git] / client / src / app / +admin / moderation / video-abuse-list / moderation-comment-modal.component.ts
index bebcb420710ceeebec009c350baabe758fe1887e..a0471f2b062d9d7e9a84fbfd3e43f836d4d2915a 100644 (file)
@@ -13,7 +13,7 @@ import { VideoAbuse } from '../../../../../../shared/models/videos'
   styleUrls: [ './moderation-comment-modal.component.scss' ]
 })
 export class ModerationCommentModalComponent extends FormReactive implements OnInit {
-  @ViewChild('modal') modal: NgbModal
+  @ViewChild('modal', { static: true }) modal: NgbModal
   @Output() commentUpdated = new EventEmitter<string>()
 
   private abuseToComment: VideoAbuse
@@ -32,20 +32,20 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI
 
   ngOnInit () {
     this.buildForm({
-      moderationComment: this.videoAbuseValidatorsService.VIDEO_ABUSE_REASON
+      moderationComment: this.videoAbuseValidatorsService.VIDEO_ABUSE_MODERATION_COMMENT
     })
   }
 
   openModal (abuseToComment: VideoAbuse) {
     this.abuseToComment = abuseToComment
-    this.openedModal = this.modalService.open(this.modal)
+    this.openedModal = this.modalService.open(this.modal, { centered: true })
 
     this.form.patchValue({
       moderationComment: this.abuseToComment.moderationComment
     })
   }
 
-  hideModerationCommentModal () {
+  hide () {
     this.abuseToComment = undefined
     this.openedModal.close()
     this.form.reset()
@@ -60,7 +60,7 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI
             this.notifier.success(this.i18n('Comment updated.'))
 
             this.commentUpdated.emit(moderationComment)
-            this.hideModerationCommentModal()
+            this.hide()
           },
 
           err => this.notifier.error(err.message)