]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-moderation/server-blocklist.component.ts
Automatic colspan for tables
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-moderation / server-blocklist.component.ts
index 546fd53c395eebf6ee913d2eb9e1491357fc5931..f1bcbd561126b6efb50eabb8ac57c74c180a6927 100644 (file)
@@ -6,11 +6,11 @@ import { ServerBlock } from '@shared/models'
 import { BlocklistComponentType, BlocklistService } from './blocklist.service'
 
 @Directive()
-// tslint:disable-next-line: directive-class-suffix
+// eslint-disable-next-line @angular-eslint/directive-class-suffix
 export class GenericServerBlocklistComponent extends RestTable implements OnInit {
   @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent
 
-  // @ts-ignore: "Abstract methods can only appear within an abstract class"
+  // @ts-expect-error: "Abstract methods can only appear within an abstract class"
   public abstract mode: BlocklistComponentType
 
   blockedServers: ServerBlock[] = []
@@ -25,7 +25,7 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
     super()
   }
 
-  // @ts-ignore: "Abstract methods can only appear within an abstract class"
+  // @ts-expect-error: "Abstract methods can only appear within an abstract class"
   public abstract getIdentifier (): string
 
   ngOnInit () {
@@ -34,8 +34,8 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
 
   unblockServer (serverBlock: ServerBlock) {
     const operation = (host: string) => this.mode === BlocklistComponentType.Account
-        ? this.blocklistService.unblockServerByUser(host)
-        : this.blocklistService.unblockServerByInstance(host)
+      ? this.blocklistService.unblockServerByUser(host)
+      : this.blocklistService.unblockServerByInstance(host)
     const host = serverBlock.blockedServer.host
 
     operation(host).subscribe(
@@ -46,7 +46,7 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
             : $localize`Instance ${host} unmuted by your instance.`
         )
 
-        this.loadData()
+        this.reloadData()
       }
     )
   }
@@ -69,13 +69,13 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
               : $localize`Instance ${domain} muted by your instance.`
           )
 
-          this.loadData()
+          this.reloadData()
         }
       )
     })
   }
 
-  protected loadData () {
+  protected reloadDataInternal () {
     const operation = this.mode === BlocklistComponentType.Account
       ? this.blocklistService.getUserServerBlocklist({
         pagination: this.pagination,
@@ -88,13 +88,13 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
         search: this.search
       })
 
-    return operation.subscribe(
-      resultList => {
+    return operation.subscribe({
+      next: resultList => {
         this.blockedServers = resultList.data
         this.totalRecords = resultList.total
       },
 
-      err => this.notifier.error(err.message)
-    )
+      error: err => this.notifier.error(err.message)
+    })
   }
 }