aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 11:42:05 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit33f6dce136ca6e969fe374efa099bee3f2a3599d (patch)
tree7a0d6228bab085944015a01267ad31aa1ec6082e /client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
parent00004f7f6b966a975498612117212b5373f4103c (diff)
downloadPeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.tar.gz
PeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.tar.zst
PeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.zip
Add videos list admin component
Diffstat (limited to 'client/src/app/shared/shared-moderation/report-modals/video-report.component.ts')
-rw-r--r--client/src/app/shared/shared-moderation/report-modals/video-report.component.ts21
1 files changed, 1 insertions, 20 deletions
diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
index 278d60ac6..38dd92910 100644
--- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
+++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
@@ -1,13 +1,11 @@
1import { mapValues, pickBy } from 'lodash-es' 1import { mapValues, pickBy } from 'lodash-es'
2import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
3import { Component, Input, OnInit, ViewChild } from '@angular/core' 2import { Component, Input, OnInit, ViewChild } from '@angular/core'
4import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 3import { DomSanitizer } from '@angular/platform-browser'
5import { Notifier } from '@app/core' 4import { Notifier } from '@app/core'
6import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' 5import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators'
7import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 6import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
8import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 7import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
9import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 8import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
10import { decorateVideoLink } from '@shared/core-utils'
11import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' 9import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse'
12import { AbusePredefinedReasonsString } from '@shared/models' 10import { AbusePredefinedReasonsString } from '@shared/models'
13import { Video } from '../../shared-main' 11import { Video } from '../../shared-main'
@@ -25,7 +23,6 @@ export class VideoReportComponent extends FormReactive implements OnInit {
25 23
26 error: string = null 24 error: string = null
27 predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [] 25 predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = []
28 embedHtml: SafeHtml
29 26
30 private openedModal: NgbModalRef 27 private openedModal: NgbModalRef
31 28
@@ -55,20 +52,6 @@ export class VideoReportComponent extends FormReactive implements OnInit {
55 return this.form.get('timestamp').value 52 return this.form.get('timestamp').value
56 } 53 }
57 54
58 getVideoEmbed () {
59 return this.sanitizer.bypassSecurityTrustHtml(
60 buildVideoOrPlaylistEmbed(
61 decorateVideoLink({
62 url: this.video.embedUrl,
63 title: false,
64 warningTitle: false
65 }),
66
67 this.video.name
68 )
69 )
70 }
71
72 ngOnInit () { 55 ngOnInit () {
73 this.buildForm({ 56 this.buildForm({
74 reason: ABUSE_REASON_VALIDATOR, 57 reason: ABUSE_REASON_VALIDATOR,
@@ -82,8 +65,6 @@ export class VideoReportComponent extends FormReactive implements OnInit {
82 }) 65 })
83 66
84 this.predefinedReasons = this.abuseService.getPrefefinedReasons('video') 67 this.predefinedReasons = this.abuseService.getPrefefinedReasons('video')
85
86 this.embedHtml = this.getVideoEmbed()
87 } 68 }
88 69
89 show () { 70 show () {