diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-02 20:50:42 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-10 21:12:05 +0200 |
commit | 5baee5fca418487e72ddcd6419d31bca8659b668 (patch) | |
tree | 6604cc16d42152f4929d888565d2d435e2480d47 /client/src/app/shared/video/video-actions-dropdown.component.ts | |
parent | d840487fed32b4604b02030c0d7464afa925904f (diff) | |
download | PeerTube-5baee5fca418487e72ddcd6419d31bca8659b668.tar.gz PeerTube-5baee5fca418487e72ddcd6419d31bca8659b668.tar.zst PeerTube-5baee5fca418487e72ddcd6419d31bca8659b668.zip |
rename blacklist to block/blocklist, merge block and auto-block views
- also replace whitelist with allowlist
- add advanced filters for video-block-list view
- move icons in video-block-list and video-abuse-list to left side
for visibility
- add robot icon to depict automated nature of a block in
video-block-list
resolves #2790
Diffstat (limited to 'client/src/app/shared/video/video-actions-dropdown.component.ts')
-rw-r--r-- | client/src/app/shared/video/video-actions-dropdown.component.ts | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index 4e5fc6476..1f5763610 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts | |||
@@ -9,8 +9,8 @@ import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | |||
9 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' | 9 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' |
10 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' | 10 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' |
11 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' | 11 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' |
12 | import { VideoBlacklistComponent } from '@app/shared/video/modals/video-blacklist.component' | 12 | import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component' |
13 | import { VideoBlacklistService } from '@app/shared/video-blacklist' | 13 | import { VideoBlockService } from '@app/shared/video-block' |
14 | import { ScreenService } from '@app/shared/misc/screen.service' | 14 | import { ScreenService } from '@app/shared/misc/screen.service' |
15 | import { VideoCaption } from '@shared/models' | 15 | import { VideoCaption } from '@shared/models' |
16 | import { RedundancyService } from '@app/shared/video/redundancy.service' | 16 | import { RedundancyService } from '@app/shared/video/redundancy.service' |
@@ -36,7 +36,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
36 | 36 | ||
37 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent | 37 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent |
38 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent | 38 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent |
39 | @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent | 39 | @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent |
40 | 40 | ||
41 | @Input() video: Video | VideoDetails | 41 | @Input() video: Video | VideoDetails |
42 | @Input() videoCaptions: VideoCaption[] = [] | 42 | @Input() videoCaptions: VideoCaption[] = [] |
@@ -59,8 +59,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
59 | @Input() buttonDirection: DropdownDirection = 'vertical' | 59 | @Input() buttonDirection: DropdownDirection = 'vertical' |
60 | 60 | ||
61 | @Output() videoRemoved = new EventEmitter() | 61 | @Output() videoRemoved = new EventEmitter() |
62 | @Output() videoUnblacklisted = new EventEmitter() | 62 | @Output() videoUnblocked = new EventEmitter() |
63 | @Output() videoBlacklisted = new EventEmitter() | 63 | @Output() videoBlocked = new EventEmitter() |
64 | @Output() modalOpened = new EventEmitter() | 64 | @Output() modalOpened = new EventEmitter() |
65 | 65 | ||
66 | videoActions: DropdownAction<{ video: Video }>[][] = [] | 66 | videoActions: DropdownAction<{ video: Video }>[][] = [] |
@@ -71,7 +71,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
71 | private authService: AuthService, | 71 | private authService: AuthService, |
72 | private notifier: Notifier, | 72 | private notifier: Notifier, |
73 | private confirmService: ConfirmService, | 73 | private confirmService: ConfirmService, |
74 | private videoBlacklistService: VideoBlacklistService, | 74 | private videoBlocklistService: VideoBlockService, |
75 | private screenService: ScreenService, | 75 | private screenService: ScreenService, |
76 | private videoService: VideoService, | 76 | private videoService: VideoService, |
77 | private redundancyService: RedundancyService, | 77 | private redundancyService: RedundancyService, |
@@ -117,10 +117,10 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
117 | this.videoReportModal.show() | 117 | this.videoReportModal.show() |
118 | } | 118 | } |
119 | 119 | ||
120 | showBlacklistModal () { | 120 | showBlockModal () { |
121 | this.modalOpened.emit() | 121 | this.modalOpened.emit() |
122 | 122 | ||
123 | this.videoBlacklistModal.show() | 123 | this.videoBlockModal.show() |
124 | } | 124 | } |
125 | 125 | ||
126 | /* Actions checker */ | 126 | /* Actions checker */ |
@@ -133,12 +133,12 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
133 | return this.video.isRemovableBy(this.user) | 133 | return this.video.isRemovableBy(this.user) |
134 | } | 134 | } |
135 | 135 | ||
136 | isVideoBlacklistable () { | 136 | isVideoBlockable () { |
137 | return this.video.isBlackistableBy(this.user) | 137 | return this.video.isBlockableBy(this.user) |
138 | } | 138 | } |
139 | 139 | ||
140 | isVideoUnblacklistable () { | 140 | isVideoUnblockable () { |
141 | return this.video.isUnblacklistableBy(this.user) | 141 | return this.video.isUnblockableBy(this.user) |
142 | } | 142 | } |
143 | 143 | ||
144 | isVideoDownloadable () { | 144 | isVideoDownloadable () { |
@@ -151,22 +151,22 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
151 | 151 | ||
152 | /* Action handlers */ | 152 | /* Action handlers */ |
153 | 153 | ||
154 | async unblacklistVideo () { | 154 | async unblockVideo () { |
155 | const confirmMessage = this.i18n( | 155 | const confirmMessage = this.i18n( |
156 | 'Do you really want to remove this video from the blacklist? It will be available again in the videos list.' | 156 | 'Do you really want to unblock this video? It will be available again in the videos list.' |
157 | ) | 157 | ) |
158 | 158 | ||
159 | const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblacklist')) | 159 | const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblock')) |
160 | if (res === false) return | 160 | if (res === false) return |
161 | 161 | ||
162 | this.videoBlacklistService.removeVideoFromBlacklist(this.video.id).subscribe( | 162 | this.videoBlocklistService.unblockVideo(this.video.id).subscribe( |
163 | () => { | 163 | () => { |
164 | this.notifier.success(this.i18n('Video {{name}} removed from the blacklist.', { name: this.video.name })) | 164 | this.notifier.success(this.i18n('Video {{name}} unblocked.', { name: this.video.name })) |
165 | 165 | ||
166 | this.video.blacklisted = false | 166 | this.video.blacklisted = false |
167 | this.video.blacklistedReason = null | 167 | this.video.blockedReason = null |
168 | 168 | ||
169 | this.videoUnblacklisted.emit() | 169 | this.videoUnblocked.emit() |
170 | }, | 170 | }, |
171 | 171 | ||
172 | err => this.notifier.error(err.message) | 172 | err => this.notifier.error(err.message) |
@@ -203,8 +203,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
203 | ) | 203 | ) |
204 | } | 204 | } |
205 | 205 | ||
206 | onVideoBlacklisted () { | 206 | onVideoBlocked () { |
207 | this.videoBlacklisted.emit() | 207 | this.videoBlocked.emit() |
208 | } | 208 | } |
209 | 209 | ||
210 | getPlaylistDropdownPlacement () { | 210 | getPlaylistDropdownPlacement () { |
@@ -239,16 +239,16 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
239 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() | 239 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() |
240 | }, | 240 | }, |
241 | { | 241 | { |
242 | label: this.i18n('Blacklist'), | 242 | label: this.i18n('Block'), |
243 | handler: () => this.showBlacklistModal(), | 243 | handler: () => this.showBlockModal(), |
244 | iconName: 'no', | 244 | iconName: 'no', |
245 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlacklistable() | 245 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlockable() |
246 | }, | 246 | }, |
247 | { | 247 | { |
248 | label: this.i18n('Unblacklist'), | 248 | label: this.i18n('Unblock'), |
249 | handler: () => this.unblacklistVideo(), | 249 | handler: () => this.unblockVideo(), |
250 | iconName: 'undo', | 250 | iconName: 'undo', |
251 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblacklistable() | 251 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblockable() |
252 | }, | 252 | }, |
253 | { | 253 | { |
254 | label: this.i18n('Mirror'), | 254 | label: this.i18n('Mirror'), |