diff options
Diffstat (limited to 'client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts')
-rw-r--r-- | client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index 7baf34ca2..1fe8d0f9d 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts | |||
@@ -3,11 +3,10 @@ import { switchMap } from 'rxjs/operators' | |||
3 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' | 3 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' |
4 | import { environment } from 'src/environments/environment' | 4 | import { environment } from 'src/environments/environment' |
5 | import { Component, OnInit } from '@angular/core' | 5 | import { Component, OnInit } from '@angular/core' |
6 | import { DomSanitizer } from '@angular/platform-browser' | ||
7 | import { ActivatedRoute, Router } from '@angular/router' | 6 | import { ActivatedRoute, Router } from '@angular/router' |
8 | import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' | 7 | import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' |
9 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
10 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | 9 | import { DropdownAction, VideoService } from '@app/shared/shared-main' |
11 | import { VideoBlockService } from '@app/shared/shared-moderation' | 10 | import { VideoBlockService } from '@app/shared/shared-moderation' |
12 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' | 11 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' |
13 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | 12 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' |
@@ -18,7 +17,7 @@ import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | |||
18 | styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-block-list.component.scss' ] | 17 | styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-block-list.component.scss' ] |
19 | }) | 18 | }) |
20 | export class VideoBlockListComponent extends RestTable implements OnInit { | 19 | export class VideoBlockListComponent extends RestTable implements OnInit { |
21 | blocklist: (VideoBlacklist & { reasonHtml?: string, embedHtml?: string })[] = [] | 20 | blocklist: (VideoBlacklist & { reasonHtml?: string })[] = [] |
22 | totalRecords = 0 | 21 | totalRecords = 0 |
23 | sort: SortMeta = { field: 'createdAt', order: -1 } | 22 | sort: SortMeta = { field: 'createdAt', order: -1 } |
24 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
@@ -50,7 +49,6 @@ export class VideoBlockListComponent extends RestTable implements OnInit { | |||
50 | private confirmService: ConfirmService, | 49 | private confirmService: ConfirmService, |
51 | private videoBlocklistService: VideoBlockService, | 50 | private videoBlocklistService: VideoBlockService, |
52 | private markdownRenderer: MarkdownService, | 51 | private markdownRenderer: MarkdownService, |
53 | private sanitizer: DomSanitizer, | ||
54 | private videoService: VideoService | 52 | private videoService: VideoService |
55 | ) { | 53 | ) { |
56 | super() | 54 | super() |
@@ -125,10 +123,6 @@ export class VideoBlockListComponent extends RestTable implements OnInit { | |||
125 | return 'VideoBlockListComponent' | 123 | return 'VideoBlockListComponent' |
126 | } | 124 | } |
127 | 125 | ||
128 | getVideoUrl (videoBlock: VideoBlacklist) { | ||
129 | return Video.buildWatchUrl(videoBlock.video) | ||
130 | } | ||
131 | |||
132 | toHtml (text: string) { | 126 | toHtml (text: string) { |
133 | return this.markdownRenderer.textMarkdownToHTML(text) | 127 | return this.markdownRenderer.textMarkdownToHTML(text) |
134 | } | 128 | } |
@@ -176,8 +170,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit { | |||
176 | 170 | ||
177 | for (const element of this.blocklist) { | 171 | for (const element of this.blocklist) { |
178 | Object.assign(element, { | 172 | Object.assign(element, { |
179 | reasonHtml: await this.toHtml(element.reason), | 173 | reasonHtml: await this.toHtml(element.reason) |
180 | embedHtml: this.sanitizer.bypassSecurityTrustHtml(this.getVideoEmbed(element)) | ||
181 | }) | 174 | }) |
182 | } | 175 | } |
183 | }, | 176 | }, |