diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-14 09:08:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-14 09:27:18 +0200 |
commit | 191764f30b0a812bf3a9dbdc7daf1d5afe25e12a (patch) | |
tree | a5592f8d89949cde832f025e393a3821ad2aca37 /client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts | |
parent | 26b7305a232e547709f433a6edf700bf495935d8 (diff) | |
download | PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.tar.gz PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.tar.zst PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.zip |
Improve blacklist management
Diffstat (limited to 'client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts')
-rw-r--r-- | client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts index 00b0ac57e..0618252b8 100644 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts +++ b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts | |||
@@ -3,9 +3,10 @@ import { SortMeta } from 'primeng/components/common/sortmeta' | |||
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
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 { BlacklistedVideo } from '../../../../../../shared' | 6 | import { VideoBlacklist } from '../../../../../../shared' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | 8 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' |
9 | import { Video } from '@app/shared/video/video.model' | ||
9 | 10 | ||
10 | @Component({ | 11 | @Component({ |
11 | selector: 'my-video-blacklist-list', | 12 | selector: 'my-video-blacklist-list', |
@@ -13,13 +14,13 @@ import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | |||
13 | styleUrls: [ './video-blacklist-list.component.scss' ] | 14 | styleUrls: [ './video-blacklist-list.component.scss' ] |
14 | }) | 15 | }) |
15 | export class VideoBlacklistListComponent extends RestTable implements OnInit { | 16 | export class VideoBlacklistListComponent extends RestTable implements OnInit { |
16 | blacklist: BlacklistedVideo[] = [] | 17 | blacklist: VideoBlacklist[] = [] |
17 | totalRecords = 0 | 18 | totalRecords = 0 |
18 | rowsPerPage = 10 | 19 | rowsPerPage = 10 |
19 | sort: SortMeta = { field: 'createdAt', order: 1 } | 20 | sort: SortMeta = { field: 'createdAt', order: 1 } |
20 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 21 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
21 | 22 | ||
22 | videoBlacklistActions: DropdownAction<BlacklistedVideo>[] = [] | 23 | videoBlacklistActions: DropdownAction<VideoBlacklist>[] = [] |
23 | 24 | ||
24 | constructor ( | 25 | constructor ( |
25 | private notificationsService: NotificationsService, | 26 | private notificationsService: NotificationsService, |
@@ -41,7 +42,11 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
41 | this.loadSort() | 42 | this.loadSort() |
42 | } | 43 | } |
43 | 44 | ||
44 | async removeVideoFromBlacklist (entry: BlacklistedVideo) { | 45 | getVideoUrl (videoBlacklist: VideoBlacklist) { |
46 | return Video.buildClientUrl(videoBlacklist.video.uuid) | ||
47 | } | ||
48 | |||
49 | async removeVideoFromBlacklist (entry: VideoBlacklist) { | ||
45 | const confirmMessage = this.i18n( | 50 | const confirmMessage = this.i18n( |
46 | 'Do you really want to remove this video from the blacklist? It will be available again in the videos list.' | 51 | 'Do you really want to remove this video from the blacklist? It will be available again in the videos list.' |
47 | ) | 52 | ) |