]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/overview/comments/video-comment-list.component.ts
Support bulk registration request removal
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / overview / comments / video-comment-list.component.ts
index f01a1629b6c92fb48bf64353a4c63dbd63ddefbc..cfa68ed9d510329f0d06e60ab5ef7086910b2d75 100644 (file)
@@ -14,7 +14,7 @@ import { prepareIcu } from '@app/helpers'
   templateUrl: './video-comment-list.component.html',
   styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-comment-list.component.scss' ]
 })
-export class VideoCommentListComponent extends RestTable implements OnInit {
+export class VideoCommentListComponent extends RestTable <VideoCommentAdmin> implements OnInit {
   comments: VideoCommentAdmin[]
   totalRecords = 0
   sort: SortMeta = { field: 'createdAt', order: -1 }
@@ -40,8 +40,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
     }
   ]
 
-  selectedComments: VideoCommentAdmin[] = []
-  bulkCommentActions: DropdownAction<VideoCommentAdmin[]>[] = []
+  bulkActions: DropdownAction<VideoCommentAdmin[]>[] = []
 
   inputFilters: AdvancedInputFilter[] = [
     {
@@ -54,6 +53,10 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
         {
           value: 'local:false',
           label: $localize`Remote comments`
+        },
+        {
+          value: 'localVideo:true',
+          label: $localize`Comments on local videos`
         }
       ]
     }
@@ -96,7 +99,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
   ngOnInit () {
     this.initialize()
 
-    this.bulkCommentActions = [
+    this.bulkActions = [
       {
         label: $localize`Delete`,
         handler: comments => this.removeComments(comments),
@@ -111,11 +114,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
   }
 
   toHtml (text: string) {
-    return this.markdownRenderer.textMarkdownToHTML(text, true, true)
-  }
-
-  isInSelectionMode () {
-    return this.selectedComments.length !== 0
+    return this.markdownRenderer.textMarkdownToHTML({ markdown: text, withHtml: true, withEmoji: true })
   }
 
   reloadData () {
@@ -158,7 +157,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
 
         error: err => this.notifier.error(err.message),
 
-        complete: () => this.selectedComments = []
+        complete: () => this.selectedRows = []
       })
   }