diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/shared/shared-moderation | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/shared/shared-moderation')
5 files changed, 22 insertions, 20 deletions
diff --git a/client/src/app/shared/shared-moderation/abuse.service.ts b/client/src/app/shared/shared-moderation/abuse.service.ts index bf98d4b36..f45b5c8e8 100644 --- a/client/src/app/shared/shared-moderation/abuse.service.ts +++ b/client/src/app/shared/shared-moderation/abuse.service.ts | |||
@@ -30,8 +30,8 @@ export class AbuseService { | |||
30 | ) { } | 30 | ) { } |
31 | 31 | ||
32 | getAdminAbuses (options: { | 32 | getAdminAbuses (options: { |
33 | pagination: RestPagination, | 33 | pagination: RestPagination |
34 | sort: SortMeta, | 34 | sort: SortMeta |
35 | search?: string | 35 | search?: string |
36 | }): Observable<ResultList<AdminAbuse>> { | 36 | }): Observable<ResultList<AdminAbuse>> { |
37 | const { pagination, sort, search } = options | 37 | const { pagination, sort, search } = options |
@@ -51,8 +51,8 @@ export class AbuseService { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | getUserAbuses (options: { | 53 | getUserAbuses (options: { |
54 | pagination: RestPagination, | 54 | pagination: RestPagination |
55 | sort: SortMeta, | 55 | sort: SortMeta |
56 | search?: string | 56 | search?: string |
57 | }): Observable<ResultList<UserAbuse>> { | 57 | }): Observable<ResultList<UserAbuse>> { |
58 | const { pagination, sort, search } = options | 58 | const { pagination, sort, search } = options |
@@ -74,7 +74,7 @@ export class AbuseService { | |||
74 | reportVideo (parameters: AbuseCreate) { | 74 | reportVideo (parameters: AbuseCreate) { |
75 | const url = AbuseService.BASE_ABUSE_URL | 75 | const url = AbuseService.BASE_ABUSE_URL |
76 | 76 | ||
77 | const body = omit(parameters, ['id']) | 77 | const body = omit(parameters, [ 'id' ]) |
78 | 78 | ||
79 | return this.authHttp.post(url, body) | 79 | return this.authHttp.post(url, body) |
80 | .pipe( | 80 | .pipe( |
@@ -147,11 +147,13 @@ export class AbuseService { | |||
147 | { | 147 | { |
148 | id: 'spamOrMisleading', | 148 | id: 'spamOrMisleading', |
149 | label: $localize`Spam, ad or false news`, | 149 | label: $localize`Spam, ad or false news`, |
150 | // eslint-disable-next-line max-len | ||
150 | help: $localize`Contains marketing, spam, purposefully deceitful news, or otherwise misleading thumbnail/text/tags. Please provide reputable sources to report hoaxes.` | 151 | help: $localize`Contains marketing, spam, purposefully deceitful news, or otherwise misleading thumbnail/text/tags. Please provide reputable sources to report hoaxes.` |
151 | }, | 152 | }, |
152 | { | 153 | { |
153 | id: 'privacy', | 154 | id: 'privacy', |
154 | label: $localize`Privacy breach or doxxing`, | 155 | label: $localize`Privacy breach or doxxing`, |
156 | // eslint-disable-next-line max-len | ||
155 | help: $localize`Contains personal information that could be used to track, identify, contact or impersonate someone (e.g. name, address, phone number, email, or credit card details).` | 157 | help: $localize`Contains personal information that could be used to track, identify, contact or impersonate someone (e.g. name, address, phone number, email, or credit card details).` |
156 | }, | 158 | }, |
157 | { | 159 | { |
@@ -162,6 +164,7 @@ export class AbuseService { | |||
162 | { | 164 | { |
163 | id: 'serverRules', | 165 | id: 'serverRules', |
164 | label: $localize`Breaks server rules`, | 166 | label: $localize`Breaks server rules`, |
167 | // eslint-disable-next-line max-len | ||
165 | description: $localize`Anything not included in the above that breaks the terms of service, code of conduct, or general rules in place on the server.` | 168 | description: $localize`Anything not included in the above that breaks the terms of service, code of conduct, or general rules in place on the server.` |
166 | } | 169 | } |
167 | ] | 170 | ] |
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts index 36f2a591b..9ed00bc12 100644 --- a/client/src/app/shared/shared-moderation/account-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { Directive, OnInit } from '@angular/core' | 2 | import { Directive, OnInit } from '@angular/core' |
3 | import { Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { Account } from '@app/shared/shared-main' | ||
5 | import { AccountBlock } from './account-block.model' | 4 | import { AccountBlock } from './account-block.model' |
6 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' | 5 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
7 | 6 | ||
8 | @Directive() | 7 | @Directive() |
9 | // tslint:disable-next-line: directive-class-suffix | 8 | // eslint-disable-next-line @angular-eslint/directive-class-suffix |
10 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { | 9 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { |
11 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 10 | // @ts-expect-error: "Abstract methods can only appear within an abstract class" |
12 | abstract mode: BlocklistComponentType | 11 | abstract mode: BlocklistComponentType |
13 | 12 | ||
14 | blockedAccounts: AccountBlock[] = [] | 13 | blockedAccounts: AccountBlock[] = [] |
@@ -23,7 +22,7 @@ export class GenericAccountBlocklistComponent extends RestTable implements OnIni | |||
23 | super() | 22 | super() |
24 | } | 23 | } |
25 | 24 | ||
26 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 25 | // @ts-expect-error: "Abstract methods can only appear within an abstract class" |
27 | abstract getIdentifier (): string | 26 | abstract getIdentifier (): string |
28 | 27 | ||
29 | ngOnInit () { | 28 | ngOnInit () { |
diff --git a/client/src/app/shared/shared-moderation/blocklist.service.ts b/client/src/app/shared/shared-moderation/blocklist.service.ts index de677a77b..db2a8c584 100644 --- a/client/src/app/shared/shared-moderation/blocklist.service.ts +++ b/client/src/app/shared/shared-moderation/blocklist.service.ts | |||
@@ -21,7 +21,7 @@ export class BlocklistService { | |||
21 | private restService: RestService | 21 | private restService: RestService |
22 | ) { } | 22 | ) { } |
23 | 23 | ||
24 | /*********************** User -> Account blocklist ***********************/ | 24 | /** ********************* User -> Account blocklist ***********************/ |
25 | 25 | ||
26 | getUserAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { | 26 | getUserAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { |
27 | const { pagination, sort, search } = options | 27 | const { pagination, sort, search } = options |
@@ -53,7 +53,7 @@ export class BlocklistService { | |||
53 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 53 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
54 | } | 54 | } |
55 | 55 | ||
56 | /*********************** User -> Server blocklist ***********************/ | 56 | /** ********************* User -> Server blocklist ***********************/ |
57 | 57 | ||
58 | getUserServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { | 58 | getUserServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { |
59 | const { pagination, sort, search } = options | 59 | const { pagination, sort, search } = options |
@@ -84,7 +84,7 @@ export class BlocklistService { | |||
84 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 84 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
85 | } | 85 | } |
86 | 86 | ||
87 | /*********************** Instance -> Account blocklist ***********************/ | 87 | /** ********************* Instance -> Account blocklist ***********************/ |
88 | 88 | ||
89 | getInstanceAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { | 89 | getInstanceAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { |
90 | const { pagination, sort, search } = options | 90 | const { pagination, sort, search } = options |
@@ -116,7 +116,7 @@ export class BlocklistService { | |||
116 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 116 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
117 | } | 117 | } |
118 | 118 | ||
119 | /*********************** Instance -> Server blocklist ***********************/ | 119 | /** ********************* Instance -> Server blocklist ***********************/ |
120 | 120 | ||
121 | getInstanceServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { | 121 | getInstanceServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search?: string }) { |
122 | const { pagination, sort, search } = options | 122 | const { pagination, sort, search } = options |
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts index da09b1d0e..1ba7a1b4d 100644 --- a/client/src/app/shared/shared-moderation/server-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts | |||
@@ -6,11 +6,11 @@ import { ServerBlock } from '@shared/models' | |||
6 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' | 6 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
7 | 7 | ||
8 | @Directive() | 8 | @Directive() |
9 | // tslint:disable-next-line: directive-class-suffix | 9 | // eslint-disable-next-line @angular-eslint/directive-class-suffix |
10 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { | 10 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { |
11 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent | 11 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent |
12 | 12 | ||
13 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 13 | // @ts-expect-error: "Abstract methods can only appear within an abstract class" |
14 | public abstract mode: BlocklistComponentType | 14 | public abstract mode: BlocklistComponentType |
15 | 15 | ||
16 | blockedServers: ServerBlock[] = [] | 16 | blockedServers: ServerBlock[] = [] |
@@ -25,7 +25,7 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit | |||
25 | super() | 25 | super() |
26 | } | 26 | } |
27 | 27 | ||
28 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 28 | // @ts-expect-error: "Abstract methods can only appear within an abstract class" |
29 | public abstract getIdentifier (): string | 29 | public abstract getIdentifier (): string |
30 | 30 | ||
31 | ngOnInit () { | 31 | ngOnInit () { |
@@ -34,8 +34,8 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit | |||
34 | 34 | ||
35 | unblockServer (serverBlock: ServerBlock) { | 35 | unblockServer (serverBlock: ServerBlock) { |
36 | const operation = (host: string) => this.mode === BlocklistComponentType.Account | 36 | const operation = (host: string) => this.mode === BlocklistComponentType.Account |
37 | ? this.blocklistService.unblockServerByUser(host) | 37 | ? this.blocklistService.unblockServerByUser(host) |
38 | : this.blocklistService.unblockServerByInstance(host) | 38 | : this.blocklistService.unblockServerByInstance(host) |
39 | const host = serverBlock.blockedServer.host | 39 | const host = serverBlock.blockedServer.host |
40 | 40 | ||
41 | operation(host).subscribe( | 41 | operation(host).subscribe( |
diff --git a/client/src/app/shared/shared-moderation/video-block.component.ts b/client/src/app/shared/shared-moderation/video-block.component.ts index bc6952620..f6c29dcfa 100644 --- a/client/src/app/shared/shared-moderation/video-block.component.ts +++ b/client/src/app/shared/shared-moderation/video-block.component.ts | |||
@@ -51,8 +51,8 @@ export class VideoBlockComponent extends FormReactive implements OnInit { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | block () { | 53 | block () { |
54 | const reason = this.form.value[ 'reason' ] || undefined | 54 | const reason = this.form.value['reason'] || undefined |
55 | const unfederate = this.video.isLocal ? this.form.value[ 'unfederate' ] : undefined | 55 | const unfederate = this.video.isLocal ? this.form.value['unfederate'] : undefined |
56 | 56 | ||
57 | this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate) | 57 | this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate) |
58 | .subscribe({ | 58 | .subscribe({ |