diff options
Diffstat (limited to 'client/src/app/+admin/moderation')
5 files changed, 31 insertions, 44 deletions
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts index 3f243aee4..032bf745a 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { RestPagination, RestTable } from '@app/shared' | 4 | import { RestPagination, RestTable } from '@app/shared' |
5 | import { SortMeta } from 'primeng/components/common/sortmeta' | 5 | import { SortMeta } from 'primeng/components/common/sortmeta' |
6 | import { BlocklistService, AccountBlock } from '@app/shared/blocklist' | 6 | import { AccountBlock, BlocklistService } from '@app/shared/blocklist' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-instance-account-blocklist', | 9 | selector: 'my-instance-account-blocklist', |
@@ -18,7 +18,7 @@ export class InstanceAccountBlocklistComponent extends RestTable implements OnIn | |||
18 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 18 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
19 | 19 | ||
20 | constructor ( | 20 | constructor ( |
21 | private notificationsService: NotificationsService, | 21 | private notifier: Notifier, |
22 | private blocklistService: BlocklistService, | 22 | private blocklistService: BlocklistService, |
23 | private i18n: I18n | 23 | private i18n: I18n |
24 | ) { | 24 | ) { |
@@ -35,8 +35,7 @@ export class InstanceAccountBlocklistComponent extends RestTable implements OnIn | |||
35 | this.blocklistService.unblockAccountByInstance(blockedAccount) | 35 | this.blocklistService.unblockAccountByInstance(blockedAccount) |
36 | .subscribe( | 36 | .subscribe( |
37 | () => { | 37 | () => { |
38 | this.notificationsService.success( | 38 | this.notifier.success( |
39 | this.i18n('Success'), | ||
40 | this.i18n('Account {{nameWithHost}} unmuted by your instance.', { nameWithHost: blockedAccount.nameWithHost }) | 39 | this.i18n('Account {{nameWithHost}} unmuted by your instance.', { nameWithHost: blockedAccount.nameWithHost }) |
41 | ) | 40 | ) |
42 | 41 | ||
@@ -53,7 +52,7 @@ export class InstanceAccountBlocklistComponent extends RestTable implements OnIn | |||
53 | this.totalRecords = resultList.total | 52 | this.totalRecords = resultList.total |
54 | }, | 53 | }, |
55 | 54 | ||
56 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 55 | err => this.notifier.error(err.message) |
57 | ) | 56 | ) |
58 | } | 57 | } |
59 | } | 58 | } |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts index 130009dc7..db3dfcd1c 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { RestPagination, RestTable } from '@app/shared' | 4 | import { RestPagination, RestTable } from '@app/shared' |
5 | import { SortMeta } from 'primeng/components/common/sortmeta' | 5 | import { SortMeta } from 'primeng/components/common/sortmeta' |
@@ -19,7 +19,7 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni | |||
19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
22 | private notificationsService: NotificationsService, | 22 | private notifier: Notifier, |
23 | private blocklistService: BlocklistService, | 23 | private blocklistService: BlocklistService, |
24 | private i18n: I18n | 24 | private i18n: I18n |
25 | ) { | 25 | ) { |
@@ -36,10 +36,7 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni | |||
36 | this.blocklistService.unblockServerByInstance(host) | 36 | this.blocklistService.unblockServerByInstance(host) |
37 | .subscribe( | 37 | .subscribe( |
38 | () => { | 38 | () => { |
39 | this.notificationsService.success( | 39 | this.notifier.success(this.i18n('Instance {{host}} unmuted by your instance.', { host })) |
40 | this.i18n('Success'), | ||
41 | this.i18n('Instance {{host}} unmuted by your instance.', { host }) | ||
42 | ) | ||
43 | 40 | ||
44 | this.loadData() | 41 | this.loadData() |
45 | } | 42 | } |
@@ -54,7 +51,7 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni | |||
54 | this.totalRecords = resultList.total | 51 | this.totalRecords = resultList.total |
55 | }, | 52 | }, |
56 | 53 | ||
57 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 54 | err => this.notifier.error(err.message) |
58 | ) | 55 | ) |
59 | } | 56 | } |
60 | } | 57 | } |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts index 34ab384d1..bebcb4207 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' | 3 | import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
@@ -22,7 +22,7 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI | |||
22 | constructor ( | 22 | constructor ( |
23 | protected formValidatorService: FormValidatorService, | 23 | protected formValidatorService: FormValidatorService, |
24 | private modalService: NgbModal, | 24 | private modalService: NgbModal, |
25 | private notificationsService: NotificationsService, | 25 | private notifier: Notifier, |
26 | private videoAbuseService: VideoAbuseService, | 26 | private videoAbuseService: VideoAbuseService, |
27 | private videoAbuseValidatorsService: VideoAbuseValidatorsService, | 27 | private videoAbuseValidatorsService: VideoAbuseValidatorsService, |
28 | private i18n: I18n | 28 | private i18n: I18n |
@@ -52,22 +52,19 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI | |||
52 | } | 52 | } |
53 | 53 | ||
54 | async banUser () { | 54 | async banUser () { |
55 | const moderationComment: string = this.form.value['moderationComment'] | 55 | const moderationComment: string = this.form.value[ 'moderationComment' ] |
56 | 56 | ||
57 | this.videoAbuseService.updateVideoAbuse(this.abuseToComment, { moderationComment }) | 57 | this.videoAbuseService.updateVideoAbuse(this.abuseToComment, { moderationComment }) |
58 | .subscribe( | 58 | .subscribe( |
59 | () => { | 59 | () => { |
60 | this.notificationsService.success( | 60 | this.notifier.success(this.i18n('Comment updated.')) |
61 | this.i18n('Success'), | ||
62 | this.i18n('Comment updated.') | ||
63 | ) | ||
64 | 61 | ||
65 | this.commentUpdated.emit(moderationComment) | 62 | this.commentUpdated.emit(moderationComment) |
66 | this.hideModerationCommentModal() | 63 | this.hideModerationCommentModal() |
67 | }, | 64 | }, |
68 | 65 | ||
69 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 66 | err => this.notifier.error(err.message) |
70 | ) | 67 | ) |
71 | } | 68 | } |
72 | 69 | ||
73 | } | 70 | } |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts index 7a219c846..f64234b74 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { Account } from '../../../shared/account/account.model' | 2 | import { Account } from '../../../shared/account/account.model' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { Notifier } from '@app/core' |
4 | import { SortMeta } from 'primeng/components/common/sortmeta' | 4 | import { SortMeta } from 'primeng/components/common/sortmeta' |
5 | import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' | 5 | import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' |
6 | import { RestPagination, RestTable, VideoAbuseService } from '../../../shared' | 6 | import { RestPagination, RestTable, VideoAbuseService } from '../../../shared' |
@@ -27,7 +27,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
27 | videoAbuseActions: DropdownAction<VideoAbuse>[] = [] | 27 | videoAbuseActions: DropdownAction<VideoAbuse>[] = [] |
28 | 28 | ||
29 | constructor ( | 29 | constructor ( |
30 | private notificationsService: NotificationsService, | 30 | private notifier: Notifier, |
31 | private videoAbuseService: VideoAbuseService, | 31 | private videoAbuseService: VideoAbuseService, |
32 | private confirmService: ConfirmService, | 32 | private confirmService: ConfirmService, |
33 | private i18n: I18n | 33 | private i18n: I18n |
@@ -90,14 +90,11 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
90 | 90 | ||
91 | this.videoAbuseService.removeVideoAbuse(videoAbuse).subscribe( | 91 | this.videoAbuseService.removeVideoAbuse(videoAbuse).subscribe( |
92 | () => { | 92 | () => { |
93 | this.notificationsService.success( | 93 | this.notifier.success(this.i18n('Abuse deleted.')) |
94 | this.i18n('Success'), | ||
95 | this.i18n('Abuse deleted.') | ||
96 | ) | ||
97 | this.loadData() | 94 | this.loadData() |
98 | }, | 95 | }, |
99 | 96 | ||
100 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 97 | err => this.notifier.error(err.message) |
101 | ) | 98 | ) |
102 | } | 99 | } |
103 | 100 | ||
@@ -106,7 +103,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
106 | .subscribe( | 103 | .subscribe( |
107 | () => this.loadData(), | 104 | () => this.loadData(), |
108 | 105 | ||
109 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 106 | err => this.notifier.error(err.message) |
110 | ) | 107 | ) |
111 | 108 | ||
112 | } | 109 | } |
@@ -119,7 +116,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
119 | this.totalRecords = resultList.total | 116 | this.totalRecords = resultList.total |
120 | }, | 117 | }, |
121 | 118 | ||
122 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 119 | err => this.notifier.error(err.message) |
123 | ) | 120 | ) |
124 | } | 121 | } |
125 | } | 122 | } |
diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts index e491edaca..a02e84f67 100644 --- a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts +++ b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { SortMeta } from 'primeng/components/common/sortmeta' | 2 | import { SortMeta } from 'primeng/components/common/sortmeta' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { Notifier } from '@app/core' |
4 | import { ConfirmService } from '../../../core' | 4 | import { ConfirmService } from '../../../core' |
5 | import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared' | 5 | import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared' |
6 | import { VideoBlacklist } from '../../../../../../shared' | 6 | import { VideoBlacklist } from '../../../../../../shared' |
@@ -23,7 +23,7 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
23 | videoBlacklistActions: DropdownAction<VideoBlacklist>[] = [] | 23 | videoBlacklistActions: DropdownAction<VideoBlacklist>[] = [] |
24 | 24 | ||
25 | constructor ( | 25 | constructor ( |
26 | private notificationsService: NotificationsService, | 26 | private notifier: Notifier, |
27 | private confirmService: ConfirmService, | 27 | private confirmService: ConfirmService, |
28 | private videoBlacklistService: VideoBlacklistService, | 28 | private videoBlacklistService: VideoBlacklistService, |
29 | private i18n: I18n | 29 | private i18n: I18n |
@@ -56,14 +56,11 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
56 | 56 | ||
57 | this.videoBlacklistService.removeVideoFromBlacklist(entry.video.id).subscribe( | 57 | this.videoBlacklistService.removeVideoFromBlacklist(entry.video.id).subscribe( |
58 | () => { | 58 | () => { |
59 | this.notificationsService.success( | 59 | this.notifier.success(this.i18n('Video {{name}} removed from the blacklist.', { name: entry.video.name })) |
60 | this.i18n('Success'), | ||
61 | this.i18n('Video {{name}} removed from the blacklist.', { name: entry.video.name }) | ||
62 | ) | ||
63 | this.loadData() | 60 | this.loadData() |
64 | }, | 61 | }, |
65 | 62 | ||
66 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 63 | err => this.notifier.error(err.message) |
67 | ) | 64 | ) |
68 | } | 65 | } |
69 | 66 | ||
@@ -75,7 +72,7 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
75 | this.totalRecords = resultList.total | 72 | this.totalRecords = resultList.total |
76 | }, | 73 | }, |
77 | 74 | ||
78 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 75 | err => this.notifier.error(err.message) |
79 | ) | 76 | ) |
80 | } | 77 | } |
81 | } | 78 | } |